aboutsummaryrefslogtreecommitdiffstats
path: root/templates/wiki/page_edit.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/wiki/page_edit.html')
-rw-r--r--templates/wiki/page_edit.html58
1 files changed, 31 insertions, 27 deletions
diff --git a/templates/wiki/page_edit.html b/templates/wiki/page_edit.html
index e83676fd..7610be34 100644
--- a/templates/wiki/page_edit.html
+++ b/templates/wiki/page_edit.html
@@ -1,35 +1,33 @@
-{% extends "main/base.html" %}
-{% block title %}Wiki | Home{% endblock %}
-{% block og_title %}Wiki | Home{% endblock %}
+{% 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 extra_head %}
<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>
-
- <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
- </form>
-
- <h2 class="uk-h2">Preview</h2>
-
- <div id="preview-div">
- <p>Preview will appear here.</p>
+ <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: 15rem;">{{ rst }}</div>
+ <input type="hidden" name="rst" id="rst" />
+ </div>
+
+ <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
+ </form>
+
+ <h2>Preview</h2>
+
+ <div class="uk-alert preview-div" style="padding: 1rem 1rem 0.1rem;">
+ {{ preview | safe }}
</div>
<script type="application/javascript">
@@ -67,12 +65,18 @@
return false;
};
- let editor = ace.edit("rst");
+ 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("rst").value = editor.getValue();
+
if (timer !== undefined) {
clearTimeout(timer);
}