Skip to content
Snippets Groups Projects
Commit 18dadb0e authored by Martin Mareš's avatar Martin Mareš
Browse files

Restrict editing of the "public" flag

Making a topic public without sending notifications can confuse
students.

Closes #101.
parent 1732ed53
No related branches found
No related tags found
No related merge requests found
......@@ -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 %}
......
{% 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 %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment