Permalink
Browse files

Add reports and add nick

- boxes after list of nicks allow adding more nicks and viewing report
  • Loading branch information...
olleolleolle committed Oct 24, 2011
1 parent d8cc6ce commit 56497f30a311047f20a51d7226c29f5db037fd6c
Showing with 56 additions and 3 deletions.
  1. +7 −1 mugshots.py
  2. +10 −1 static/forsk.js
  3. +19 −0 static/style.css
  4. +20 −1 templates/index.html
View
@@ -66,7 +66,13 @@ def index():
otherkey = '%s:%s' % (person, today)
circle = db.get(otherkey) or ''
members.append(dict(name=person, circle=circle))
- return render_template('index.html', members=members, circles=circles)
+
+ reports = set()
+ for candidate_month in db.keys('meetups:*'):
+ junk, _, month = candidate_month.partition(":")
+ reports.add(month)
+
+ return render_template('index.html', members=members, circles=circles, reports=reports)
@app.route("/attend")
def attend():
View
@@ -33,5 +33,14 @@ $(function() {
});
-
+ $('.box h3').click(function() {
+ $(this)
+ .parent()
+ .find('ul')
+ .show('slow')
+ .end()
+ .find('form')
+ .show('slow')
+ .end();
+ });
});
View
@@ -18,3 +18,22 @@ span {
font-style: italic;
font-size: 70%;
}
+
+#addnick input {width:300px}
+
+.box {
+ float: left;
+ border-radius: 20px;
+ width:300px;
+ background: #eee;
+ padding: 1em;
+ margin-left: 10px;
+}
+.box h3 {
+ margin:0 0 10px 0;
+ font-size: 1.3em;
+}
+#viewreports ul { margin:0; list-style-type: none; padding:0;}
+#viewreports ul li { margin:0; padding:0; }
+
+.notshown {display:none;}
View
@@ -38,6 +38,25 @@ <h2>Vad gör personen i afton?</h2>
{% endfor %}
<ul>
</div>
-
+
+ <div id=addnick class=box >
+ <h3>Ny forskare...</h3>
+ <form action=/join class=notshown>
+ <label for=nick>Nickname:</label>
+ <input id=nick name=nick>
+ </form>
+ </div>
+ <div id=viewreports class=box>
+ <h3>Läs rapport...</h3>
+ <ul class=notshown>
+ {% for report in reports %}
+ <li>
+ <a href={{ url_for('report_one_month') }}?month={{ report }}>{{ report }}</a>
+ </li>
+ {% endfor %}
+ </ul>
+ </div>
+
+
</body>
</html>

0 comments on commit 56497f3

Please sign in to comment.