Browse Source

Add a real HTML/CSS structure

Baptiste Jonglez 10 years ago
parent
commit
98f70e109f
7 changed files with 1680 additions and 5 deletions
  1. 5 0
      peerfinder.py
  2. 1627 0
      static/css/knacss.css
  3. 26 0
      static/css/style.css
  4. 5 3
      templates/home.html
  5. 6 1
      templates/participant.html
  6. 7 1
      templates/results.html
  7. 4 0
      templates/submit.html

+ 5 - 0
peerfinder.py

@@ -161,6 +161,11 @@ def get_targets(uuid):
 def homepage():
     return render_template('home.html')
 
+@app.route('/static/<path:path>')
+def static_proxy(path):
+    # send_static_file will guess the correct MIME type
+    return app.send_static_file(path)
+
 @app.route('/robots.txt')
 def robots():
     return app.send_static_file("robots.txt")

File diff suppressed because it is too large
+ 1627 - 0
static/css/knacss.css


+ 26 - 0
static/css/style.css

@@ -0,0 +1,26 @@
+html {
+    background-color: white;
+}
+
+body {
+    margin: 2ex;
+    padding: 3ex;
+    background-color: #eee;
+    border: thin solid #ccc;
+    border-radius: 2ex;
+}
+
+#navigation {
+    background-color: #ccc;
+    border: thin solid #aaa;
+    border-radius: 2ex;
+}
+
+h1, h2 {
+    text-transform: uppercase;
+}
+
+input[type=text] {
+    border-radius: 100ex;
+    border-style: solid;
+}

+ 5 - 3
templates/home.html

@@ -1,5 +1,6 @@
-<h1>dn42 peer finder</h1>
+{% extends "base.html" %}
 
+{% block content %}
 <h2>What is this?</h2>
 
 <p>This tool allows you to find "good" peerings for dn42, by measuring the
@@ -20,7 +21,7 @@ latency from various points in the network towards you.</p>
 <form action="/submit" method="POST">
 Target:
 <input type="text" name="target" />
-<input type="submit" name="Launch" />
+<input type="submit" value="Launch" />
 </form>
 </p>
 
@@ -120,7 +121,7 @@ to peer.</p>
 <form action="/create/participant" method="POST">
 Machine name (required): <input type="text" name="name" /><br />
 Mean of contacting you, like IRC nick, mail address, ... (optional): <input type="text" name="contact" /><br />
-<input type="submit" name="Register" />
+<input type="submit" value="Register" />
 </form>
 
 
@@ -166,3 +167,4 @@ Unavoidable facts that cannot be fixed:
     come from)</lI>
   </ol>
 </p>
+{% endblock %}

+ 6 - 1
templates/participant.html

@@ -1,4 +1,7 @@
-<p>Thank you for participating!</p>
+{% extends "base.html" %}
+
+{% block content %}
+<h2>Thank you for participating!</h2>
 
 <p>Your unique UUID is <strong>{{ uuid }}</strong>.<br />
 It will be used to identify you to the measurement platform when you submit
@@ -22,3 +25,5 @@ latency, with your UUID already pre-configured:</p>
 {% include "run.sh" %}
 </pre>
 </p>
+
+{% endblock %}

+ 7 - 1
templates/results.html

@@ -1,4 +1,9 @@
-Latencies to <strong>{{ target }}</strong> (job submitted at {{ target.submitted }})
+{% extends "base.html" %}
+
+{% block content %}
+<h2>Latency to {{ target }}</h2>
+
+<p>Job submitted at {{ target.submitted }}</p>
 
 <table>
   <tr>
@@ -20,3 +25,4 @@ Latencies to <strong>{{ target }}</strong> (job submitted at {{ target.submitted
   </tr>
   {% endfor %}
 </table>
+{% endblock %}

+ 4 - 0
templates/submit.html

@@ -1,3 +1,6 @@
+{% extends "base.html" %}
+
+{% block content %}
 <p>Your request has been submitted, ping will be launched towards the
 specified targets.</p>
 
@@ -10,3 +13,4 @@ specified targets.</p>
     {% endfor %}
   </ul>
 </p>
+{% endblock %}