aboutsummaryrefslogtreecommitdiffstats
path: root/libpathod
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-06-21 16:25:27 +1200
committerAldo Cortesi <aldo@nullcube.com>2012-06-21 16:25:27 +1200
commitf88e899274b097317db496245758181b43c1d72a (patch)
tree3478166530e98a9c63ab6823198e11ce13263090 /libpathod
parentf0fd33fb11513a3e74079eaed5f5c1b8bb4e561d (diff)
downloadmitmproxy-f88e899274b097317db496245758181b43c1d72a.tar.gz
mitmproxy-f88e899274b097317db496245758181b43c1d72a.tar.bz2
mitmproxy-f88e899274b097317db496245758181b43c1d72a.zip
Built-in app: Index page.
Diffstat (limited to 'libpathod')
-rw-r--r--libpathod/app.py13
-rw-r--r--libpathod/templates/frame.html8
-rw-r--r--libpathod/templates/index.html6
3 files changed, 19 insertions, 8 deletions
diff --git a/libpathod/app.py b/libpathod/app.py
index 1e65bc4f..2a738b58 100644
--- a/libpathod/app.py
+++ b/libpathod/app.py
@@ -1,5 +1,8 @@
-from flask import Flask, jsonify
+import logging
+from flask import Flask, jsonify, render_template
import version
+
+logging.basicConfig(level="DEBUG")
app = Flask(__name__)
@app.route('/api/info')
@@ -22,6 +25,14 @@ def api_clear_log():
return "OK"
+
+@app.route('/')
+@app.route('/index.html')
+def index():
+ return render_template("index.html", name="index", section="main")
+
+
+
"""
class _Page(tornado.web.RequestHandler):
def render(self, name, **kwargs):
diff --git a/libpathod/templates/frame.html b/libpathod/templates/frame.html
index b0c298b6..3dd7fbf8 100644
--- a/libpathod/templates/frame.html
+++ b/libpathod/templates/frame.html
@@ -18,9 +18,9 @@
<div class="container">
<a class="brand" href="/">Pathod</a>
<ul class="nav">
- <li {% if section== "main" %} class="active" {% end %}><a href="/">Main</a></li>
- <li {% if section== "log" %} class="active" {% end %}><a href="/log">Log</a></li>
- <li {% if section== "help" %} class="active" {% end %}><a href="/help">Help</a></li>
+ <li {% if section== "main" %} class="active" {% endif %}><a href="/">Main</a></li>
+ <li {% if section== "log" %} class="active" {% endif %}><a href="/log">Log</a></li>
+ <li {% if section== "help" %} class="active" {% endif %}><a href="/help">Help</a></li>
</ul>
</div>
</div>
@@ -29,7 +29,7 @@
<div class="container">
{% block body %}
- {% end %}
+ {% endblock %}
<hr>
<p>by <a href="http://corte.si">Aldo Cortesi</a> </p>
diff --git a/libpathod/templates/index.html b/libpathod/templates/index.html
index 396137d6..07145b85 100644
--- a/libpathod/templates/index.html
+++ b/libpathod/templates/index.html
@@ -1,4 +1,4 @@
-{% extends frame.html %}
+{% extends "frame.html" %}
{% block body %}
- {% include previewform.html %}
-{% end %}
+ {% include "previewform.html" %}
+{% endblock %}