diff options
Diffstat (limited to 'templates/wiki')
-rw-r--r-- | templates/wiki/compare_revision.html | 13 | ||||
-rw-r--r-- | templates/wiki/page_edit.html | 20 | ||||
-rw-r--r-- | templates/wiki/page_in_use.html | 13 | ||||
-rw-r--r-- | templates/wiki/revision_list.html | 36 |
4 files changed, 81 insertions, 1 deletions
diff --git a/templates/wiki/compare_revision.html b/templates/wiki/compare_revision.html new file mode 100644 index 00000000..34ab61bc --- /dev/null +++ b/templates/wiki/compare_revision.html @@ -0,0 +1,13 @@ +{% 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_edit.html b/templates/wiki/page_edit.html index b59a8912..a2d709e2 100644 --- a/templates/wiki/page_edit.html +++ b/templates/wiki/page_edit.html @@ -99,5 +99,23 @@ document.getElementById("title").oninput = function() { document.getElementById("preview-title").textContent = document.getElementById("title").value; } + + 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 %}
\ No newline at end of file +{% endblock %} diff --git a/templates/wiki/page_in_use.html b/templates/wiki/page_in_use.html new file mode 100644 index 00000000..4110ee17 --- /dev/null +++ b/templates/wiki/page_in_use.html @@ -0,0 +1,13 @@ +{% 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"> + <a class="uk-alert-close" uk-close></a> + <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/revision_list.html b/templates/wiki/revision_list.html new file mode 100644 index 00000000..6eb5b6a8 --- /dev/null +++ b/templates/wiki/revision_list.html @@ -0,0 +1,36 @@ +{% 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 }} + </script> + <script src="{{ static_file("js/revision_diff.js") }}"></script> +{% endblock %} |