diff options
author | 2019-04-11 20:34:18 +0100 | |
---|---|---|
committer | 2019-04-11 20:34:18 +0100 | |
commit | ed8311057579de883fc010f9dd5e1bb331970418 (patch) | |
tree | e5b6d1ad7b2f9aa1758c8946b8b08356a2075453 /pydis_site/templates/wiki | |
parent | Some work towards initial pages and forms (diff) |
Lots of extra form input handling.
But now the root article creator form renders nicely!
Diffstat (limited to 'pydis_site/templates/wiki')
-rw-r--r-- | pydis_site/templates/wiki/base.html | 7 | ||||
-rw-r--r-- | pydis_site/templates/wiki/create_root.html | 15 | ||||
-rw-r--r-- | pydis_site/templates/wiki/forms/fields/char.html | 21 | ||||
-rw-r--r-- | pydis_site/templates/wiki/includes/formfield.html | 27 |
4 files changed, 48 insertions, 22 deletions
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 }} + + <script src="{% static "wiki/js/jquery-3.3.1.min.js" %}" type="text/javascript"></script> + <script src="{% static "wiki/js/core.js" %}" type="text/javascript"></script> +{% 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 %} + <script type="text/javascript" src="{% static js %}"></script> + {% endfor %} + + {% for media, srcs in editor.Media.css.items %} + {% for src in srcs %} + <link rel="stylesheet" media="{{ media }}" href="{% static src %}" /> + {% endfor %} + {% endfor %} +{% endblock %} + + {% block wiki_contents %} <div class="columns"> <div class="column is-two-thirds is-offset-2"> 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 %} + <textarea class="textarea is-family-monospace{% if field.errors %} is-danger{% endif %}" + id="{{ field.auto_id }}" + rows = 10 + + {% if field.required %}required{% endif %} + {% if field.max_length %}maxlength="{{ field.maxlength }}"{% endif %} + {% if field.min_length %}minlength="{{ field.minelength }}"{% endif %} + {% if field.empty_value %}placeholder="{{ field.empty_value }}"{% endif %} + ></textarea> +{% else %} + <input class="input{% if field.errors %} is-danger{% endif %}" + type="text" + id="{{ field.auto_id }}" + + {% if field.required %}required{% endif %} + {% if field.max_length %}maxlength="{{ field.maxlength }}"{% endif %} + {% if field.min_length %}minlength="{{ field.minelength }}"{% endif %} + {% if field.empty_value %}placeholder="{{ field.empty_value }}"{% endif %} + /> +{% 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 %}<span class="asterisk">*</span>{% endif %} </label> {% endif %} + {% if field.help_text %} <p id="hint_{{ field.auto_id }}" class="help"> {{ field.help_text|safe }} </p> {% endif %} </div> + <div class="field-body"> <div class="field"> <div class="control"> - {{ field }} + {% render_field field %} </div> </div> @@ -30,25 +34,4 @@ {% endif %} </div> </div> - -{#<div id="div_{{ field.auto_id }}" class="form-group{% if field.errors %} has-error{% endif %}">#} -{# <div class="wiki-label col-xs-3 col-lg-2">#} -{# {% if field.label %}#} -{# <label for="{{ field.id_for_label }}" class="control-label {% if field.field.required %}requiredField{% endif %}">#} -{# {{ field.label|safe }}#} -{# </label>#} -{# {% endif %}#} -{# </div>#} -{# <div class="wiki-control col-xs-9 col-lg-10">#} -{# {{ field }} {% if field.field.required %}<span class="asteriskField">*</span>{% endif %}#} -{# {% if field.errors %}#} -{# {% for error in field.errors %}#} -{# <div id="error_{{ forloop.counter }}_{{ field.auto_id }}" class="help-block"><strong>{{ error }}</strong></div>#} -{# {% endfor %}#} -{# {% endif %}#} -{# {% if field.help_text %}#} -{# <p id="hint_{{ field.auto_id }}" class="help-block">{{ field.help_text|safe }}</p>#} -{# {% endif %}#} -{# </div>#} -{#</div>#} {% endif %} |