diff options
author | 2020-10-05 19:30:10 +0200 | |
---|---|---|
committer | 2020-10-05 19:30:10 +0200 | |
commit | ab20a2f0ec5df75abb641df651b15ca3c0341c0f (patch) | |
tree | 69832b8c41cfb29cae312e265e3e3e3ee1f6419b /pydis_site/templates/wiki/includes | |
parent | Fix content app linting (diff) | |
parent | Merge pull request #405 from python-discord/remove_django_wiki (diff) |
Merge branch 'dewikification' into guides-app
Diffstat (limited to 'pydis_site/templates/wiki/includes')
-rw-r--r-- | pydis_site/templates/wiki/includes/article_menu.html | 78 | ||||
-rw-r--r-- | pydis_site/templates/wiki/includes/breadcrumbs.html | 95 | ||||
-rw-r--r-- | pydis_site/templates/wiki/includes/editor.html | 4 | ||||
-rw-r--r-- | pydis_site/templates/wiki/includes/editor_sidebar.html | 38 | ||||
-rw-r--r-- | pydis_site/templates/wiki/includes/editormedia.html | 17 | ||||
-rw-r--r-- | pydis_site/templates/wiki/includes/form.html | 16 | ||||
-rw-r--r-- | pydis_site/templates/wiki/includes/formerrors.html | 15 | ||||
-rw-r--r-- | pydis_site/templates/wiki/includes/formfield.html | 7 | ||||
-rw-r--r-- | pydis_site/templates/wiki/includes/messages.html | 0 | ||||
-rw-r--r-- | pydis_site/templates/wiki/includes/pagination.html | 27 | ||||
-rw-r--r-- | pydis_site/templates/wiki/includes/render.html | 28 | ||||
-rw-r--r-- | pydis_site/templates/wiki/includes/revision_info.html | 24 | ||||
-rw-r--r-- | pydis_site/templates/wiki/includes/searchresult.html | 33 |
13 files changed, 0 insertions, 382 deletions
diff --git a/pydis_site/templates/wiki/includes/article_menu.html b/pydis_site/templates/wiki/includes/article_menu.html deleted file mode 100644 index 966e8120..00000000 --- a/pydis_site/templates/wiki/includes/article_menu.html +++ /dev/null @@ -1,78 +0,0 @@ -{% load wiki_tags %} - -{% if article|can_write:user %} - {% with selected_tab as selected %} - <nav class="navbar is-light" role="navigation" aria-label="wiki navigation" id="wikiNavbar"> - <div class="container"> - <div class="navbar-brand"> - {% if not user.is_anonymous %} - <a class="navbar-item{% if selected == "settings" %} is-active{% endif %}" - href="{% url 'wiki:settings' article_id=article.id path=urlpath.path %}" - > - <span class="icon"> - <i class="fas fa-wrench"></i> - </span> - - <span class="is-hidden-mobile"> Settings</span> - </a> - {% endif %} - - {% for plugin in article_tabs %} - <a class="navbar-item{% if selected == plugin.slug %} is-active{% endif %}" - href="{% url 'wiki:plugin' slug=plugin.slug article_id=article.id path=urlpath.path %}" - > - <span class="icon"> - <i class="{{ plugin.article_tab.1 }}"></i> - </span> - - <span class="is-hidden-mobile"> {{ plugin.article_tab.0 }}</span> - </a> - {% endfor %} - - <a class="navbar-item{% if selected == "history" %} is-active{% endif %}" - href="{% url 'wiki:history' article_id=article.id path=urlpath.path %}" - > - <span class="icon"> - <i class="fas fa-clock"></i> - </span> - - <span class="is-hidden-mobile"> Changes</span> - </a> - - {% if article|can_write:user and not article.current_revision.locked %} - <a class="navbar-item{% if selected == "edit" %} is-active{% endif %}" - href="{% url 'wiki:edit' article_id=article.id path=urlpath.path %}" - > - <span class="icon"> - <i class="fas fa-edit"></i> - </span> - - <span class="is-hidden-mobile"> Edit</span> - </a> - {% else %} - <a class="navbar-item{% if selected == "source" %} is-active{% endif %}" - href="{% url 'wiki:source' article_id=article.id path=urlpath.path %}" - > - <span class="icon"> - <i class="fas fa-book-spells"></i> - </span> - - <span class="is-hidden-mobile"> View Source</span> - </a> - {% endif %} - - <a class="navbar-item{% if selected == "view" %} is-active{% endif %}" - href="{% url 'wiki:get' article_id=article.id path=urlpath.path %}" - > - <span class="icon"> - <i class="fas fa-book-open"></i> - </span> - - <span class="is-hidden-mobile"> View</span> - </a> - </div> - - </div> - </nav> - {% endwith %} -{% endif %} diff --git a/pydis_site/templates/wiki/includes/breadcrumbs.html b/pydis_site/templates/wiki/includes/breadcrumbs.html deleted file mode 100644 index 1b268e11..00000000 --- a/pydis_site/templates/wiki/includes/breadcrumbs.html +++ /dev/null @@ -1,95 +0,0 @@ -{% 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 %} - {% 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 }}</a> - </li> - {% endif %} - {% endfor %} - - <li class="is-active"> - <a href="{% url 'wiki:get' path=article.path %}">{{ article.current_revision.title }}</a> - </li> - </ul> - </nav> - - {% 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>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 %} - <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-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> - {% 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> - {% endif %} - {% endif %} - - </div> - </section> -{% endif %} diff --git a/pydis_site/templates/wiki/includes/editor.html b/pydis_site/templates/wiki/includes/editor.html deleted file mode 100644 index 6eb6cd45..00000000 --- a/pydis_site/templates/wiki/includes/editor.html +++ /dev/null @@ -1,4 +0,0 @@ -{% load wiki_tags %} -{% include "wiki/includes/editormedia.html" %} - -{% wiki_form form %} diff --git a/pydis_site/templates/wiki/includes/editor_sidebar.html b/pydis_site/templates/wiki/includes/editor_sidebar.html deleted file mode 100644 index 45ac87a1..00000000 --- a/pydis_site/templates/wiki/includes/editor_sidebar.html +++ /dev/null @@ -1,38 +0,0 @@ -{% load static %} - -<section class="accordions"> - {% for plugin, plugin_form in sidebar %} - <article class="accordion is-primary"> - <div class="accordion-header toggle"> - <p> - {% if plugin.sidebar.icon_class %} - <span class="icon"> - {% if plugin.sidebar.icon_class == "fa-picture-o" %} - <i class="fas fa-images"></i> - {% else %} - <i class="fas {{ plugin.sidebar.icon_class }}"></i> - {% endif %} - </span> - {% endif %} - - {{ plugin.sidebar.headline }} - </p> - - </div> - <div class="accordion-body"> - <div class="accordion-content"> - {% if plugin.sidebar.template %} - {% with plugin_form as form %} - <form method="POST" class="form-horizontal sidebar-form" action="?f={{ plugin_form.form_id }}" enctype="multipart/form-data"> - {% csrf_token %} - {% include plugin.sidebar.template %} - </form> - {% endwith %} - {% endif %} - </div> - </div> - </article> - {% endfor %} -</section> - -<script type="application/javascript" src="{% static "js/wiki/editor_sidebar.js" %}"></script> diff --git a/pydis_site/templates/wiki/includes/editormedia.html b/pydis_site/templates/wiki/includes/editormedia.html deleted file mode 100644 index c10fbef8..00000000 --- a/pydis_site/templates/wiki/includes/editormedia.html +++ /dev/null @@ -1,17 +0,0 @@ -{% load sekizai_tags %} -{% load static %} - -{% addtoblock "js" %} - <script type="text/javascript" src="{% static "wiki/js/editor.js" %}"></script> - {% for js in editor.Media.js %} - <script type="text/javascript" src="{% static js %}"></script> - {% endfor %} -{% endaddtoblock %} - -{% addtoblock "css" %} - {% for media, srcs in editor.Media.css.items %} - {% for src in srcs %} - <link rel="stylesheet" media="{{ media }}" href="{% static src %}" /> - {% endfor %} - {% endfor %} -{% endaddtoblock %} diff --git a/pydis_site/templates/wiki/includes/form.html b/pydis_site/templates/wiki/includes/form.html deleted file mode 100644 index 4ea08de4..00000000 --- a/pydis_site/templates/wiki/includes/form.html +++ /dev/null @@ -1,16 +0,0 @@ -{% load sekizai_tags %} -{% csrf_token %} - -{% 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 deleted file mode 100644 index c6df2637..00000000 --- a/pydis_site/templates/wiki/includes/formerrors.html +++ /dev/null @@ -1,15 +0,0 @@ -{% if form.non_field_errors %} - <article class="message is-danger"> - {% if form_error_title %} - <div class="message-header"> - <p>{{ form_error_title }}</p> - </div> - {% endif %} - - <div class="message-body"> - {% for error_message in form.non_field_errors %} - <p>{{ error_message }}</p> - {% endfor %} - </div> - </article> -{% endif %} diff --git a/pydis_site/templates/wiki/includes/formfield.html b/pydis_site/templates/wiki/includes/formfield.html deleted file mode 100644 index 8c42cfbf..00000000 --- a/pydis_site/templates/wiki/includes/formfield.html +++ /dev/null @@ -1,7 +0,0 @@ -{% load wiki_extra %} - -{% if field.is_hidden %} - {{ field }} -{% else %} - {% render_field field render_labels %} -{% endif %} diff --git a/pydis_site/templates/wiki/includes/messages.html b/pydis_site/templates/wiki/includes/messages.html deleted file mode 100644 index e69de29b..00000000 --- a/pydis_site/templates/wiki/includes/messages.html +++ /dev/null diff --git a/pydis_site/templates/wiki/includes/pagination.html b/pydis_site/templates/wiki/includes/pagination.html deleted file mode 100644 index 35dac538..00000000 --- a/pydis_site/templates/wiki/includes/pagination.html +++ /dev/null @@ -1,27 +0,0 @@ -{% load i18n %} - -{% if is_paginated %} - <nav class="pagination" role="navigation" aria-label="pagination"> - {% if page_obj.has_previous %} - <a class="pagination-previous" href="?{% if search_query %}q={{ search_query }}&{% endif %}page={{ page_obj.previous_page_number }}{% if appended_key %}&{{ appended_key }}={{ appended_value }}{% endif %}">Previous</a> - {% else %} - <a class="pagination-previous tooltip" data-tooltip="This is the first page" disabled>Previous</a> - {% endif %} - - {% if page_obj.has_next %} - <a class="pagination-next" href="?{% if search_query %}q={{ search_query }}&{% endif %}page={{ page_obj.next_page_number }}{% if appended_key %}&{{ appended_key }}={{ appended_value }}{% endif %}">Next</a> - {% else %} - <a class="pagination-next tooltip" data-tooltip="This is the last page" disabled>Older</a> - {% endif %} - - <ul class="pagination-list"> - {% for pc in paginator.page_range %} - {% if pc == 0 %} - <li><span class="pagination-ellipsis">…</span></li> - {% else %} - <li><a class="pagination-link{% if pc == page_obj.number %} is-current{% endif %}" href="?{% if search_query %}q={{ search_query }}&{% endif %}page={{ pc }}{% if appended_key %}&{{ appended_key }}={{ appended_value }}{% endif %}">{{ pc }}</a></li> - {% endif %} - {% endfor %} - </ul> - </nav> -{% endif %} diff --git a/pydis_site/templates/wiki/includes/render.html b/pydis_site/templates/wiki/includes/render.html deleted file mode 100644 index c0334d98..00000000 --- a/pydis_site/templates/wiki/includes/render.html +++ /dev/null @@ -1,28 +0,0 @@ -{% load sekizai_tags %} -{% load static %} - -{% addtoblock "js" %} - <script type="text/javascript" src="{% static "wiki/js/article.js" %}"></script> -{% endaddtoblock %} - -<div class="wiki-article"> - {{ content|default:"" }} -</div> - -{% for plugin in plugins %} - {% if plugin.RenderMedia.css %} - {% addtoblock "css" %} - {% for media, url in plugin.RenderMedia.css.items %} - <link rel="stylesheet" href="{% static url %}" /> - {% endfor %} - {% endaddtoblock %} - {% endif %} - - {% if plugin.RenderMedia.js %} - {% addtoblock "js" %} - {% for url in plugin.RenderMedia.js %} - <script type="text/javascript" src="{% static url %}"></script> - {% endfor %} - {% endaddtoblock %} - {% endif %} -{% endfor %} diff --git a/pydis_site/templates/wiki/includes/revision_info.html b/pydis_site/templates/wiki/includes/revision_info.html deleted file mode 100644 index f2964034..00000000 --- a/pydis_site/templates/wiki/includes/revision_info.html +++ /dev/null @@ -1,24 +0,0 @@ -{% comment %} - This reusable code is shared between different templates and different inheritors of - BaseRevision. -{% endcomment %} - -{% load wiki_tags %} - -{% if not hidedate %}{{ revision.created }}{% endif %} {% if not hidenumber %}(#{{ revision.revision_number }}) by{% endif %} {% if revision.user %}{{ revision.user }}{% else %}{% if article|can_moderate:user %}{{ revision.ip_address|default:"anonymous (IP not logged)" }}{% else %}anonymous (IP logged){% endif %}{% endif %} - -{% if revision.deleted %} - <span class="tag is-danger">deleted</span> -{% endif %} - -{% if revision.previous_revision.deleted and not revision.deleted %} - <span class="tag is-success">restored</span> -{% endif %} - -{% if revision.locked %} - <span class="tag is-danger">locked</span> -{% endif %} - -{% if revision.previous_revision.locked and not revision.locked %} - <span class="tag is-success">unlocked</span> -{% endif %} diff --git a/pydis_site/templates/wiki/includes/searchresult.html b/pydis_site/templates/wiki/includes/searchresult.html deleted file mode 100644 index 897ee4a6..00000000 --- a/pydis_site/templates/wiki/includes/searchresult.html +++ /dev/null @@ -1,33 +0,0 @@ -{% load humanize %} - -<tr> - <td> - {% for urlpath in article.urlpath_set.all %} - <a href="{% url 'wiki:get' path=urlpath.path %}"> - {{ article.current_revision.title }} - <br /> - <small class="has-text-grey">Slug: /{{ urlpath.path }}</small> - </a> - {% empty %} - <a href="{% url 'wiki:get' article_id=article.id %}"> - {{ article.current_revision.title }} - </a> - {% endfor %} - - {% if article.current_revision.deleted %} - <span class="icon"> - <i class="fas fa-trash"></i> - </span> - {% endif %} - - {% if article.current_revision.locked %} - <span class="icon"> - <i class="fas fa-lock"></i> - </span> - {% endif %} - </td> - - <td class="has-text-right"> - {{ article.current_revision.created|naturaltime }} - </td> -</tr> |