From 027475779bfa7db50a1c1ff9935bcb546b33f961 Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Mon, 8 Apr 2019 14:06:11 +0100 Subject: Add base templates for django-wiki, as provided --- .../templates/wiki/includes/anonymous_blocked.html | 13 +++++ .../templates/wiki/includes/article_menu.html | 53 +++++++++++++++++++ .../templates/wiki/includes/breadcrumbs.html | 61 ++++++++++++++++++++++ pydis_site/templates/wiki/includes/editor.html | 11 ++++ .../templates/wiki/includes/editor_sidebar.html | 42 +++++++++++++++ .../templates/wiki/includes/editormedia.html | 15 ++++++ pydis_site/templates/wiki/includes/form.html | 17 ++++++ pydis_site/templates/wiki/includes/formerrors.html | 8 +++ pydis_site/templates/wiki/includes/formfield.html | 25 +++++++++ pydis_site/templates/wiki/includes/messages.html | 9 ++++ pydis_site/templates/wiki/includes/modals.html | 31 +++++++++++ pydis_site/templates/wiki/includes/move_tree.html | 16 ++++++ pydis_site/templates/wiki/includes/pagination.html | 24 +++++++++ pydis_site/templates/wiki/includes/render.html | 26 +++++++++ .../templates/wiki/includes/revision_info.html | 25 +++++++++ .../templates/wiki/includes/searchresult.html | 22 ++++++++ 16 files changed, 398 insertions(+) create mode 100644 pydis_site/templates/wiki/includes/anonymous_blocked.html create mode 100644 pydis_site/templates/wiki/includes/article_menu.html create mode 100644 pydis_site/templates/wiki/includes/breadcrumbs.html create mode 100644 pydis_site/templates/wiki/includes/editor.html create mode 100644 pydis_site/templates/wiki/includes/editor_sidebar.html create mode 100644 pydis_site/templates/wiki/includes/editormedia.html create mode 100644 pydis_site/templates/wiki/includes/form.html create mode 100644 pydis_site/templates/wiki/includes/formerrors.html create mode 100644 pydis_site/templates/wiki/includes/formfield.html create mode 100644 pydis_site/templates/wiki/includes/messages.html create mode 100644 pydis_site/templates/wiki/includes/modals.html create mode 100644 pydis_site/templates/wiki/includes/move_tree.html create mode 100644 pydis_site/templates/wiki/includes/pagination.html create mode 100644 pydis_site/templates/wiki/includes/render.html create mode 100644 pydis_site/templates/wiki/includes/revision_info.html create mode 100644 pydis_site/templates/wiki/includes/searchresult.html (limited to 'pydis_site/templates/wiki/includes') diff --git a/pydis_site/templates/wiki/includes/anonymous_blocked.html b/pydis_site/templates/wiki/includes/anonymous_blocked.html new file mode 100644 index 00000000..5e1d3dac --- /dev/null +++ b/pydis_site/templates/wiki/includes/anonymous_blocked.html @@ -0,0 +1,13 @@ +{% load i18n %} + + +{% url 'wiki:signup' as signup_url %} +{% url 'wiki:login' as login_url %} +{% if login_url and signup_url %} + {% blocktrans trimmed %} + You need to log in or sign up to use this function. + {% endblocktrans %} +{% else %} + {% trans "You need to log in or sign up to use this function." %} +{% endif %} + diff --git a/pydis_site/templates/wiki/includes/article_menu.html b/pydis_site/templates/wiki/includes/article_menu.html new file mode 100644 index 00000000..9a83327b --- /dev/null +++ b/pydis_site/templates/wiki/includes/article_menu.html @@ -0,0 +1,53 @@ +{% load i18n wiki_tags %} + +{% with selected_tab as selected %} + +
  • + {% if not user.is_anonymous %} + + + + + {% endif %} +
  • + +{% for plugin in article_tabs %} +
  • + + + + +
  • +{% endfor %} + +
  • + + + + +
  • + +{% if article|can_write:user and not article.current_revision.locked %} +
  • + + + + +
  • +{% else %} +
  • + + + + +
  • +{% endif %} + +
  • + + + + +
  • + +{% endwith %} diff --git a/pydis_site/templates/wiki/includes/breadcrumbs.html b/pydis_site/templates/wiki/includes/breadcrumbs.html new file mode 100644 index 00000000..b7a8aeae --- /dev/null +++ b/pydis_site/templates/wiki/includes/breadcrumbs.html @@ -0,0 +1,61 @@ +{% load i18n %} +{% if urlpath %} +
    + + +
    +
    + + + + + +
    +
    + +
    +
    +{% endif %} diff --git a/pydis_site/templates/wiki/includes/editor.html b/pydis_site/templates/wiki/includes/editor.html new file mode 100644 index 00000000..6686d8dd --- /dev/null +++ b/pydis_site/templates/wiki/includes/editor.html @@ -0,0 +1,11 @@ +{% load wiki_tags i18n sekizai_tags %} +{% include "wiki/includes/editormedia.html" %} + +{% wiki_form form %} +{% addtoblock "js" %} + +{% endaddtoblock %} diff --git a/pydis_site/templates/wiki/includes/editor_sidebar.html b/pydis_site/templates/wiki/includes/editor_sidebar.html new file mode 100644 index 00000000..480dc239 --- /dev/null +++ b/pydis_site/templates/wiki/includes/editor_sidebar.html @@ -0,0 +1,42 @@ +{% load i18n sekizai_tags %} +{% addtoblock "js" %} + +{% endaddtoblock %} + +
    + +{% for plugin, plugin_form in sidebar %} + +
    + + + +
    +
    + {% if plugin.sidebar.template %} + {% with plugin_form as form and plugin as plugin %} + + {% endwith %} + {% endif %} +
    +
    + +
    +{% endfor %} +
    diff --git a/pydis_site/templates/wiki/includes/editormedia.html b/pydis_site/templates/wiki/includes/editormedia.html new file mode 100644 index 00000000..307a3078 --- /dev/null +++ b/pydis_site/templates/wiki/includes/editormedia.html @@ -0,0 +1,15 @@ +{% load sekizai_tags static %} +{% addtoblock "js" %} + +{% for js in editor.Media.js %} + +{% endfor %} +{% endaddtoblock %} + +{% addtoblock "css" %} +{% for media, srcs in editor.Media.css.items %} + {% for src in srcs %} + + {% endfor %} +{% endfor %} +{% endaddtoblock %} diff --git a/pydis_site/templates/wiki/includes/form.html b/pydis_site/templates/wiki/includes/form.html new file mode 100644 index 00000000..3e1abb67 --- /dev/null +++ b/pydis_site/templates/wiki/includes/form.html @@ -0,0 +1,17 @@ +{% csrf_token %}{% load sekizai_tags %} + +{% include "wiki/includes/formerrors.html" %} + +{% addtoblock "js" %} +{{ form.media.js }} +{% endaddtoblock %} + +{% addtoblock "css" %} +{{ form.media.css }} +{% endaddtoblock %} + +{% for field in form %} + + {% include "wiki/includes/formfield.html" %} + +{% endfor %} diff --git a/pydis_site/templates/wiki/includes/formerrors.html b/pydis_site/templates/wiki/includes/formerrors.html new file mode 100644 index 00000000..72d3c539 --- /dev/null +++ b/pydis_site/templates/wiki/includes/formerrors.html @@ -0,0 +1,8 @@ +{% if form.non_field_errors %} + {% if form_error_title %}

    {{ form_error_title }}

    {% endif %} + {% for error_message in form.non_field_errors %} +
    + {{ error_message }} +
    + {% endfor %} +{% endif %} diff --git a/pydis_site/templates/wiki/includes/formfield.html b/pydis_site/templates/wiki/includes/formfield.html new file mode 100644 index 00000000..db6725a9 --- /dev/null +++ b/pydis_site/templates/wiki/includes/formfield.html @@ -0,0 +1,25 @@ +{% if field.is_hidden %} + {{ field }} +{% else %} + +
    +
    + {% if field.label %} + + {% endif %} +
    +
    + {{ field }} {% if field.field.required %}*{% endif %} + {% if field.errors %} + {% for error in field.errors %} +
    {{ error }}
    + {% endfor %} + {% endif %} + {% if field.help_text %} +

    {{ field.help_text|safe }}

    + {% endif %} +
    +
    +{% endif %} diff --git a/pydis_site/templates/wiki/includes/messages.html b/pydis_site/templates/wiki/includes/messages.html new file mode 100644 index 00000000..f8362829 --- /dev/null +++ b/pydis_site/templates/wiki/includes/messages.html @@ -0,0 +1,9 @@ +{% if messages %} + + {% for message in messages %} +
    + × + {{ message }} +
    + {% endfor %} +{% endif %} diff --git a/pydis_site/templates/wiki/includes/modals.html b/pydis_site/templates/wiki/includes/modals.html new file mode 100644 index 00000000..b86d4f65 --- /dev/null +++ b/pydis_site/templates/wiki/includes/modals.html @@ -0,0 +1,31 @@ +{% load sekizai_tags static %} +{% addtoblock "js" %} + + +{% endaddtoblock %} +{% addtoblock "css" %} + +{% endaddtoblock %} diff --git a/pydis_site/templates/wiki/includes/move_tree.html b/pydis_site/templates/wiki/includes/move_tree.html new file mode 100644 index 00000000..af7e422b --- /dev/null +++ b/pydis_site/templates/wiki/includes/move_tree.html @@ -0,0 +1,16 @@ +{% load wiki_tags %} + +
  • + + {{current_path.article}} + + {% if current_path.children.count %} + + {% endif %} +
  • diff --git a/pydis_site/templates/wiki/includes/pagination.html b/pydis_site/templates/wiki/includes/pagination.html new file mode 100644 index 00000000..6e7ec608 --- /dev/null +++ b/pydis_site/templates/wiki/includes/pagination.html @@ -0,0 +1,24 @@ +{% load i18n %} +{% if is_paginated %} + +{% endif %} diff --git a/pydis_site/templates/wiki/includes/render.html b/pydis_site/templates/wiki/includes/render.html new file mode 100644 index 00000000..28ab76c9 --- /dev/null +++ b/pydis_site/templates/wiki/includes/render.html @@ -0,0 +1,26 @@ +{% load wiki_tags i18n cache sekizai_tags static %} + +{% addtoblock "js" %} + +{% endaddtoblock %} + +
    + {{ content|default:"" }} +
    + +{% for plugin in plugins %} + {% if plugin.RenderMedia.css %} + {% addtoblock "css" %} + {% for media, url in plugin.RenderMedia.css.items %} + + {% endfor %} + {% endaddtoblock %} + {% endif %} + {% if plugin.RenderMedia.js %} + {% addtoblock "js" %} + {% for url in plugin.RenderMedia.js %} + + {% endfor %} + {% endaddtoblock %} + {% endif %} +{% endfor %} diff --git a/pydis_site/templates/wiki/includes/revision_info.html b/pydis_site/templates/wiki/includes/revision_info.html new file mode 100644 index 00000000..95b01baf --- /dev/null +++ b/pydis_site/templates/wiki/includes/revision_info.html @@ -0,0 +1,25 @@ +{% comment %} + + This reusable code is shared between different templates and different inheritors of + BaseRevision. + +{% endcomment %} + + +{% load wiki_tags i18n %} +{% if not hidedate %}{{ revision.created }}{% endif %} {% if not hidenumber %}(#{{ revision.revision_number }}) {% trans "by" %}{% endif %} {% if revision.user %}{{ revision.user }}{% else %}{% if article|can_moderate:user %}{{ revision.ip_address|default:"anonymous (IP not logged)" }}{% else %}{% trans "anonymous (IP logged)" %}{% endif %}{% endif %} +{% if revision == current_revision %} + * +{% endif %} +{% if revision.deleted %} +{% trans "deleted" %} +{% endif %} +{% if revision.previous_revision.deleted and not revision.deleted %} +{% trans "restored" %} +{% endif %} +{% if revision.locked %} +{% trans "locked" %} +{% endif %} +{% if revision.previous_revision.locked and not revision.locked %} +{% trans "unlocked" %} +{% endif %} diff --git a/pydis_site/templates/wiki/includes/searchresult.html b/pydis_site/templates/wiki/includes/searchresult.html new file mode 100644 index 00000000..f6dd7a09 --- /dev/null +++ b/pydis_site/templates/wiki/includes/searchresult.html @@ -0,0 +1,22 @@ +{% load wiki_tags i18n humanize %} + + + + + {% for urlpath in article.urlpath_set.all %} + {{ article.current_revision.title }}
    /{{ urlpath.path }}
    + {% empty %} + {{ article.current_revision.title }} + {% endfor %} + {% if article.current_revision.deleted %} + + {% endif %} + {% if article.current_revision.locked %} + + {% endif %} +

    {{ article.render|get_content_snippet:search_query }}

    + + + {{ article.current_revision.created|naturaltime }} + + -- cgit v1.2.3 From d44d5fcb91acbdb8e1d0684f223c9d6324a0c944 Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Thu, 11 Apr 2019 19:32:21 +0100 Subject: Some work towards initial pages and forms There's tons more to do here, ultimately --- pydis_site/templates/wiki/create_root.html | 42 ++++++++++---- pydis_site/templates/wiki/includes/formfield.html | 67 ++++++++++++++++------- pydis_site/templates/wiki/root_missing.html | 11 ++-- 3 files changed, 84 insertions(+), 36 deletions(-) (limited to 'pydis_site/templates/wiki/includes') diff --git a/pydis_site/templates/wiki/create_root.html b/pydis_site/templates/wiki/create_root.html index 52f5ffb6..7b677d47 100644 --- a/pydis_site/templates/wiki/create_root.html +++ b/pydis_site/templates/wiki/create_root.html @@ -1,24 +1,42 @@ {% extends "wiki/base.html" %} -{% load wiki_tags i18n sekizai_tags static %} +{% load wiki_tags crispy_forms_tags i18n sekizai_tags static %} {% block wiki_pagetitle %}{% trans "Create root article" %}{% endblock %} {% block wiki_contents %} -

    {% trans "Congratulations!" %}

    - -

    - {% trans "You have django-wiki installed... but there are no articles. So it's time to create the first one, the root article." %} - {% trans "In the beginning, it will only be editable by administrators, but you can define permissions after." %} -

    +
    +
    +
    +
    +

    Create first article

    +
    +
    +

    + Please create the root article. This article will be available at the root of your wiki, + so consider creating a landing page here. +

    +

    + Please note that, to begin with, this article may only be modified by wiki administrators. + Once it's been created, you may edit the permissions and set up plugins, metadata, and so on. +

    +
    +
    +
    +
    - +

    {% trans "Root article" %}

    {% wiki_form form %} -
    -
    -
    - + +
    +
    + {# Empty for spacing #} +
    +
    +
    + +
    diff --git a/pydis_site/templates/wiki/includes/formfield.html b/pydis_site/templates/wiki/includes/formfield.html index db6725a9..9ca88d4a 100644 --- a/pydis_site/templates/wiki/includes/formfield.html +++ b/pydis_site/templates/wiki/includes/formfield.html @@ -1,25 +1,54 @@ {% if field.is_hidden %} {{ field }} {% else %} +
    +
    + {% if field.label %} + + {% endif %} + {% if field.help_text %} +

    + {{ field.help_text|safe }} +

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

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

    + {% endif %} +
    -
    - {{ field }} {% if field.field.required %}*{% endif %} - {% if field.errors %} - {% for error in field.errors %} -
    {{ error }}
    - {% endfor %} - {% endif %} - {% if field.help_text %} -

    {{ field.help_text|safe }}

    - {% endif %} -
    -
    + +{#
    #} +{#
    #} +{# {% if field.label %}#} +{# #} +{# {% endif %}#} +{#
    #} +{#
    #} +{# {{ field }} {% if field.field.required %}*{% endif %}#} +{# {% if field.errors %}#} +{# {% for error in field.errors %}#} +{#
    {{ error }}
    #} +{# {% endfor %}#} +{# {% endif %}#} +{# {% if field.help_text %}#} +{#

    {{ field.help_text|safe }}

    #} +{# {% endif %}#} +{#
    #} +{#
    #} {% endif %} diff --git a/pydis_site/templates/wiki/root_missing.html b/pydis_site/templates/wiki/root_missing.html index 01efa4cb..c3b89c45 100644 --- a/pydis_site/templates/wiki/root_missing.html +++ b/pydis_site/templates/wiki/root_missing.html @@ -6,28 +6,29 @@
    -

    Congratulations!

    +

    No articles found

    - {% trans "You have django-wiki installed and it seems to be working. But there are no articles yet." %} + It appears that there are no articles available on this wiki.

    {% if not user.is_superuser %}

    - {% trans "Not to worry! You simply have to login with a superuser account and create the first article in the root of the URL hierarchy." %} + To get started, please login with a superuser account.

    {% login_url as wiki_login_url %} {% if wiki_login_url %} {% endif %} {% else %}

    - {% trans "But since you're logged in as a superuser, we should really get started..." %} + Let's get started - click below to create the first article, or to read up on the + django-wiki documentation.

    Create Article -- cgit v1.2.3 From ed8311057579de883fc010f9dd5e1bb331970418 Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Thu, 11 Apr 2019 20:34:18 +0100 Subject: Lots of extra form input handling. But now the root article creator form renders nicely! --- pydis_site/apps/home/templatetags/wiki_extra.py | 66 +++++++++++++++++++++++ pydis_site/templates/wiki/base.html | 7 +++ pydis_site/templates/wiki/create_root.html | 15 ++++++ pydis_site/templates/wiki/forms/fields/char.html | 21 ++++++++ pydis_site/templates/wiki/includes/formfield.html | 27 ++-------- 5 files changed, 114 insertions(+), 22 deletions(-) create mode 100644 pydis_site/apps/home/templatetags/wiki_extra.py create mode 100644 pydis_site/templates/wiki/forms/fields/char.html (limited to 'pydis_site/templates/wiki/includes') diff --git a/pydis_site/apps/home/templatetags/wiki_extra.py b/pydis_site/apps/home/templatetags/wiki_extra.py new file mode 100644 index 00000000..9749a411 --- /dev/null +++ b/pydis_site/apps/home/templatetags/wiki_extra.py @@ -0,0 +1,66 @@ +from django import template +from django.forms import ( + BooleanField, CharField, ChoiceField, ComboField, DateField, DateTimeField, DecimalField, DurationField, EmailField, + Field, FileField, FilePathField, FloatField, GenericIPAddressField, ImageField, IntegerField, ModelChoiceField, + ModelMultipleChoiceField, MultiValueField, MultipleChoiceField, NullBooleanField, RegexField, SlugField, + SplitDateTimeField, TimeField, TypedChoiceField, TypedMultipleChoiceField, URLField, UUIDField, BoundField) +from django.template import Template +from django.template.loader import get_template +from django.utils.safestring import mark_safe +from wiki.editors.markitup import MarkItUpWidget + +TEMPLATE_PATH = "wiki/forms/fields/{0}.html" + +TEMPLATES = { + BooleanField: TEMPLATE_PATH.format("boolean"), + CharField: TEMPLATE_PATH.format("char"), + ChoiceField: TEMPLATE_PATH.format("choice"), + TypedChoiceField: TEMPLATE_PATH.format("typed_choice"), + DateField: TEMPLATE_PATH.format("date"), + DateTimeField: TEMPLATE_PATH.format("date_time"), + DecimalField: TEMPLATE_PATH.format("decimal"), + DurationField: TEMPLATE_PATH.format("duration"), + EmailField: TEMPLATE_PATH.format("email"), + FileField: TEMPLATE_PATH.format("file"), + FilePathField: TEMPLATE_PATH.format("file_path"), + FloatField: TEMPLATE_PATH.format("float"), + ImageField: TEMPLATE_PATH.format("image"), + IntegerField: TEMPLATE_PATH.format("integer"), + GenericIPAddressField: TEMPLATE_PATH.format("generic_ip_address"), + MultipleChoiceField: TEMPLATE_PATH.format("multiple_choice"), + TypedMultipleChoiceField: TEMPLATE_PATH.format("typed_multiple_choice"), + NullBooleanField: TEMPLATE_PATH.format("null_boolean"), + RegexField: TEMPLATE_PATH.format("regex"), + SlugField: TEMPLATE_PATH.format("slug"), + TimeField: TEMPLATE_PATH.format("time"), + URLField: TEMPLATE_PATH.format("url"), + UUIDField: TEMPLATE_PATH.format("uuid"), + + ComboField: TEMPLATE_PATH.format("combo"), + MultiValueField: TEMPLATE_PATH.format("multi_value"), + SplitDateTimeField: TEMPLATE_PATH.format("split_date_time"), + + ModelChoiceField: TEMPLATE_PATH.format("model_choice"), + ModelMultipleChoiceField: TEMPLATE_PATH.format("model_multiple_choice"), +} + + +register = template.Library() + + +@register.simple_tag +def render_field(field: Field): + if isinstance(field, BoundField): + template_path = TEMPLATES.get(field.field.__class__) + is_markitup = isinstance(field.field.widget, MarkItUpWidget) + else: + template_path = TEMPLATES.get(field.__class__) + is_markitup = isinstance(field.widget, MarkItUpWidget) + + if not template_path: + raise NotImplementedError(f"Unknown field type: {field.__class__}") + + template_obj: Template = get_template(template_path) + context = {"field": field, "is_markitup": is_markitup} + + return mark_safe(template_obj.render(context)) diff --git a/pydis_site/templates/wiki/base.html b/pydis_site/templates/wiki/base.html index 95b0186d..44ad8353 100644 --- a/pydis_site/templates/wiki/base.html +++ b/pydis_site/templates/wiki/base.html @@ -5,6 +5,13 @@ Wiki | {% block wiki_pagetitle %}{% endblock %}{% block wiki_site_title %}{% endblock %} {% endblock %} +{% block head %} + {{ block.super }} + + + +{% endblock %} + {% block content %} {% include "base/navbar.html" with active_item=True dropdowns=True icon_weight="far" use_logo=True %} diff --git a/pydis_site/templates/wiki/create_root.html b/pydis_site/templates/wiki/create_root.html index 7b677d47..0d7662ec 100644 --- a/pydis_site/templates/wiki/create_root.html +++ b/pydis_site/templates/wiki/create_root.html @@ -3,6 +3,21 @@ {% block wiki_pagetitle %}{% trans "Create root article" %}{% endblock %} +{% block head %} + {{ block.super }} + + {% for js in editor.Media.js %} + + {% endfor %} + + {% for media, srcs in editor.Media.css.items %} + {% for src in srcs %} + + {% endfor %} + {% endfor %} +{% endblock %} + + {% block wiki_contents %}
    diff --git a/pydis_site/templates/wiki/forms/fields/char.html b/pydis_site/templates/wiki/forms/fields/char.html new file mode 100644 index 00000000..c94f5771 --- /dev/null +++ b/pydis_site/templates/wiki/forms/fields/char.html @@ -0,0 +1,21 @@ +{% if is_markitup %} + +{% else %} + +{% endif %} diff --git a/pydis_site/templates/wiki/includes/formfield.html b/pydis_site/templates/wiki/includes/formfield.html index 9ca88d4a..0176f9d4 100644 --- a/pydis_site/templates/wiki/includes/formfield.html +++ b/pydis_site/templates/wiki/includes/formfield.html @@ -1,3 +1,5 @@ +{% load wiki_extra %} + {% if field.is_hidden %} {{ field }} {% else %} @@ -8,16 +10,18 @@ {{ field.label | safe }} {% if field.field.required %}*{% endif %} {% endif %} + {% if field.help_text %}

    {{ field.help_text|safe }}

    {% endif %}
    +
    - {{ field }} + {% render_field field %}
    @@ -30,25 +34,4 @@ {% endif %}
    - -{#
    #} -{#
    #} -{# {% if field.label %}#} -{# #} -{# {% endif %}#} -{#
    #} -{#
    #} -{# {{ field }} {% if field.field.required %}*{% endif %}#} -{# {% if field.errors %}#} -{# {% for error in field.errors %}#} -{#
    {{ error }}
    #} -{# {% endfor %}#} -{# {% endif %}#} -{# {% if field.help_text %}#} -{#

    {{ field.help_text|safe }}

    #} -{# {% endif %}#} -{#
    #} -{#
    #} {% endif %} -- cgit v1.2.3 From a27d88923c6451d450d9155adb0ccd9fd0dcaa5f Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Fri, 12 Apr 2019 11:46:39 +0100 Subject: Finish initial article creation form --- pydis_site/templates/wiki/create_root.html | 31 ++++++++--------------- pydis_site/templates/wiki/includes/formfield.html | 4 +-- 2 files changed, 12 insertions(+), 23 deletions(-) (limited to 'pydis_site/templates/wiki/includes') diff --git a/pydis_site/templates/wiki/create_root.html b/pydis_site/templates/wiki/create_root.html index 0d7662ec..08ee7f82 100644 --- a/pydis_site/templates/wiki/create_root.html +++ b/pydis_site/templates/wiki/create_root.html @@ -19,27 +19,16 @@ {% block wiki_contents %} -
    -
    -
    -
    -

    Create first article

    -
    -
    -

    - Please create the root article. This article will be available at the root of your wiki, - so consider creating a landing page here. -

    -

    - Please note that, to begin with, this article may only be modified by wiki administrators. - Once it's been created, you may edit the permissions and set up plugins, metadata, and so on. -

    -
    -
    -
    -
    +

    Create First Article

    -

    {% trans "Root article" %}

    +

    + Please create the root article. This article will be available at the root of your wiki, + so consider creating a landing page here. +

    +

    + Please note that, to begin with, this article may only be modified by wiki administrators. + Once it's been created, you may edit the permissions and set up plugins, metadata, and so on. +

    {% wiki_form form %} @@ -50,7 +39,7 @@
    - +
    diff --git a/pydis_site/templates/wiki/includes/formfield.html b/pydis_site/templates/wiki/includes/formfield.html index 0176f9d4..9f68fb26 100644 --- a/pydis_site/templates/wiki/includes/formfield.html +++ b/pydis_site/templates/wiki/includes/formfield.html @@ -7,7 +7,7 @@
    {% if field.label %} {% endif %} @@ -23,7 +23,6 @@
    {% render_field field %}
    -
    {% if field.errors %}

    @@ -32,6 +31,7 @@ {% endfor %}

    {% endif %} +
    {% endif %} -- cgit v1.2.3 From dbe815fd1c148135426edbe15f9dcdf016d689d9 Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Fri, 12 Apr 2019 14:06:40 +0100 Subject: More forms work - Boolean is done! --- pydis_site/apps/home/templatetags/wiki_extra.py | 29 ++++++--- .../templates/wiki/forms/fields/boolean.html | 42 +++++++++++++ pydis_site/templates/wiki/forms/fields/char.html | 71 ++++++++++++++++------ .../wiki/forms/fields/in_place_render.html | 31 ++++++++++ .../templates/wiki/forms/fields/model_choice.html | 31 ++++++++++ pydis_site/templates/wiki/includes/formfield.html | 32 +--------- 6 files changed, 177 insertions(+), 59 deletions(-) create mode 100644 pydis_site/templates/wiki/forms/fields/boolean.html create mode 100644 pydis_site/templates/wiki/forms/fields/in_place_render.html create mode 100644 pydis_site/templates/wiki/forms/fields/model_choice.html (limited to 'pydis_site/templates/wiki/includes') diff --git a/pydis_site/apps/home/templatetags/wiki_extra.py b/pydis_site/apps/home/templatetags/wiki_extra.py index 9749a411..03ca8210 100644 --- a/pydis_site/apps/home/templatetags/wiki_extra.py +++ b/pydis_site/apps/home/templatetags/wiki_extra.py @@ -1,13 +1,14 @@ from django import template from django.forms import ( - BooleanField, CharField, ChoiceField, ComboField, DateField, DateTimeField, DecimalField, DurationField, EmailField, - Field, FileField, FilePathField, FloatField, GenericIPAddressField, ImageField, IntegerField, ModelChoiceField, - ModelMultipleChoiceField, MultiValueField, MultipleChoiceField, NullBooleanField, RegexField, SlugField, - SplitDateTimeField, TimeField, TypedChoiceField, TypedMultipleChoiceField, URLField, UUIDField, BoundField) + BooleanField, BoundField, CharField, ChoiceField, ComboField, DateField, DateTimeField, DecimalField, DurationField, + EmailField, Field, FileField, FilePathField, FloatField, GenericIPAddressField, ImageField, IntegerField, + ModelChoiceField, ModelMultipleChoiceField, MultiValueField, MultipleChoiceField, NullBooleanField, RegexField, + SlugField, SplitDateTimeField, TimeField, TypedChoiceField, TypedMultipleChoiceField, URLField, UUIDField) from django.template import Template from django.template.loader import get_template from django.utils.safestring import mark_safe from wiki.editors.markitup import MarkItUpWidget +from wiki.plugins.notifications.forms import SettingsModelChoiceField TEMPLATE_PATH = "wiki/forms/fields/{0}.html" @@ -42,23 +43,33 @@ TEMPLATES = { ModelChoiceField: TEMPLATE_PATH.format("model_choice"), ModelMultipleChoiceField: TEMPLATE_PATH.format("model_multiple_choice"), + + SettingsModelChoiceField: TEMPLATE_PATH.format("in_place_render"), } register = template.Library() +def get_unbound_field(field: BoundField): + while isinstance(field, BoundField): + field = field.field + + return field + + @register.simple_tag def render_field(field: Field): if isinstance(field, BoundField): - template_path = TEMPLATES.get(field.field.__class__) - is_markitup = isinstance(field.field.widget, MarkItUpWidget) + unbound_field = get_unbound_field(field) else: - template_path = TEMPLATES.get(field.__class__) - is_markitup = isinstance(field.widget, MarkItUpWidget) + unbound_field = field + + template_path = TEMPLATES.get(unbound_field.__class__) + is_markitup = isinstance(unbound_field.widget, MarkItUpWidget) if not template_path: - raise NotImplementedError(f"Unknown field type: {field.__class__}") + raise NotImplementedError(f"Unknown field type: {unbound_field.__class__}") template_obj: Template = get_template(template_path) context = {"field": field, "is_markitup": is_markitup} diff --git a/pydis_site/templates/wiki/forms/fields/boolean.html b/pydis_site/templates/wiki/forms/fields/boolean.html new file mode 100644 index 00000000..9d054083 --- /dev/null +++ b/pydis_site/templates/wiki/forms/fields/boolean.html @@ -0,0 +1,42 @@ +
    +
    + + + {% if field.help_text %} +

    + {{ field.help_text|safe }} +

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

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

    + {% endif %} +
    +
    +
    diff --git a/pydis_site/templates/wiki/forms/fields/char.html b/pydis_site/templates/wiki/forms/fields/char.html index ccae0630..9539f6eb 100644 --- a/pydis_site/templates/wiki/forms/fields/char.html +++ b/pydis_site/templates/wiki/forms/fields/char.html @@ -1,21 +1,54 @@ -{% if is_markitup %} - -{% else %} - + {{ field.help_text|safe }} +

    + {% endif %} + - {% if field.required %}required{% endif %} - {% if field.max_length %}maxlength="{{ field.max_length }}"{% endif %} - {% if field.min_length %}minlength="{{ field.min_length }}"{% endif %} - {% if field.empty_value %}placeholder="{{ field.empty_value }}"{% endif %} - /> -{% endif %} +
    +
    +
    + {% if is_markitup %} + + {% else %} + + {% endif %} +
    + + {% if field.errors %} +

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

    + {% endif %} +
    +
    + diff --git a/pydis_site/templates/wiki/forms/fields/in_place_render.html b/pydis_site/templates/wiki/forms/fields/in_place_render.html new file mode 100644 index 00000000..47e115fe --- /dev/null +++ b/pydis_site/templates/wiki/forms/fields/in_place_render.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/forms/fields/model_choice.html b/pydis_site/templates/wiki/forms/fields/model_choice.html new file mode 100644 index 00000000..f1104b98 --- /dev/null +++ b/pydis_site/templates/wiki/forms/fields/model_choice.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/formfield.html b/pydis_site/templates/wiki/includes/formfield.html index 9f68fb26..c466719b 100644 --- a/pydis_site/templates/wiki/includes/formfield.html +++ b/pydis_site/templates/wiki/includes/formfield.html @@ -3,35 +3,5 @@ {% if field.is_hidden %} {{ field }} {% else %} -
    -
    - {% if field.label %} - - {% endif %} - - {% if field.help_text %} -

    - {{ field.help_text|safe }} -

    - {% endif %} -
    - -
    -
    -
    - {% render_field field %} -
    - - {% if field.errors %} -

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

    - {% endif %} -
    -
    -
    + {% render_field field %} {% endif %} -- cgit v1.2.3 From 34b72419c312d21b77185b72a47cb49508ed47e9 Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Sat, 13 Apr 2019 16:39:47 +0100 Subject: Some more work towards the editor pages --- pydis_site/static/js/wiki/load_editor.js | 51 ++++-- pydis_site/templates/wiki/create_root.html | 7 +- pydis_site/templates/wiki/edit.html | 194 ++++++++++++--------- pydis_site/templates/wiki/includes/editor.html | 7 - .../templates/wiki/includes/editor_sidebar.html | 12 -- pydis_site/templates/wiki/settings.html | 7 +- 6 files changed, 161 insertions(+), 117 deletions(-) (limited to 'pydis_site/templates/wiki/includes') diff --git a/pydis_site/static/js/wiki/load_editor.js b/pydis_site/static/js/wiki/load_editor.js index a9f78e65..1837c7fd 100644 --- a/pydis_site/static/js/wiki/load_editor.js +++ b/pydis_site/static/js/wiki/load_editor.js @@ -1,8 +1,44 @@ (function() { window.editors = {}; // So that other scripts can get at 'em + const TOCText = "[TOC]"; + + const headingAction = { + name: "heading", + action: SimpleMDE.toggleHeadingSmaller, + className: "fa fa-heading", + title: "Heading", + }; + + const imageAction = { + name: "image", + action: SimpleMDE.drawImage, + className: "fa fa-image", + title: "Insert image", + }; + + const TOCAction = { + name: "toc", + action: inserTOC, + className: "fa fa-stream", + title: "Insert Table of Contents" + }; + let elements = document.getElementsByClassName("simple-mde"); + function inserTOC(editor) { + let doc = editor.codemirror.getDoc(), + cursor = doc.getCursor(), + line = doc.getLine(cursor.line), + position = {"line": cursor.line}; + + if (line.length === 0) { + doc.replaceRange(TOCText, position); + } else { + doc.replaceRange("\n" + TOCText, position) + } + } + for (let element of elements) { window.editors[element.id] = new SimpleMDE({ "element": element, @@ -28,19 +64,10 @@ tabSize: 4, toolbar: [ - "bold", "italic", "strikethrough", { - name: "heading", - action: SimpleMDE.toggleHeadingSmaller, - className: "fa fa-heading", - title: "Heading", - }, "|", + "bold", "italic", "strikethrough", headingAction, "|", "code", "quote", "unordered-list", "ordered-list", "|", - "link", { - name: "image", - action: SimpleMDE.drawImage, - className: "fa fa-image", - title: "Insert image", - }, "table", "horizontal-rule", "|", + "link", imageAction, "table", "horizontal-rule", "|", + TOCAction, "|", "preview", "side-by-side", "fullscreen", "|", "guide" ], diff --git a/pydis_site/templates/wiki/create_root.html b/pydis_site/templates/wiki/create_root.html index 08ee7f82..376321c6 100644 --- a/pydis_site/templates/wiki/create_root.html +++ b/pydis_site/templates/wiki/create_root.html @@ -39,7 +39,12 @@
    - +
    diff --git a/pydis_site/templates/wiki/edit.html b/pydis_site/templates/wiki/edit.html index fc5955e9..8d5b61db 100644 --- a/pydis_site/templates/wiki/edit.html +++ b/pydis_site/templates/wiki/edit.html @@ -6,13 +6,83 @@ Edit: {{ article.current_revision.title }} {% endblock %} +{% block head %} + {{ block.super }} + + + + + + +{% endblock %} + {% block wiki_contents_tab %} {% if not user.is_authenticated %} -

    - {% trans "Warning: You are not logged in. Your IP address will be logged." %} - {% trans "Click here to log in" %} » -

    +

    + {% trans "Warning: You are not logged in. Your IP address will be logged." %} + {% trans "Click here to log in" %} » +

    {% endif %}
    @@ -23,39 +93,44 @@ {% include "wiki/includes/editor.html" %} {% endwith %} -
    -
    -
    - - - -
    - {% if user.is_authenticated and urlpath.path %} - - - {% trans "Move article" %} - - {% endif %} - {% if article|can_delete:user %} - - - {% trans "Delete article" %} - - {% endif %} -
    -
    -
    + + + +
    + {% if user.is_authenticated and urlpath.path %} + + + + + Move Article + + {% endif %} + {% if article|can_delete:user %} + + + + + Delete Article + + {% endif %}
    +
    +
    +
    @@ -88,53 +163,4 @@
    - - {% addtoblock "js" %} - - {% endaddtoblock %} {% endblock %} diff --git a/pydis_site/templates/wiki/includes/editor.html b/pydis_site/templates/wiki/includes/editor.html index 6686d8dd..bc1da1a0 100644 --- a/pydis_site/templates/wiki/includes/editor.html +++ b/pydis_site/templates/wiki/includes/editor.html @@ -2,10 +2,3 @@ {% include "wiki/includes/editormedia.html" %} {% wiki_form form %} -{% addtoblock "js" %} - -{% endaddtoblock %} diff --git a/pydis_site/templates/wiki/includes/editor_sidebar.html b/pydis_site/templates/wiki/includes/editor_sidebar.html index 480dc239..87efed4d 100644 --- a/pydis_site/templates/wiki/includes/editor_sidebar.html +++ b/pydis_site/templates/wiki/includes/editor_sidebar.html @@ -1,16 +1,4 @@ {% load i18n sekizai_tags %} -{% addtoblock "js" %} - -{% endaddtoblock %}
    diff --git a/pydis_site/templates/wiki/settings.html b/pydis_site/templates/wiki/settings.html index 3e8c8dab..c26e4ccd 100644 --- a/pydis_site/templates/wiki/settings.html +++ b/pydis_site/templates/wiki/settings.html @@ -17,7 +17,12 @@
    - +
    -- cgit v1.2.3 From ed0313e57a5729097c04763dbc5d12c6434433eb Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Sat, 13 Apr 2019 19:25:41 +0100 Subject: Some work towards fixed navigation --- pydis_site/templates/wiki/article.html | 40 +++---- pydis_site/templates/wiki/base.html | 7 +- .../templates/wiki/includes/article_menu.html | 123 +++++++++++++-------- 3 files changed, 100 insertions(+), 70 deletions(-) (limited to 'pydis_site/templates/wiki/includes') diff --git a/pydis_site/templates/wiki/article.html b/pydis_site/templates/wiki/article.html index 65877068..03c007e6 100644 --- a/pydis_site/templates/wiki/article.html +++ b/pydis_site/templates/wiki/article.html @@ -4,37 +4,37 @@ {% block wiki_pagetitle %}{{ article.current_revision.title }}{% endblock %} +{% block wiki_navbar %} + {% include "wiki/includes/article_menu.html" %} +{% endblock %} + {% block wiki_breadcrumbs %} -{% include "wiki/includes/breadcrumbs.html" %} + {% include "wiki/includes/breadcrumbs.html" %} {% endblock %} {% block wiki_contents %} -
    -
      -
    • -

      - {{ article.current_revision.title }} - - {% if urlpath.parent %} - {{ urlpath.slug }} - {% endif %} - {% if article.current_revision.locked %} - {% trans "locked" %} - {% endif %} - -

      -
    • - {% include "wiki/includes/article_menu.html" %} -
    +

    + {{ article.current_revision.title }} + + {% if urlpath.parent %} + {{ urlpath.slug }} + {% endif %} + + {% if article.current_revision.locked %} + + + locked + {% endif %} + +

    {% block wiki_contents_tab %} {% endblock %}
    - {% endblock %} {% block wiki_footer_prepend %} -

    {% trans "This article was last modified:" %} {{ article.current_revision.modified }}

    +

    This article was last modified: {{ article.current_revision.modified }}

    {% endblock %} diff --git a/pydis_site/templates/wiki/base.html b/pydis_site/templates/wiki/base.html index cbfecf82..1affbe39 100644 --- a/pydis_site/templates/wiki/base.html +++ b/pydis_site/templates/wiki/base.html @@ -19,10 +19,11 @@ {% block content %} {% include "base/navbar.html" with active_item=True dropdowns=True icon_weight="far" use_logo=True %} - {% block wiki_body %} - {% block wiki_navbar %} + {% block wiki_navbar %} + + {% endblock %} - {% endblock %} + {% block wiki_body %}
    diff --git a/pydis_site/templates/wiki/includes/article_menu.html b/pydis_site/templates/wiki/includes/article_menu.html index 9a83327b..7cf23a71 100644 --- a/pydis_site/templates/wiki/includes/article_menu.html +++ b/pydis_site/templates/wiki/includes/article_menu.html @@ -1,53 +1,82 @@ {% load i18n wiki_tags %} {% with selected_tab as selected %} + {% endwith %} -- cgit v1.2.3 From cc5f3b7321c6992e0c7e324c735bb5272d8e5ae3 Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Sun, 14 Apr 2019 17:00:43 +0100 Subject: Modals and breadcrumb work --- pydis_site/static/js/wiki/modal.js | 13 ++ pydis_site/templates/wiki/base.html | 11 +- pydis_site/templates/wiki/edit.html | 170 ++++++++++----------- .../templates/wiki/includes/article_menu.html | 116 +++++++------- .../templates/wiki/includes/breadcrumbs.html | 100 ++++++------ .../templates/wiki/includes/editor_sidebar.html | 2 +- pydis_site/templates/wiki/includes/formerrors.html | 17 ++- pydis_site/templates/wiki/preview_inline.html | 25 ++- 8 files changed, 245 insertions(+), 209 deletions(-) create mode 100644 pydis_site/static/js/wiki/modal.js (limited to 'pydis_site/templates/wiki/includes') diff --git a/pydis_site/static/js/wiki/modal.js b/pydis_site/static/js/wiki/modal.js new file mode 100644 index 00000000..01252575 --- /dev/null +++ b/pydis_site/static/js/wiki/modal.js @@ -0,0 +1,13 @@ +function open_modal(id) { + let element = document.getElementById(id); + + $(element).addClass("is-active"); + + $(element).find(".modal-background").click(function() { + $(element).removeClass("is-active"); + }); + + $(element).find("[aria-label=\"close\"]").click(function() { + $(element).removeClass("is-active"); + }); +} diff --git a/pydis_site/templates/wiki/base.html b/pydis_site/templates/wiki/base.html index 1affbe39..4982fe78 100644 --- a/pydis_site/templates/wiki/base.html +++ b/pydis_site/templates/wiki/base.html @@ -17,20 +17,19 @@ {% endblock %} {% block content %} - {% include "base/navbar.html" with active_item=True dropdowns=True icon_weight="far" use_logo=True %} + {% block site_navbar %} + {% include "base/navbar.html" with active_item=True dropdowns=True icon_weight="far" use_logo=True %} + {% endblock %} {% block wiki_navbar %} {% endblock %} {% block wiki_body %} -
    {% wiki_messages %} - {% block wiki_breadcrumbs %}{% endblock %} -
    {% block wiki_contents %}{% endblock %}
    @@ -38,7 +37,9 @@
    {% endblock %} - {% include "base/footer.html" %} + {% block site_footer %} + {% include "base/footer.html" %} + {% endblock %} {% endblock %} diff --git a/pydis_site/templates/wiki/edit.html b/pydis_site/templates/wiki/edit.html index 8d5b61db..1e1caaf7 100644 --- a/pydis_site/templates/wiki/edit.html +++ b/pydis_site/templates/wiki/edit.html @@ -1,81 +1,11 @@ {% extends "wiki/article.html" %} -{% load wiki_tags i18n sekizai_tags %} +{% load wiki_tags i18n sekizai_tags static %} {% block wiki_pagetitle %} Edit: {{ article.current_revision.title }} {% endblock %} -{% block head %} - {{ block.super }} - - - - - - -{% endblock %} - {% block wiki_contents_tab %} {% if not user.is_authenticated %} @@ -144,23 +74,89 @@ {% include "wiki/includes/modals.html" %} -
    {% endif %} -- cgit v1.2.3 From ab1b31e9091a173bf22712df9133328d0408ecee Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Mon, 15 Apr 2019 11:45:46 +0100 Subject: Remove TOC, link headers, fix breadcrumb padding Also removes some templates we don't care about --- pydis_site/settings.py | 4 +- pydis_site/static/css/wiki/style.css | 3 + pydis_site/static/js/wiki/load_editor.js | 21 ---- .../templates/wiki/accounts/account_settings.html | 14 --- pydis_site/templates/wiki/accounts/login.html | 38 ------- pydis_site/templates/wiki/accounts/signup.html | 27 ----- pydis_site/templates/wiki/base.html | 3 +- .../templates/wiki/includes/article_menu.html | 125 +++++++++++---------- .../templates/wiki/includes/breadcrumbs.html | 4 +- 9 files changed, 73 insertions(+), 166 deletions(-) create mode 100644 pydis_site/static/css/wiki/style.css delete mode 100644 pydis_site/templates/wiki/accounts/account_settings.html delete mode 100644 pydis_site/templates/wiki/accounts/login.html delete mode 100644 pydis_site/templates/wiki/accounts/signup.html (limited to 'pydis_site/templates/wiki/includes') diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 70ec0a84..c4a1bf7e 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -287,11 +287,13 @@ WIKI_ACCOUNT_HANDLING = False WIKI_ACCOUNT_SIGNUP_ALLOWED = False WIKI_ANONYMOUS = True +WIKI_ANONYMOUS_WRITE = False WIKI_MARKDOWN_KWARGS = { "extension_configs": { "wiki.plugins.macros.mdx.toc": { - "title": "Contents" + "anchorlink": True, + "baselevel": 2 } }, "extensions": [ "markdown.extensions.abbr", diff --git a/pydis_site/static/css/wiki/style.css b/pydis_site/static/css/wiki/style.css new file mode 100644 index 00000000..b4f233f7 --- /dev/null +++ b/pydis_site/static/css/wiki/style.css @@ -0,0 +1,3 @@ +.breadcrumb-section { + padding: 1rem; +} diff --git a/pydis_site/static/js/wiki/load_editor.js b/pydis_site/static/js/wiki/load_editor.js index 69730b14..dfa087d9 100644 --- a/pydis_site/static/js/wiki/load_editor.js +++ b/pydis_site/static/js/wiki/load_editor.js @@ -17,28 +17,8 @@ title: "Insert image", }; - const TOCAction = { - name: "toc", - action: insertTOC, - className: "fa fa-stream", - title: "Insert Table of Contents" - }; - let elements = document.getElementsByClassName("simple-mde"); - function insertTOC(editor) { - let doc = editor.codemirror.getDoc(), - cursor = doc.getCursor(), - line = doc.getLine(cursor.line), - position = {"line": cursor.line, "ch": 0}; - - if (line.length === 0) { - doc.replaceRange(TOCText, position); - } else { - doc.replaceRange(TOCText + "\n", position) - } - } - for (let element of elements) { window.editors[element.id] = new SimpleMDE({ "element": element, @@ -67,7 +47,6 @@ "bold", "italic", "strikethrough", headingAction, "|", "code", "quote", "unordered-list", "ordered-list", "|", "link", imageAction, "table", "horizontal-rule", "|", - TOCAction, "|", "preview", "side-by-side", "fullscreen", "|", "guide" ], diff --git a/pydis_site/templates/wiki/accounts/account_settings.html b/pydis_site/templates/wiki/accounts/account_settings.html deleted file mode 100644 index ecff4376..00000000 --- a/pydis_site/templates/wiki/accounts/account_settings.html +++ /dev/null @@ -1,14 +0,0 @@ -{% extends "wiki/base.html" %} -{% load i18n wiki_tags sekizai_tags %} - -{% block wiki_pagetitle %}{% trans "Account Settings" %}{% endblock %} - -{% block wiki_contents %} -

    {% trans "Account Settings" %}

    -{% csrf_token %} - {% wiki_form form %} - - -{% endblock %} diff --git a/pydis_site/templates/wiki/accounts/login.html b/pydis_site/templates/wiki/accounts/login.html deleted file mode 100644 index 082d47bd..00000000 --- a/pydis_site/templates/wiki/accounts/login.html +++ /dev/null @@ -1,38 +0,0 @@ -{% extends "wiki/base.html" %} -{% load i18n wiki_tags sekizai_tags %} - -{% block wiki_pagetitle %}{% trans "Log in" %}{% endblock %} - -{% block wiki_contents %} -
    -
    -
    -

    {% trans "Please log in" %}

    -
    - {% wiki_form form %} -
    -
    -
    - -
    -
    -
    - -

    - {% trans "Don't have an account?" %} {% trans "Sign up" %} » -

    - -
    -
    -
    - -{% addtoblock "js" %} - -{% endaddtoblock %} - -{% endblock %} diff --git a/pydis_site/templates/wiki/accounts/signup.html b/pydis_site/templates/wiki/accounts/signup.html deleted file mode 100644 index 6db65d3d..00000000 --- a/pydis_site/templates/wiki/accounts/signup.html +++ /dev/null @@ -1,27 +0,0 @@ -{% extends "wiki/base.html" %} -{% load i18n wiki_tags sekizai_tags %} -{% block wiki_pagetitle %}{% trans "Sign up" %}{% endblock %} - -{% block wiki_contents %} -

    {% trans "Sign up" %}

    -
    -{% wiki_form form %} -
    -
    -
    - -
    -
    -
    -{% addtoblock "js" %} - -{% endaddtoblock %} -{% endblock %} diff --git a/pydis_site/templates/wiki/base.html b/pydis_site/templates/wiki/base.html index e1742657..112523cd 100644 --- a/pydis_site/templates/wiki/base.html +++ b/pydis_site/templates/wiki/base.html @@ -10,10 +10,11 @@ + - + {% endblock %} {% block content %} diff --git a/pydis_site/templates/wiki/includes/article_menu.html b/pydis_site/templates/wiki/includes/article_menu.html index 56762420..c6cb6bf0 100644 --- a/pydis_site/templates/wiki/includes/article_menu.html +++ b/pydis_site/templates/wiki/includes/article_menu.html @@ -1,83 +1,84 @@ {% load i18n wiki_tags %} -{% with selected_tab as selected %} - - -{% endwith %} + + {% endwith %} +{% endif %} diff --git a/pydis_site/templates/wiki/includes/breadcrumbs.html b/pydis_site/templates/wiki/includes/breadcrumbs.html index 708edb19..a2359f39 100644 --- a/pydis_site/templates/wiki/includes/breadcrumbs.html +++ b/pydis_site/templates/wiki/includes/breadcrumbs.html @@ -1,5 +1,5 @@ -{% if urlpath and article %} -
    +{% if urlpath and article and not user.is_anonymous %} +