diff options
Diffstat (limited to 'pydis_site/templates/wiki')
| -rw-r--r-- | pydis_site/templates/wiki/base.html | 3 | ||||
| -rw-r--r-- | pydis_site/templates/wiki/includes/breadcrumbs.html | 112 | ||||
| -rw-r--r-- | pydis_site/templates/wiki/includes/messages.html | 11 | 
3 files changed, 61 insertions, 65 deletions
| diff --git a/pydis_site/templates/wiki/base.html b/pydis_site/templates/wiki/base.html index da4d5de1..9f904324 100644 --- a/pydis_site/templates/wiki/base.html +++ b/pydis_site/templates/wiki/base.html @@ -15,6 +15,7 @@    <link rel="stylesheet" href="{% static "css/wiki/simplemde-fixes.css" %}">    <link rel="stylesheet" href="{% static "css/wiki/style.css" %}">    <link rel="stylesheet" href="{% static "css/pygments/darcula.css" %}"> +  <link rel="stylesheet" href="{% static "css/base/notification.css" %}">  {% endblock %}  {% block content %} @@ -31,8 +32,6 @@    {% block wiki_body %}      <section class="section">        <div class="container"> -        {% wiki_messages %} -          <div class="content">            {% block wiki_contents %}{% endblock %}          </div> diff --git a/pydis_site/templates/wiki/includes/breadcrumbs.html b/pydis_site/templates/wiki/includes/breadcrumbs.html index a2359f39..791beb90 100644 --- a/pydis_site/templates/wiki/includes/breadcrumbs.html +++ b/pydis_site/templates/wiki/includes/breadcrumbs.html @@ -1,12 +1,18 @@ -{% if urlpath and article and not user.is_anonymous %} +{% load wiki_tags %} + +{% if urlpath and article %}    <section class="breadcrumb-section section">      <div class="container">        <nav class="breadcrumb is-pulled-left" aria-label="breadcrumbs">          <ul>            {% for ancestor in urlpath.cached_ancestors %} -            <li> -              <a href="{% url 'wiki:get' path=ancestor.path %}">{{ ancestor.article.current_revision.title|truncatechars:25 }}</a> -            </li> +            {% if forloop.first and not article|can_write:user %} +              {# Continue, we don't want to show the root element #} +            {% else %} +              <li> +                <a href="{% url 'wiki:get' path=ancestor.path %}">{{ ancestor.article.current_revision.title|truncatechars:25 }}</a> +              </li> +            {% endif %}            {% endfor %}            <li class="is-active"> @@ -15,71 +21,73 @@          </ul>        </nav> -      <div class="dropdown is-pulled-right is-right"> -        <div class="dropdown-trigger"> -          <a aria-haspopup="true" aria-controls="sub-article-dropdown"> -            <span>Sub-Articles</span> -            <span class="icon"> -              <i class="fas fa-angle-down"></i> -            </span> -          </a> -        </div> -        <div class="dropdown-menu" id="sub-article-dropdown" role="menu"> -          <div class="dropdown-content"> -            {% if children_slice %} -              {% for child in children_slice %} -                <a class="dropdown-item" href="{% url 'wiki:get' path=child.path %}"> -                  {{ child.article.current_revision.title }} -                </a> -              {% endfor %} - -              {% if children_slice_more %} -                <a class="dropdown-item" href="{% url 'wiki:dir' path=urlpath.path %}"> -                  ...and more. -                </a> -              {% endif %} - -              <hr class="dropdown-divider"> -            {% endif %} - -            <a class="dropdown-item" href="{% url 'wiki:dir' path=urlpath.path %}"> -              Browse other articles -            </a> -          </div> -        </div> -      </div> - -      {% if request.user.is_authenticated %} +      {% if article|can_write:user %}          <div class="dropdown is-pulled-right is-right">            <div class="dropdown-trigger">              <a aria-haspopup="true" aria-controls="sub-article-dropdown"> -              <span>Create Article</span> +              <span>Sub-Articles</span>                <span class="icon">                  <i class="fas fa-angle-down"></i>                </span> -                             </a>            </div>            <div class="dropdown-menu" id="sub-article-dropdown" role="menu">              <div class="dropdown-content"> -              {% if urlpath.parent %} -                <a class="dropdown-item" href="{% url 'wiki:create' path=urlpath.parent.path %}"> -                  <span class="icon"> -                    <i class="fas fa-arrow-right"></i> -                  </span> -                  <span>At current level</span> -                </a> +              {% if children_slice %} +                {% for child in children_slice %} +                  <a class="dropdown-item" href="{% url 'wiki:get' path=child.path %}"> +                    {{ child.article.current_revision.title }} +                  </a> +                {% endfor %} + +                {% if children_slice_more %} +                  <a class="dropdown-item" href="{% url 'wiki:dir' path=urlpath.path %}"> +                    ...and more. +                  </a> +                {% endif %} + +                <hr class="dropdown-divider">                {% endif %} -              <a class="dropdown-item" href="{% url 'wiki:create' path=urlpath.path %}"> +              <a class="dropdown-item" href="{% url 'wiki:dir' path=urlpath.path %}"> +                Browse other articles +              </a> +            </div> +          </div> +        </div> + +        {% if request.user.is_authenticated %} +          <div class="dropdown is-pulled-right is-right"> +            <div class="dropdown-trigger"> +              <a aria-haspopup="true" aria-controls="sub-article-dropdown"> +                <span>Create Article</span>                  <span class="icon"> -                  <i class="fas fa-arrow-down"></i> +                  <i class="fas fa-angle-down"></i>                  </span> -                <span>Below current level</span> +                                 </a>              </div> +            <div class="dropdown-menu" id="sub-article-dropdown" role="menu"> +              <div class="dropdown-content"> +                {% if urlpath.parent %} +                  <a class="dropdown-item" href="{% url 'wiki:create' path=urlpath.parent.path %}"> +                    <span class="icon"> +                      <i class="fas fa-arrow-right"></i> +                    </span> +                    <span>At current level</span> +                  </a> +                {% endif %} + +                <a class="dropdown-item" href="{% url 'wiki:create' path=urlpath.path %}"> +                  <span class="icon"> +                    <i class="fas fa-arrow-down"></i> +                  </span> +                  <span>Below current level</span> +                </a> +              </div> +            </div>            </div> -        </div> +        {% endif %}        {% endif %}      </div> diff --git a/pydis_site/templates/wiki/includes/messages.html b/pydis_site/templates/wiki/includes/messages.html index cdf58d87..e69de29b 100644 --- a/pydis_site/templates/wiki/includes/messages.html +++ b/pydis_site/templates/wiki/includes/messages.html @@ -1,11 +0,0 @@ -{% if messages %} -  <!-- Messages for this instance --> -  {% for message in messages %} -    <article class="message {{ message.css_class }}"> -      <div class="message-body"> -        {{ message }} -      </div> -    </article> - -  {% endfor %} -{% endif %} | 
