aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunasSudo <runassudo@yingtongli.me>2017-09-06 08:46:00 +1000
committerRunasSudo <runassudo@yingtongli.me>2017-09-06 08:46:00 +1000
commit5ac16464290d37b87cf1ea417a75befa163950b5 (patch)
tree06869c01b923d00db3cd69635a57ddac5377cf56
parente62ea2a4a7294d9695e4f0effa856ef946231c2a (diff)
Add summary view of questions
-rw-r--r--pblive/__main__.py7
-rw-r--r--pblive/templates/admin_session_full.html38
2 files changed, 45 insertions, 0 deletions
diff --git a/pblive/__main__.py b/pblive/__main__.py
index efdb8d0..299a9d2 100644
--- a/pblive/__main__.py
+++ b/pblive/__main__.py
@@ -71,6 +71,10 @@ def image(location):
def admin_session(session_name):
return flask.render_template('admin_session.html', session=data.sessions[session_name])
+@app.route('/admin/session/<session_name>/full')
+def admin_session_full(session_name):
+ return flask.render_template('admin_session_full.html', session=data.sessions[session_name], render_question_full=render_question_full)
+
@app.route('/debug')
def debug():
assert app.debug == False
@@ -90,6 +94,9 @@ def socket_join(session_name):
def render_question(user, session, question_num):
return flask.render_template(session.questions[question_num].template, session=session, user=user, question_num=session.question_num)
+def render_question_full(session, question_num):
+ return flask.render_template(session.questions[question_num].template, session=session, user=data.User(), question_num=question_num)
+
def render_question_admin(session, question_num):
return flask.render_template(session.questions[question_num].template_admin, session=session, question_num=session.question_num)
diff --git a/pblive/templates/admin_session_full.html b/pblive/templates/admin_session_full.html
new file mode 100644
index 0000000..dd38831
--- /dev/null
+++ b/pblive/templates/admin_session_full.html
@@ -0,0 +1,38 @@
+{#
+ PBLive
+ Copyright © 2017 RunasSudo (Yingtong Li)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+#}
+
+{% extends 'semantic_base.html' %}
+
+{% block main %}
+ <div id="session_main">
+ <h1 class="ui dividing header">{{ session.title }}</h1>
+ {% for _ in session.questions %}
+ {% if loop.index0 > 0 %}
+ <div style="margin-bottom: 2em;">
+ {{ render_question_full(session, loop.index0)|safe }}
+ </div>
+ {% endif %}
+ {% endfor %}
+ </div>
+{% endblock %}
+
+{% block script %}
+ <script>
+ $('.message').removeClass('hidden');
+ </script>
+{% endblock %}
Contact (issues, pull requests, etc.) at git@yingtongli.me. Generated by cgit.