diff options
Diffstat (limited to 'pydis_site/templates/wiki')
| -rw-r--r-- | pydis_site/templates/wiki/forms/fields/model_choice.html | 42 | ||||
| -rw-r--r-- | pydis_site/templates/wiki/settings.html | 17 | 
2 files changed, 50 insertions, 9 deletions
| diff --git a/pydis_site/templates/wiki/forms/fields/model_choice.html b/pydis_site/templates/wiki/forms/fields/model_choice.html index f1104b98..c6cd53ab 100644 --- a/pydis_site/templates/wiki/forms/fields/model_choice.html +++ b/pydis_site/templates/wiki/forms/fields/model_choice.html @@ -1,8 +1,10 @@ +{% load wiki_extra %} +  <div id="div_{{ field.auto_id }}" class="field is-horizontal{% if field.errors %} is-danger{% endif %}">    <div class="field-label">      {% if field.label %}        <label for="{{ field.auto_id }}" class="label {% if field.errors %} is-danger{% endif %}"> -        MODEL CHOICE: {{ field.label | safe }} {% if field.field.required %}<span class="asterisk has-text-danger">*</span>{% endif %} +        {{ field.label | safe }} {% if field.field.required %}<span class="asterisk has-text-danger">*</span>{% endif %}        </label>      {% endif %} @@ -16,7 +18,43 @@    <div class="field-body">      <div class="field">        <div class="control"> -        {{ field }} +        <div class="select"> +          {% get_field_options field %} + +          <select {% if not options %}disabled{% endif %} +                  id="{{ field.auto_id }}" +                  name="{{ field.name }}" + +                  {% if field.required %}required{% endif %} +          > +            {% if options %} +              {% for group_name, group_choices, group_index in options %} +                {% if group_name %} +                  <optgroup label="{{ group_name }}"> +                {% endif %} +                {% for option in group_choices %} +                  <option {% if option.value == field.value %}selected{% endif %} +                          value="{{ option.value|stringformat:'s' }}" +                  > +                    {{ option.label }} +                  </option> +                {% endfor %} +                {% if group_name %} +                  </optgroup> +                {% endif %} +              {% endfor %} +            {% else %} +              <option value=""> +                {% if field.field.empty_label %} +                  {{ field.field.empty_label }} +                {% else %} +                  N/A +                {% endif %} +                </option> +            {% endif %} +          </select> +        </div> +        </div>      {% if field.errors %} diff --git a/pydis_site/templates/wiki/settings.html b/pydis_site/templates/wiki/settings.html index 6d6c0f49..3e8c8dab 100644 --- a/pydis_site/templates/wiki/settings.html +++ b/pydis_site/templates/wiki/settings.html @@ -7,15 +7,18 @@  {% block wiki_contents_tab %}    {% for form in forms %} -  <form method="POST" class="form-horizontal settings-form" action="?f={{form.action}}"> +  <form method="POST" class="form-horizontal" action="?f={{form.action}}">      <h3 class="page-header">{{ form.settings_form_headline }}</h3>      {% wiki_form form %} -    <div class="form-group form-actions"> -      <div class="col-lg-10 col-lg-2-offset"> -        <button type="submit" name="save" value="1" class="btn btn-primary"> -          <span class="fa fa-check"></span> -          {% trans "Save changes" %} -        </button> + +    <div class="field is-horizontal"> +      <div class="field-label"> +        {# Empty for spacing #} +      </div> +      <div class="field-body"> +        <div class="control"> +          <input type="submit" class="button is-primary is-medium" name="save" value="Save Changes" /> +        </div>        </div>      </div>    </form> | 
