add topic sorting & js to support it
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{%- from 'common/macros.html' import subheader, babycode_editor_component -%}
|
||||
{%- from 'common/macros.html' import subheader, babycode_editor_component, sortable_list, sortable_list_item -%}
|
||||
{%- extends 'base.html' -%}
|
||||
{%- block title -%}settings{%- endblock -%}
|
||||
{%- block content -%}
|
||||
@@ -19,5 +19,18 @@
|
||||
</fieldset>
|
||||
<fieldset class="plank" id="sort-topics">
|
||||
<legend>Sort topics</legend>
|
||||
<p>Drag topics around to reorder them. Press "Save order" when done.</p>
|
||||
<form method="POST" action="{{url_for('mod.sort_topics')}}">
|
||||
<input type="submit" value="Save order">
|
||||
{%- call() sortable_list() -%}
|
||||
{%- for topic in topics -%}
|
||||
{%- call() sortable_list_item(key="topics") -%}
|
||||
<h2 class="info">{{ topic.name }}</h2>
|
||||
<div>{{topic.description}}</div>
|
||||
<input type="hidden" name="topics[]" value="{{ topic.id }}">
|
||||
{%- endcall -%}
|
||||
{%- endfor -%}
|
||||
{%- endcall -%}
|
||||
</form>
|
||||
</fieldset>
|
||||
{%- endblock -%}
|
||||
|
||||
Reference in New Issue
Block a user