diff --git a/owl/templates/admin-edit-topic.html b/owl/templates/admin-edit-topic.html index fca64f7da78c7adeed31a4b91867ce419c7f24a6..76f7eb547886b7c470809d707b366e44e64a7ac4 100644 --- a/owl/templates/admin-edit-topic.html +++ b/owl/templates/admin-edit-topic.html @@ -36,7 +36,11 @@ {{ f.field(form, 'auto_eval', 'URL of an external services used for automatic evaluation of this topic') }} {{ f.field(form, 'custom_attrs', 'custom attributes available via API (in JSON)') }} {% endif %} + {% if form.public.data %} {{ f.field(form, 'public', 'topic is visible to students') }} + {% else %} + {{ f.field(form, 'public', 'topic is visible to students; use “Save and publish“ to change this', disabled=True) }} + {% endif %} </table> <p class=buttons>{{ form.submit(class='ok', accesskey='s') }} {% if edit_topic != None %} diff --git a/owl/templates/parts/form.html b/owl/templates/parts/form.html index 3e96e1dbd62274be259007a56a71305a4015e568..ecd7318f8980163959242cfab01d15e128b2039f 100644 --- a/owl/templates/parts/form.html +++ b/owl/templates/parts/form.html @@ -1,7 +1,7 @@ -{% macro field(form, name, help=None) %} +{% macro field(form, name, help=None, disabled=False) %} <tr> {{ field_label(form, name) }} - <td>{{ form[name]() }} + <td>{{ form[name](disabled=disabled) }} {{ field_help(form, name, help) }} {% endmacro %}