From d8851f99c9f51119f0bcc9042abe87b64479cca9 Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Mon, 15 Apr 2019 14:40:03 +0100 Subject: Editor fixes and sidebar accordion --- pydis_site/static/js/wiki/load_editor.js | 3 ++ pydis_site/templates/wiki/edit.html | 4 +-- pydis_site/templates/wiki/forms/fields/char.html | 28 +++++++++-------- pydis_site/templates/wiki/forms/fields/image.html | 31 +++++++++++++++++++ .../templates/wiki/includes/article_menu.html | 6 ---- .../templates/wiki/includes/editor_sidebar.html | 36 ++++++++++++++-------- 6 files changed, 74 insertions(+), 34 deletions(-) create mode 100644 pydis_site/templates/wiki/forms/fields/image.html (limited to 'pydis_site') diff --git a/pydis_site/static/js/wiki/load_editor.js b/pydis_site/static/js/wiki/load_editor.js index dfa087d9..6eddbe1e 100644 --- a/pydis_site/static/js/wiki/load_editor.js +++ b/pydis_site/static/js/wiki/load_editor.js @@ -39,6 +39,7 @@ forceSync: true, indentWithTabs: false, initialValue: element.value, + lineWrapping: true, placeholder: "**Write some _markdown_!**", spellChecker: false, tabSize: 4, @@ -50,6 +51,8 @@ "preview", "side-by-side", "fullscreen", "|", "guide" ], + + status: false, }) } })(); diff --git a/pydis_site/templates/wiki/edit.html b/pydis_site/templates/wiki/edit.html index 8bc05ffb..fb3efb31 100644 --- a/pydis_site/templates/wiki/edit.html +++ b/pydis_site/templates/wiki/edit.html @@ -17,7 +17,7 @@
-
+
{% with edit_form as form %} {% include "wiki/includes/editor.html" %} @@ -64,7 +64,7 @@
-
+
{% include "wiki/includes/editor_sidebar.html" %}
diff --git a/pydis_site/templates/wiki/forms/fields/char.html b/pydis_site/templates/wiki/forms/fields/char.html index 0f130751..4c48d300 100644 --- a/pydis_site/templates/wiki/forms/fields/char.html +++ b/pydis_site/templates/wiki/forms/fields/char.html @@ -1,19 +1,21 @@
-
- {% if field.label %} - - {% endif %} + {% if not is_markitup %} +
+ {% if field.label %} + + {% endif %} - {% if field.help_text %} -

- {{ field.help_text|safe }} -

- {% endif %} -
+ {% if field.help_text %} +

+ {{ field.help_text|safe }} +

+ {% endif %} +
+ {% endif %} -
+
{% if is_markitup %} diff --git a/pydis_site/templates/wiki/forms/fields/image.html b/pydis_site/templates/wiki/forms/fields/image.html new file mode 100644 index 00000000..47e115fe --- /dev/null +++ b/pydis_site/templates/wiki/forms/fields/image.html @@ -0,0 +1,31 @@ +
+
+ {% if field.label %} + + {% endif %} + + {% if field.help_text %} +

+ {{ field.help_text|safe }} +

+ {% endif %} +
+ +
+
+
+ {{ field }} +
+ + {% if field.errors %} +

+ {% for error in field.errors %} + {{ error }}
+ {% endfor %} +

+ {% endif %} +
+
+
diff --git a/pydis_site/templates/wiki/includes/article_menu.html b/pydis_site/templates/wiki/includes/article_menu.html index cbaf024c..5429f6a8 100644 --- a/pydis_site/templates/wiki/includes/article_menu.html +++ b/pydis_site/templates/wiki/includes/article_menu.html @@ -70,12 +70,6 @@  View - -
diff --git a/pydis_site/templates/wiki/includes/editor_sidebar.html b/pydis_site/templates/wiki/includes/editor_sidebar.html index 5dd2f18b..2eebb80f 100644 --- a/pydis_site/templates/wiki/includes/editor_sidebar.html +++ b/pydis_site/templates/wiki/includes/editor_sidebar.html @@ -1,19 +1,26 @@ {% load i18n sekizai_tags %} -
- +
{% for plugin, plugin_form in sidebar %} -
+
+
+

+ {% if plugin.sidebar.icon_class %} + + {% if plugin.sidebar.icon_class == "fa-picture-o" %} + + {% else %} + + {% endif %} + + {% endif %} + {{ plugin.sidebar.headline }} +

- - -
-
+
+
{% if plugin.sidebar.template %} {% with plugin_form as form %}
- -
+
{% endfor %} -
+
+ + -- cgit v1.2.3