diff options
author | 2018-04-07 15:02:35 +0100 | |
---|---|---|
committer | 2018-04-07 15:02:35 +0100 | |
commit | c4e683fff11c3c1bd33c95c1f741eb0c76fd99b2 (patch) | |
tree | e3abdf698a0f7e3e58a5df129ca7f90ba16f0541 /templates/wiki | |
parent | Fix stupid error (diff) |
Considerable progress on the wiki
Diffstat (limited to 'templates/wiki')
-rw-r--r-- | templates/wiki/base.html | 71 | ||||
-rw-r--r-- | templates/wiki/index.html | 4 | ||||
-rw-r--r-- | templates/wiki/page_edit.html | 46 | ||||
-rw-r--r-- | templates/wiki/page_missing.html | 11 | ||||
-rw-r--r-- | templates/wiki/page_view.html | 12 |
5 files changed, 102 insertions, 42 deletions
diff --git a/templates/wiki/base.html b/templates/wiki/base.html new file mode 100644 index 00000000..32d58341 --- /dev/null +++ b/templates/wiki/base.html @@ -0,0 +1,71 @@ +<!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 defer src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script> + <script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.39/js/uikit.min.js"></script> + <link rel="shortcut icon" href="{{ static_file('favicon.ico') }}"> + <link rel="stylesheet" href="{{ static_file('uikit_blurple.css') }}"/> + <link rel="stylesheet" href="{{ static_file('style.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="page-{{ current_page }}"> + <div class="uk-offcanvas-content"> + {% include "main/navigation.html" %} + <div class="uk-flex uk-flex-row" style="height: 100%;"> + <div class="uk-card uk-card-body uk-flex-left uk-flex"> + <ul class="uk-nav-default uk-nav-parent-icon" uk-nav> + <li class="uk-active"><a href="#">Placeholder</a></li> + <li class="uk-parent"> + <a href="#">Parent</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-parent"> + <a href="#">Parent</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-header">Header</li> + <li><a href="#"><span class="uk-margin-small-right" uk-icon="icon: table"></span> Item</a></li> + <li><a href="#"><span class="uk-margin-small-right" uk-icon="icon: thumbnails"></span> Item</a></li> + <li class="uk-nav-divider"></li> + <li><a href="#"><span class="uk-margin-small-right" uk-icon="icon: trash"></span> Item</a></li> + </ul> + </div> + <div class="uk-section" style="flex-grow: 1; margin: 0 1rem 1rem;"> + {% block content %}{% endblock %} + </div> + </div> + </div> + + <footer> + <div class="uk-section uk-section-secondary uk-container-medium uk-text-meta"> + <div class="uk-text-center"> + <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://github.com/discord-python/site">GitHub</a>. + </p> + </div> + </div> + </footer> + + <script src='{{ static_file('js/countdown.js') }}'></script> + </body> +</html> diff --git a/templates/wiki/index.html b/templates/wiki/index.html index 5601cbbf..27e94d61 100644 --- a/templates/wiki/index.html +++ b/templates/wiki/index.html @@ -1,11 +1,9 @@ -{% extends "main/base.html" %} +{% extends "wiki/base.html" %} {% block title %}Wiki | Home{% endblock %} {% block og_title %}Wiki | Home{% endblock %} {% block og_description %}Landing page for the wiki{% endblock %} {% block content %} - <div class="uk-container uk-section"> <h1 class="uk-title uk-text-center"> Placeholder text. </h1> - </div> {% endblock %}
\ No newline at end of file diff --git a/templates/wiki/page_edit.html b/templates/wiki/page_edit.html index e83676fd..37aadc13 100644 --- a/templates/wiki/page_edit.html +++ b/templates/wiki/page_edit.html @@ -1,4 +1,4 @@ -{% extends "main/base.html" %} +{% extends "wiki/base.html" %} {% block title %}Wiki | Home{% endblock %} {% block og_title %}Wiki | Home{% endblock %} {% block og_description %}Landing page for the wiki{% endblock %} @@ -6,30 +6,28 @@ <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.3.3/ace.js" type="application/javascript"></script> {% endblock %} {% block content %} - <div class="uk-container uk-section"> - <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" /> - </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"> - <button class="uk-button uk-button-primary" type="submit" value="Save">Save</button> - </div> - <div class="uk-width-1-1"> -{# <label for="rst">Document: </label>#} - <div id="rst" class="uk-textarea" style="resize: vertical; min-height: 10rem;">{{ rst }}</div> - </div> + <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" /> + </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" value="Save" /> + </div> + <div class="uk-width-1-1"> + <div id="editor" class="uk-textarea" style="resize: vertical; min-height: 10rem;">{{ rst }}</div> + <input type="hidden" name="rst" id="rst" /> + </div> - <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/> - </form> + <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/> + </form> - <h2 class="uk-h2">Preview</h2> + <h2 class="uk-h2">Preview</h2> - <div id="preview-div"> - <p>Preview will appear here.</p> - </div> + <div id="preview-div"> + <p>Preview will appear here.</p> </div> <script type="application/javascript"> @@ -67,12 +65,14 @@ return false; }; - let editor = ace.edit("rst"); + let editor = ace.edit("editor"); let timer; editor.session.setMode("ace/mode/rst"); editor.setTheme("ace/theme/iplastic"); editor.on("input", function() { + document.getElementById("rst").value = editor.getValue(); + if (timer !== undefined) { clearTimeout(timer); } diff --git a/templates/wiki/page_missing.html b/templates/wiki/page_missing.html deleted file mode 100644 index 5601cbbf..00000000 --- a/templates/wiki/page_missing.html +++ /dev/null @@ -1,11 +0,0 @@ -{% extends "main/base.html" %} -{% block title %}Wiki | Home{% endblock %} -{% block og_title %}Wiki | Home{% endblock %} -{% block og_description %}Landing page for the wiki{% endblock %} -{% block content %} - <div class="uk-container uk-section"> - <h1 class="uk-title uk-text-center"> - Placeholder text. - </h1> - </div> -{% endblock %}
\ No newline at end of file diff --git a/templates/wiki/page_view.html b/templates/wiki/page_view.html index 5601cbbf..98c6f4cd 100644 --- a/templates/wiki/page_view.html +++ b/templates/wiki/page_view.html @@ -1,11 +1,13 @@ -{% extends "main/base.html" %} +{% extends "wiki/base.html" %} {% block title %}Wiki | Home{% endblock %} {% block og_title %}Wiki | Home{% endblock %} {% block og_description %}Landing page for the wiki{% endblock %} {% block content %} - <div class="uk-container uk-section"> - <h1 class="uk-title uk-text-center"> - Placeholder text. - </h1> + <div class="uk-container uk-container-small"> + <h2 class="uk-title"> + {{ data["title"] }} + </h2> + + {{ data["html"] | safe }} </div> {% endblock %}
\ No newline at end of file |