aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-05-05 17:37:58 +0100
committerGravatar Gareth Coles <[email protected]>2018-05-05 17:37:58 +0100
commit7fda7be72d9b9abaec92b799760b1acfaeffa232 (patch)
tree4b46afc189587a403396b5d71b8726da00a2702c /templates
parentUse Discord embed image for index page button (diff)
parentUpdate README.md (diff)
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'templates')
-rw-r--r--templates/wiki/base.html105
-rw-r--r--templates/wiki/page_delete.html26
-rw-r--r--templates/wiki/page_edit.html2
-rw-r--r--templates/wiki/special.html17
-rw-r--r--templates/wiki/special_all.html26
5 files changed, 130 insertions, 46 deletions
diff --git a/templates/wiki/base.html b/templates/wiki/base.html
index c6f8deca..eec0ecb8 100644
--- a/templates/wiki/base.html
+++ b/templates/wiki/base.html
@@ -69,32 +69,48 @@
<li><a href="{{ url_for("wiki.page", page="minecraft") }}">
<i class="uk-icon fas fa-fw fa-cube"></i> &nbsp;Minecraft
</a></li>
-{# <li class="uk-active"><a href="#">active</a></li>#}
-{# <li class="uk-parent">#}
-{# <a href="#">Contributing</a>#}
-{# <ul class="uk-nav-sub">#}
-{# <li><a href="#">Sub item</a></li>#}
-{# <li><a href="#">Sub item</a></li>#}
-{# </ul>#}
-{# </li>#}
- <li class="uk-nav-divider"></li>
- {% if (can_edit or debug) and current_page != "edit" %}
- <li>
- <a href="{{ url_for("wiki.edit", page=page) }}">
- <i class="uk-icon fas fa-fw fa-pencil-alt"></i> &nbsp;Edit
- </a>
- </li>
- {% elif current_page == "edit" %}
- <li>
- <a href="{{ url_for("wiki.page", page=page) }}">
- <i class="uk-icon fas fa-fw fa-arrow-left"></i> &nbsp;Back
- </a>
- </li>
- {% endif %}
+ {% set ACTIONABLE_PAGES = ["page", "edit", "history.show", "history.compare", "source", "delete"] %}
+ {% set actionable = current_page in ACTIONABLE_PAGES %}
+
+ {% if actionable %}
+ <li class="uk-nav-divider"></li>
- {% if current_page != "history.show" %}
- {% if current_page == "history.compare" %}
+ {% if current_page == "edit" %}
+ <li>
+ <a href="{{ url_for("wiki.page", page=page) }}">
+ <i class="uk-icon fas fa-fw fa-arrow-left"></i> &nbsp;Back
+ </a>
+ </li>
+ {% else %}
+ <li>
+ <a href="{{ url_for("wiki.edit", page=page) }}">
+ <i class="uk-icon fas fa-fw fa-pencil-alt"></i> &nbsp;Edit
+ </a>
+ </li>
+ {% endif %}
+
+ {% if current_page == "delete" %}
+ <li>
+ <a href="{{ url_for("wiki.page", page=page) }}">
+ <i class="uk-icon fas fa-fw fa-arrow-left"></i> &nbsp;Back
+ </a>
+ </li>
+ {% else %}
+ <li>
+ <a href="{{ url_for("wiki.delete", page=page) }}">
+ <i class="uk-icon fas fa-fw fa-trash"></i> &nbsp;Delete
+ </a>
+ </li>
+ {% endif %}
+
+ {% if current_page == "history.show" %}
+ <li>
+ <a href="{{ url_for("wiki.page", page=page) }}">
+ <i class="uk-icon fas fa-fw fa-arrow-left"></i> &nbsp;Back
+ </a>
+ </li>
+ {% elif current_page == "history.compare" %}
<li>
<a href="{{ url_for("wiki.history.show", page=slug) }}">
<i class="uk-icon fas fa-fw fa-arrow-left"></i> &nbsp;Back
@@ -107,30 +123,29 @@
</a>
</li>
{% endif %}
- {% else %}
- <li>
- <a href="{{ url_for("wiki.page", page=page) }}">
- <i class="uk-icon fas fa-fw fa-arrow-left"></i> &nbsp;Back
- </a>
- </li>
- {% endif %}
-
- {% if current_page != "source" %}
- <li>
- <a href="{{ url_for("wiki.source", page=page) }}">
- <i class="uk-icon fas fa-fw fa-code"></i> &nbsp;Source
- </a>
- </li>
- {% else %}
- <li>
- <a href="{{ url_for("wiki.page", page=page) }}">
- <i class="uk-icon fas fa-fw fa-arrow-left"></i> &nbsp;Back
- </a>
- </li>
+ {% if current_page == "source" %}
+ <li>
+ <a href="{{ url_for("wiki.page", page=page) }}">
+ <i class="uk-icon fas fa-fw fa-arrow-left"></i> &nbsp;Back
+ </a>
+ </li>
+ {% else %}
+ <li>
+ <a href="{{ url_for("wiki.source", page=page) }}">
+ <i class="uk-icon fas fa-fw fa-code"></i> &nbsp;Source
+ </a>
+ </li>
+ {% endif %}
{% endif %}
+
<li class="uk-nav-divider"></li>
- <li><a href="{{ url_for("wiki.page", page="help") }}"><i class="fas fa-fw fa-question-circle"></i> &nbsp;Help</a></li>
+ <li><a href="{{ url_for("wiki.special") }}">
+ <i class="uk-icon fas fa-fw fa-ellipsis-h"></i> &nbsp;Special Pages
+ </a></li>
+ <li><a href="{{ url_for("wiki.page", page="help") }}">
+ <i class="fas fa-fw fa-question-circle"></i> &nbsp;Help
+ </a></li>
</ul>
</div>
<div class="uk-section" style="flex-grow: 1; margin: 0 1rem 1rem;">
diff --git a/templates/wiki/page_delete.html b/templates/wiki/page_delete.html
new file mode 100644
index 00000000..f4d52653
--- /dev/null
+++ b/templates/wiki/page_delete.html
@@ -0,0 +1,26 @@
+{% extends "wiki/base.html" %}
+{% block title %}Wiki | Delete: {{ page }}{% endblock %}
+{% block og_title %}Wiki | Delete: {{ page }}{% endblock %}
+{% block og_description %}{% endblock %}
+{% block extra_head %}
+<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.3.3/ace.js" type="application/javascript"></script>
+{% endblock %}
+{% block content %}
+ <div uk-alert class="uk-alert-danger">
+ <h3>Delete Page: {{ page }}</h3>
+ <p>
+ Are you sure you want to delete this page?
+ </p>
+
+ <form uk-grid class="uk-grid-small" action="{{ url_for("wiki.delete", page=page) }}" method="post">
+ <div class="uk-width-1-2">
+ <a href="{{ url_for("wiki.page", page=page) }}" class="uk-button uk-button-primary uk-width-1-1" type="button" value="Cancel" id="cancel">Cancel</a>
+ </div>
+ <div class="uk-width-1-2">
+ <input class="uk-button uk-button-secondary uk-width-1-1" type="submit" id="delete" value="Delete" />
+ </div>
+
+ <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
+ </form>
+ </div>
+{% endblock %}
diff --git a/templates/wiki/page_edit.html b/templates/wiki/page_edit.html
index a2d709e2..51ce70db 100644
--- a/templates/wiki/page_edit.html
+++ b/templates/wiki/page_edit.html
@@ -1,7 +1,7 @@
{% extends "wiki/base.html" %}
{% block title %}Wiki | Edit: {{ page }}{% endblock %}
{% block og_title %}Wiki | Edit: {{ page }}{% endblock %}
-{% block og_description %}Landing page for the wiki{% endblock %}
+{% block og_description %}{% endblock %}
{% block extra_head %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.3.3/ace.js" type="application/javascript"></script>
{% endblock %}
diff --git a/templates/wiki/special.html b/templates/wiki/special.html
new file mode 100644
index 00000000..12e9cb18
--- /dev/null
+++ b/templates/wiki/special.html
@@ -0,0 +1,17 @@
+{% extends "wiki/base.html" %}
+{% block title %}Wiki | Special Pages{% endblock %}
+{% block og_title %}Wiki | Special Pages{% endblock %}
+{% block og_description %}Wiki special pages, non-article informational pages{% endblock %}
+{% block content %}
+ <div class="uk-container uk-container-small">
+ <h2 class="uk-title">
+ Special Pages
+ </h2>
+
+ <ul>
+ <li><a href="{{ url_for("wiki.special.all_pages") }}">
+ Special: All Pages
+ </a></li>
+ </ul>
+ </div>
+{% endblock %} \ No newline at end of file
diff --git a/templates/wiki/special_all.html b/templates/wiki/special_all.html
new file mode 100644
index 00000000..92aa12a4
--- /dev/null
+++ b/templates/wiki/special_all.html
@@ -0,0 +1,26 @@
+{% extends "wiki/base.html" %}
+{% block title %}Wiki | Special: All Pages{% endblock %}
+{% block og_title %}Wiki | Special: All Pages{% endblock %}
+{% block og_description %}A listing for all pages on the wiki{% endblock %}
+{% block content %}
+ <div class="uk-container uk-container-small">
+ <h2 class="uk-title">
+ Special: All Pages
+ </h2>
+ <p class="uk-text-meta">
+ A listing for all pages on the wiki
+ </p>
+
+ {% for letter, pages in letters.items() %}
+ <h3 class="uk-heading-divider">{{ letter }}</h3>
+
+ <ul>
+ {% for page in pages %}
+ <li><a href="{{ url_for("wiki.page", page=page.slug) }}">
+ {{ page.title }} (<span style="font-family: monospace;">{{ page.slug }}</span>)
+ </a></li>
+ {% endfor %}
+ </ul>
+ {% endfor %}
+ </div>
+{% endblock %} \ No newline at end of file