]> git.aero2k.de Git - sirius.git/commitdiff
adding a basic page to navigate devices
authorMatt Webb <matt@interconnected.org>
Fri, 26 Sep 2014 19:19:14 +0000 (20:19 +0100)
committerMatt Webb <matt@interconnected.org>
Fri, 26 Sep 2014 19:19:14 +0000 (20:19 +0100)
app/main/__init__.py
app/templates/dump.html [new file with mode: 0644]
app/templates/index.html

index 7a2645c7e76fc001ec13d6f609441a03f24b3565..5ffa8898d71f3fcdddcfb19539dea47a62637dbf 100644 (file)
@@ -8,9 +8,7 @@ main = Blueprint('main', __name__)
 
 @main.route('/')
 def index():
-       devices = []
-       
-       
+       devices = Device.query.all()
        
        return render_template('index.html', devices=devices)
 
diff --git a/app/templates/dump.html b/app/templates/dump.html
new file mode 100644 (file)
index 0000000..3d8d11d
--- /dev/null
@@ -0,0 +1,12 @@
+{% extends "base.html" %}
+
+{% block title %}Sirius - Dump{% endblock %}
+
+{% block page_content %}
+<h1>Dump page</h1>
+
+<pre>
+{{ dump }}
+</pre>
+
+{% endblock %}
\ No newline at end of file
index 5c33eac42c2ea771ab48f7e7a741a9092bcb0179..b5f7697378cd71221a237b2b42fb538bf0819c00 100644 (file)
@@ -4,4 +4,11 @@
 
 {% block page_content %}
 <h1>Hello, World!</h1>
+
+<ul>
+       {% for d in devices %}
+       <li><a href="{{ url_for('main.device', device_address=d.device_address) }}">{{ d.device_address }}</a></li>
+       {% endfor %}
+</ul>
+
 {% endblock %}
\ No newline at end of file