aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-05-19 13:06:10 +0100
committerGravatar Gareth Coles <[email protected]>2018-05-19 13:06:10 +0100
commit0dd2a06c696348db2a6602d148a91c4df42586b6 (patch)
treec9b588efaa16dbe4a7f197be0c60fd708695c31c
parent[Jams] Complete question listing/editing/etc (diff)
Fix some small question-editing bugs
-rw-r--r--pysite/views/staff/jams/forms/questions_edit.py2
-rw-r--r--templates/staff/jams/forms/questions_edit.html2
-rw-r--r--templates/staff/jams/forms/questions_view.html4
3 files changed, 5 insertions, 3 deletions
diff --git a/pysite/views/staff/jams/forms/questions_edit.py b/pysite/views/staff/jams/forms/questions_edit.py
index 94132e0d..cbc5158e 100644
--- a/pysite/views/staff/jams/forms/questions_edit.py
+++ b/pysite/views/staff/jams/forms/questions_edit.py
@@ -24,6 +24,8 @@ class StaffView(RouteView, DBMixin):
if not question_obj:
return NotFound()
+ question_obj["data"] = question_obj.get("data", {})
+
return self.render(
"staff/jams/forms/questions_edit.html", question=question_obj
)
diff --git a/templates/staff/jams/forms/questions_edit.html b/templates/staff/jams/forms/questions_edit.html
index af143540..d029cc33 100644
--- a/templates/staff/jams/forms/questions_edit.html
+++ b/templates/staff/jams/forms/questions_edit.html
@@ -7,7 +7,7 @@
{% endblock %}
{% block content %}
<div class="uk-container uk-container-small uk-section">
- <h1>Question Edit: {{ question.id }}</h1>
+ <h1>Question Edit</h1>
<form class="uk-form-horizontal" method="post" action="{{ url_for("staff.jams.forms.questions.edit", question=question.id) }}">
<div>
diff --git a/templates/staff/jams/forms/questions_view.html b/templates/staff/jams/forms/questions_view.html
index eb545451..c9d5098c 100644
--- a/templates/staff/jams/forms/questions_view.html
+++ b/templates/staff/jams/forms/questions_view.html
@@ -221,7 +221,7 @@
const no_questions_paragraph = document.getElementById("no-questions-paragraph");
let all_questions = {{ question_ids | safe }};
- const question_edit_url = "{{ url_for("staff.jams.forms.questions.edit", question="{NONE}") }}";
+ const question_edit_url = "{{ url_for("staff.jams.forms.questions.edit", question="NONE") }}";
const add_button = document.getElementById("add-button");
const modal = UIkit.modal(document.getElementById("question-modal"));
@@ -575,7 +575,7 @@
}
let type = toTitleCase(question.type);
- let q_url = question_edit_url.replace("{NONE}", question.id);
+ let q_url = question_edit_url.replace("NONE", question.id);
const row = `
<td class="uk-table-shrink">