diff options
| -rw-r--r-- | pydis_site/templates/wiki/create_root.html | 42 | ||||
| -rw-r--r-- | pydis_site/templates/wiki/includes/formfield.html | 67 | ||||
| -rw-r--r-- | pydis_site/templates/wiki/root_missing.html | 11 | 
3 files changed, 84 insertions, 36 deletions
| 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 %} -  <h1 class="title">{% trans "Congratulations!" %}</h1> - -  <p> -    {% 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." %} -  </p> +  <div class="columns"> +    <div class="column is-two-thirds is-offset-2"> +      <article class="message is-primary"> +        <div class="message-header"> +          <p>Create first article</p> +        </div> +        <div class="message-body"> +          <p> +            Please create the root article. This article will be available at the root of your wiki, +            so consider creating a landing page here. +          </p> +          <p> +            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. +          </p> +        </div> +      </article> +    </div> +  </div> -  <h2 class="page-header">{% trans "Root article" %}</h2> +  <h2 class="title is-2">{% trans "Root article" %}</h2>    <form method="POST" class="form-horizontal">      {% wiki_form form %} -    <div class="form-group form-actions"> -      <div class="col-lg-2"></div> -      <div class="col-lg-10"> -        <input type="submit" name="save_changes" value="{% trans "Create root" %} »" class="btn btn-primary btn-lg" /> + +    <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" name="save_changes" value="Create" /> +        </div>        </div>      </div>    </form> 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 %} +  <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="div_{{ field.auto_id }}" class="label {% if field.errors %} is-danger{% endif %}"> +          {{ 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 }} +        </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 %} +      {% if field.errors %} +        <p class="help is-danger"> +          {% for error in field.errors %} +            <span id="error_{{ forloop.counter }}_{{ field.auto_id }}">{{ error }}</span><br /> +          {% endfor %} +        </p> +      {% endif %} +    </div>    </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> + +{#<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 %} 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 @@      <div class="column is-two-thirds is-offset-2">        <article class="message is-primary">          <div class="message-header"> -          <p>Congratulations!</p> +          <p>No articles found</p>          </div>          <div class="message-body">            <p> -            {% 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.            </p>            {% if not user.is_superuser %}              <p> -              {% 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.              </p>              {% login_url as wiki_login_url %}              {% if wiki_login_url %}                <div class="has-text-centered"> -                <a href="{{ wiki_login_url }}" class="button is-primary">{% trans "Click here to login" %}</a> +                <a href="{{ wiki_login_url }}" class="button is-primary">Login</a>                </div>              {% endif %}            {% else %}              <p> -              {% 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 +              <code>django-wiki</code> documentation.              </p>              <a class="button is-primary" href="{% url 'wiki:root_create' %}">Create Article</a> | 
