diff options
Diffstat (limited to 'templates/wiki')
-rw-r--r-- | templates/wiki/base.html | 216 | ||||
-rw-r--r-- | templates/wiki/compare_revision.html | 13 | ||||
-rw-r--r-- | templates/wiki/page_delete.html | 25 | ||||
-rw-r--r-- | templates/wiki/page_edit.html | 137 | ||||
-rw-r--r-- | templates/wiki/page_in_use.html | 12 | ||||
-rw-r--r-- | templates/wiki/page_move.html | 26 | ||||
-rw-r--r-- | templates/wiki/page_source.html | 13 | ||||
-rw-r--r-- | templates/wiki/page_view.html | 18 | ||||
-rw-r--r-- | templates/wiki/revision_list.html | 36 | ||||
-rw-r--r-- | templates/wiki/search.html | 23 | ||||
-rw-r--r-- | templates/wiki/search_results.html | 39 | ||||
-rw-r--r-- | templates/wiki/special.html | 17 | ||||
-rw-r--r-- | templates/wiki/special_all.html | 26 |
13 files changed, 0 insertions, 601 deletions
diff --git a/templates/wiki/base.html b/templates/wiki/base.html deleted file mode 100644 index 038ee5a2..00000000 --- a/templates/wiki/base.html +++ /dev/null @@ -1,216 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> - <head> - {% block head %} - <title>Python Discord | {% block title %}{% endblock %}</title> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - - <script src="{{ static_file('js/script.js') }}" type="application/javascript"></script> - - <!-- Static stuff --> - <link rel="shortcut icon" href="{{ static_file('favicon.ico') }}"> - <link rel="stylesheet" href="{{ static_file('css/uikit_blurple.css') }}"/> - <link rel="stylesheet" href="{{ static_file('css/style.css') }}"/> - <link rel="stylesheet" href="{{ static_file('css/bundled/pygments-monokai.css') }}"/> - <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css"> - - <!-- OpenGraph metadata --> - <meta property="og:title" content="Python Discord | {% block og_title %}{% endblock %}"> - <meta property="og:description" content="{% block og_description %}We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.{% endblock %}"> - <meta content="/static/logos/logo_discord.png" property="og:image"> - {% endblock %} - {% block extra_head %} - - {% endblock %} - </head> - <body class="{% block page_classes %}{% endblock page_classes %} - page-{{ current_page.replace(".", "-") }} - blueprint-{{ blueprint.replace(".", "-") }}"> - <div class="uk-offcanvas-content uk-flex uk-flex-column" id="wiki-page"> - {% include "main/navigation.html" %} - <div class="uk-flex uk-flex-row uk-flex-1"> - <div class="uk-card uk-card-body uk-flex-left uk-flex uk-card-primary uk-visible@s" id="wiki-sidebar"> - <ul class="uk-nav-default uk-nav-parent-icon" uk-nav id="wiki-nav"> - {% if data is defined and current_page == "wiki.page" %} - {% if "headers" in data and data.headers %} - <li class="uk-nav-header">Contents</li> - {% for header in data.headers %} - {% if "sub_headers" in header %} - <li class="uk-parent"> - <a href="{{ header.id }}"> - {{ header.title | safe }} - </a> - <ul class="uk-nav-sub"> - {% for sub in header.sub_headers %} - <li><a href="{{ sub.id }}"> - {{ sub.title | safe }} - </a></li> - {% endfor %} - </ul> - </li> - {% else %} - <li><a href="{{ header.id }}">{{ header.title | safe }}</a></li> - {% endif %} - {% endfor %} - <li class="uk-nav-divider"></li> - {% endif %} - {% endif %} - <li class="uk-nav-header">Pages</li> - - <li><a href="{{ url_for("wiki.page", page="home") }}"> - <i class="uk-icon fas fa-fw fa-home"></i> Home - </a></li> - <li><a href="{{ url_for("wiki.page", page="jams") }}"> - <i class="uk-icon fas fa-fw fa-star-exclamation"></i> Code Jams</a> - </li> - <li><a href="{{ url_for("wiki.page", page="contributing") }}"> - <i class="uk-icon fas fa-fw fa-code-branch"></i> Contributing - </a></li> - - {% set ACTIONABLE_PAGES = [ - "wiki.page", "wiki.edit", "wiki.history.show", - "wiki.history.compare", "wiki.source", "wiki.delete", - "wiki.move" - ] %} - {% set actionable = current_page in ACTIONABLE_PAGES and can_edit %} - - {% if actionable %} - <li class="uk-nav-divider"></li> - - <li class="uk-nav-header">Actions</li> - - {% if current_page == "wiki.edit" %} - <li> - <a href="{{ url_for("wiki.page", page=page) }}"> - <i class="uk-icon fas fa-fw fa-arrow-left"></i> Back - </a> - </li> - {% else %} - <li> - <a href="{{ url_for("wiki.edit", page=page) }}"> - <i class="uk-icon fas fa-fw fa-pencil-alt"></i> Edit - </a> - </li> - {% endif %} - - {% if current_page == "wiki.delete" %} - <li> - <a href="{{ url_for("wiki.page", page=page) }}"> - <i class="uk-icon fas fa-fw fa-arrow-left"></i> Back - </a> - </li> - {% else %} - <li> - <a href="{{ url_for("wiki.delete", page=page) }}"> - <i class="uk-icon fas fa-fw fa-trash"></i> Delete - </a> - </li> - {% endif %} - - {% if current_page == "wiki.move" %} - <li> - <a href="{{ url_for("wiki.page", page=page) }}"> - <i class="uk-icon fas fa-fw fa-arrow-left"></i> Back - </a> - </li> - {% else %} - <li> - <a href="{{ url_for("wiki.move", page=page) }}"> - <i class="uk-icon fas fa-fw fa-arrow-right"></i> Move - </a> - </li> - {% endif %} - - {% if current_page == "wiki.history.show" %} - <li> - <a href="{{ url_for("wiki.page", page=page) }}"> - <i class="uk-icon fas fa-fw fa-arrow-left"></i> Back - </a> - </li> - {% elif current_page == "wiki.history.compare" %} - <li> - <a href="{{ url_for("wiki.history.show", page=slug) }}"> - <i class="uk-icon fas fa-fw fa-arrow-left"></i> Back - </a> - </li> - {% else %} - <li> - <a href="{{ url_for("wiki.history.show", page=page) }}"> - <i class="uk-icon fas fa-fw fa-history"></i> Revisions - </a> - </li> - {% endif %} - - {% if current_page == "wiki.source" %} - <li> - <a href="{{ url_for("wiki.page", page=page) }}"> - <i class="uk-icon fas fa-fw fa-arrow-left"></i> Back - </a> - </li> - {% else %} - <li> - <a href="{{ url_for("wiki.source", page=page) }}"> - <i class="uk-icon fas fa-fw fa-code"></i> Source - </a> - </li> - {% endif %} - {% endif %} - - <li class="uk-nav-divider"></li> - <li class="uk-nav-header">Information</li> - - <li><a href="{{ url_for("wiki.special") }}"> - <i class="uk-icon fas fa-fw fa-ellipsis-h"></i> Special Pages - </a></li> - <li><a href="{{ url_for("wiki.page", page="help") }}"> - <i class="uk-icon fas fa-fw fa-question-circle"></i> Help - </a></li> - - <li> - <form action="{{ url_for("wiki.search") }}" method="post"> - {% if query is undefined %} - <input type="text" class="uk-input sidebar-search-input" placeholder="Search (BETA)" id="query" name="query" required> - {% else %} - <input type="text" class="uk-input sidebar-search-input" placeholder="Search (BETA)" id="query" name="query" value="{{ query }}" required> - {% endif %} - <br /> - <button class="uk-button uk-button-darkish uk-button-small search-button" type="submit" id="search" title="Search"> - <i class="uk-icon fas fa-fw fa-search"></i> - </button> - - <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/> - </form> - </li> - </ul> - </div> - <div class="uk-width-expand full-width"> - <a class="uk-flex-left uk-flex uk-flex-column uk-background-primary uk-hidden@s uk-hidden@m uk-hidden@l uk-hidden@xl" id="wiki-sidebar-button"> - <div class="uk-flex-center"><i class="uk-icon fa-fw far fa-bars"></i></div> - </a> - <div class="uk-section uk-flex uk-flex-column content"> - {% block content %}{% endblock %} - </div> - </div> - </div> - </div> - - <footer> - <div class="uk-section uk-section-secondary uk-container-medium uk-text-meta"> - <div class="uk-text-center uk-text-meta"> - <p> - This website uses <a href="https://python.org">Python</a> and - <a href="http://flask.pocoo.org/">Flask</a>, and was developed collaboratively on - <a href="https://gitlab.com/python-discord/projects/site">GitLab</a>. - <br /> - For privacy & GDPR-related info, please <a href="{{ url_for("main.about.privacy") }}">see this page</a>. - </p> - </div> - </div> - </footer> - - <script> - wiki_sidebar(); - </script> - </body> -</html> diff --git a/templates/wiki/compare_revision.html b/templates/wiki/compare_revision.html deleted file mode 100644 index 34ab61bc..00000000 --- a/templates/wiki/compare_revision.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "wiki/base.html" %} -{% block title %}Wiki | Comparing {{ title }}{% endblock %} -{% block og_title %}Wiki | Comparing {{ title }}{% endblock %} -{% block og_description %}{% endblock %} -{% block content %} - <div class="uk-container uk-container-small"> - <h2 class="uk-title"> - Revision comparison for {{ title }} - </h2> - - {{ diff | safe }} - </div> -{% endblock %} diff --git a/templates/wiki/page_delete.html b/templates/wiki/page_delete.html deleted file mode 100644 index 27c4b406..00000000 --- a/templates/wiki/page_delete.html +++ /dev/null @@ -1,25 +0,0 @@ -{% extends "wiki/base.html" %} -{% block title %}Wiki | Delete: {{ page }}{% endblock %} -{% block og_title %}Wiki | Delete: {{ page }}{% endblock %} -{% block og_description %}{% endblock %} -{% block content %} - <div class="uk-container uk-container-small"> - <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" 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> - </div> -{% endblock %} diff --git a/templates/wiki/page_edit.html b/templates/wiki/page_edit.html deleted file mode 100644 index 7293b5f5..00000000 --- a/templates/wiki/page_edit.html +++ /dev/null @@ -1,137 +0,0 @@ -{% extends "wiki/base.html" %} -{% block title %}Wiki | Edit: {{ page }}{% endblock %} -{% block og_title %}Wiki | Edit: {{ page }}{% endblock %} -{% block og_description %}{% endblock %} - -{% block page_classes %}uses-rst{% endblock %} - -{% block content %} - <form uk-grid class="uk-grid-small" action="{{ url_for("wiki.edit", page=page) }}" method="post"> - <div class="uk-width-expand"> - <input name="title" id="title" placeholder="Page Title" value="{{ title }}" class="uk-input" required /> - </div> - <div class="uk-width-auto"> - <button class="uk-button uk-button-secondary" type="button" value="Preview" id="preview">Preview</button> - </div> - <div class="uk-width-auto"> - <input class="uk-button uk-button-primary" type="submit" id="submit" value="Save" disabled /> - </div> - <div class="uk-width-1-1"> - <div id="editor" class="uk-textarea">{{ rst }}</div> - <input type="hidden" name="rst" id="rst" /> - </div> - - <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/> - </form> - - <div class="uk-container uk-container-small preview-title"> - <h2 id="preview-title">{{ title }}</h2> - - <div id="preview-div"> - {{ preview | safe }} - </div> - </div> - - <script type="application/javascript"> - "use strict"; - - window.onload = () => { - let csrf_token = "{{ csrf_token() }}"; - - function do_preview(_) { - let oReq = new XMLHttpRequest(); - - oReq.addEventListener("load", function () { - let response = JSON.parse(this.responseText); - - if (response.error !== undefined) { - document.getElementById("submit").disabled = true; - - if (response.error_lines !== undefined) { - editor.session.setAnnotations(response.error_lines); - document.getElementById("preview-div").innerHTML = "<h3>Error - see editor margin</h3>"; - } else { - console.log("Error: " + response.error); - document.getElementById("preview-div").innerHTML = "<h3>Error</h3><p>" + response.error + "<p>"; - } - } else { - document.getElementById("submit").disabled = false; - document.getElementById("preview-div").innerHTML = response.data; - - editor.session.setAnnotations([]); - } - }); - - let data = editor.getValue(); - - if (data.replace("\s", "").length < 1 || document.getElementById("title").value.length < 1) { - document.getElementById("submit").disabled = true; - return false; - } - - oReq.open("POST", "/render"); - - oReq.setRequestHeader("Content-type", "application/json"); - oReq.setRequestHeader("X-CSRFToken", csrf_token); - - oReq.send(JSON.stringify({"data": editor.getValue()})); - - return false; - } - - document.getElementById("preview").onclick = do_preview; - - let editor = ace.edit("editor"); - let timer; - - editor.session.setMode("ace/mode/rst"); - editor.session.setUseWrapMode(true); - - editor.setTheme("ace/theme/iplastic"); - editor.setShowPrintMargin(false); - - editor.on("input", function () { - document.getElementById("submit").disabled = true; - document.getElementById("rst").value = editor.getValue(); - - if (timer !== undefined) { - clearTimeout(timer); - } - timer = setTimeout(do_preview, 1000); - }); - - document.getElementById("title").oninput = function () { - if (document.getElementById("title").value.length < 1) { - document.getElementById("submit").disabled = true; - } - - document.getElementById("preview-title").textContent = document.getElementById("title").value; - - document.getElementById("rst").value = editor.getValue(); - - if (timer !== undefined) { - clearTimeout(timer); - } - timer = setTimeout(do_preview, 1000); - }; - - function refreshLock() { - console.log("Refreshing lock"); - let xhttp = new XMLHttpRequest(); - xhttp.onreadystatechange = function () { - if (this.readyState === 4 && this.status === 204) { - console.log("Lock refreshed") - } else if (this.readyState === 4 && this.status !== 204) { - console.log("Could not refresh lock") - } - }; - - xhttp.open("PATCH", document.location.pathname, true); - xhttp.send(); - } - - // Lock refreshing - setInterval(refreshLock, (60 * 4) * 1000); - } - </script> -{% endblock %} diff --git a/templates/wiki/page_in_use.html b/templates/wiki/page_in_use.html deleted file mode 100644 index 1707845c..00000000 --- a/templates/wiki/page_in_use.html +++ /dev/null @@ -1,12 +0,0 @@ -{% extends "wiki/base.html" %} -{% block title %}Wiki Error{% endblock %} -{% block og_title %}Wiki Error{% endblock %} -{% block og_description %}{% endblock %} -{% block content %} - <div class="uk-container uk-container-small"> - <div uk-alert class="uk-alert-warning"> - <h3>The page you requested is currently being edited</h3> - <p>Please try again in a little bit when the lock has expired.</p> - </div> - </div> -{% endblock %} diff --git a/templates/wiki/page_move.html b/templates/wiki/page_move.html deleted file mode 100644 index 2bd772e9..00000000 --- a/templates/wiki/page_move.html +++ /dev/null @@ -1,26 +0,0 @@ -{% extends "wiki/base.html" %} -{% block title %}Wiki | Move: {{ page }}{% endblock %} -{% block og_title %}Wiki | Move: {{ page }}{% endblock %} -{% block og_description %}{% endblock %} -{% block content %} - <div class="uk-container uk-container-small"> - {% if message is defined %} - <div uk-alert class="uk-alert-danger"> - <p>{{ message }}</p> - </div> - {% endif %} - - <h3>Move Page: {{ page }}</h3> - <form uk-grid class="uk-grid-small" action="{{ url_for("wiki.move", page=page) }}" method="post"> - <input type="text" class="uk-width-1-1 uk-input location-input" placeholder="{{ page }}" id="location" name="location" required> - <div class="uk-width-1-2"> - <a href="{{ url_for("wiki.page", page=page) }}" class="uk-button uk-button-secondary uk-width-1-1" type="button" id="cancel">Cancel</a> - </div> - <div class="uk-width-1-2"> - <input class="uk-button uk-button-primary uk-width-1-1" type="submit" id="move" value="Move" /> - </div> - - <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/> - </form> - </div> -{% endblock %} diff --git a/templates/wiki/page_source.html b/templates/wiki/page_source.html deleted file mode 100644 index 15384aa9..00000000 --- a/templates/wiki/page_source.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "wiki/base.html" %} -{% block title %}Wiki | {{ data["title"] }}{% endblock %} -{% block og_title %}Wiki | {{ data["title"] }}{% endblock %} -{% block og_description %}{% endblock %} -{% block content %} - <div class="uk-container uk-container-small"> - <h2 class="uk-title"> - {{ data["title"] }} - </h2> - - {{ rst | safe }} - </div> -{% endblock %}
\ No newline at end of file diff --git a/templates/wiki/page_view.html b/templates/wiki/page_view.html deleted file mode 100644 index aa560390..00000000 --- a/templates/wiki/page_view.html +++ /dev/null @@ -1,18 +0,0 @@ -{% extends "wiki/base.html" %} -{% block title %}Wiki | {{ data["title"] }}{% endblock %} -{% block og_title %}Wiki | {{ data["title"] }}{% endblock %} - -{# To be safe about whitespace formatting on various platforms, we do everything one one line here #} -{% block og_description %}{% if data.rst.startswith(".. header::") %}{{ data.text.split("\n", 1)[0] }}{% endif %}{% endblock %} - -{% block page_classes %}uses-rst{% endblock %} - -{% block content %} - <div class="uk-container uk-container-small" id="doc-view"> - <h2 class="uk-title"> - {{ data["title"] }} - </h2> - - {{ data["html"] | safe }} - </div> -{% endblock %}
\ No newline at end of file diff --git a/templates/wiki/revision_list.html b/templates/wiki/revision_list.html deleted file mode 100644 index cd6767db..00000000 --- a/templates/wiki/revision_list.html +++ /dev/null @@ -1,36 +0,0 @@ -{% extends "wiki/base.html" %} -{% block title %}Wiki | Revisions to {{ page }}{% endblock %} -{% block og_title %}Wiki | Revisions to {{ page }}{% endblock %} -{% block og_description %}{% endblock %} -{% block content %} - <div class="uk-container"> - <h2>Wiki page revisions</h2> - <table class="uk-table uk-table-hover"> - <thead> - <tr> - <th>Page title</th> - <th>Date</th> - <th>User ID</th> - <th>Compare before</th> - <th>Compare after</th> - </tr> - </thead> - <tbody> - {% for revision in revisions %} - <tr> - <td>{{ revision["post"]["title"] }}</td> - <td>{{ revision["pretty_time"] }}</td> - <td>{{ revision['user'] }}</td> - <td><input type="radio" id="compare-before-{{ revision['id'] }}" class="uk-radio"></td> - <td><input type="radio" id="compare-after-{{ revision['id'] }}" class="uk-radio"></td> - </tr> - {% endfor %} - </tbody> - </table> - <a href="#" id="compare-submit" class="uk-button uk-button-primary">Compare selections</a> - </div> - <script> - let revisions = {{ revisions | tojson }}; - revision_diff(revisions); - </script> -{% endblock %} diff --git a/templates/wiki/search.html b/templates/wiki/search.html deleted file mode 100644 index 8a337192..00000000 --- a/templates/wiki/search.html +++ /dev/null @@ -1,23 +0,0 @@ -{% extends "wiki/base.html" %} -{% block title %}Wiki | Search{% endblock %} -{% block og_title %}Wiki | Search{% endblock %} -{% block og_description %}Search for pages by content{% endblock %} -{% block content %} - <div class="uk-container uk-container-small"> - <h2 class="uk-title"> - Search - </h2> - - <form uk-grid class="uk-grid-small" action="{{ url_for("wiki.search") }}" method="post"> - <input type="text" class="uk-width-1-1 uk-input location-input" placeholder="Search Query" id="query" name="query" required> - <div class="uk-width-1-4"> - - </div> - <div class="uk-width-1-2"> - <input class="uk-button uk-button-primary uk-width-1-1" type="submit" id="search" value="Search" /> - </div> - - <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/> - </form> - </div> -{% endblock %}
\ No newline at end of file diff --git a/templates/wiki/search_results.html b/templates/wiki/search_results.html deleted file mode 100644 index 9b9ad946..00000000 --- a/templates/wiki/search_results.html +++ /dev/null @@ -1,39 +0,0 @@ -{% extends "wiki/base.html" %} -{% block title %}Wiki | Search Results{% endblock %} -{% block og_title %}Wiki | Search Results{% endblock %} -{% block og_description %}Search results{% endblock %} -{% block content %} - <div class="uk-container uk-container-small"> - {% if not pages %} - <h2 class="uk-title"> - Search - </h2> - <div class="uk-alert uk-alert-warning uk-text-center"> - <p> - Sorry, no results were found. Please check your query and try again. - </p> - </div> - {% else %} - <h2 class="uk-title"> - Search Results - </h2> - - {% for page in pages %} - <h4> - <a href="{{ url_for("wiki.page", page=page["slug"]) }}">{{ page.title }}</a> - (<span class="fira-code">{{ page.slug }}</span>) - </h4> - - {% for snippet in page["matches"] %} - <div class="quote"> - <i class="uk-icon far fa-ellipsis-h"></i> - <br /> - {{ snippet | safe }} - <br /> - <i class="uk-icon far fa-ellipsis-h"></i> - </div> - {% endfor %} - {% endfor %} - {% endif %} - </div> -{% endblock %}
\ No newline at end of file diff --git a/templates/wiki/special.html b/templates/wiki/special.html deleted file mode 100644 index 12e9cb18..00000000 --- a/templates/wiki/special.html +++ /dev/null @@ -1,17 +0,0 @@ -{% 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 deleted file mode 100644 index 45a641a6..00000000 --- a/templates/wiki/special_all.html +++ /dev/null @@ -1,26 +0,0 @@ -{% 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 class="fira-code">{{ page.slug }}</span>) - </a></li> - {% endfor %} - </ul> - {% endfor %} - </div> -{% endblock %}
\ No newline at end of file |