From d3ad2503aeaa71dce507293dadc4b70a7ff2899e Mon Sep 17 00:00:00 2001 From: Nathan Yam Date: Sun, 14 May 2017 14:55:40 +1000 Subject: [PATCH] Add markdown editor macro --- nyaa/templates/_formhelpers.html | 24 ++++++++++++++++++++++++ nyaa/templates/upload.html | 1 + 2 files changed, 25 insertions(+) diff --git a/nyaa/templates/_formhelpers.html b/nyaa/templates/_formhelpers.html index a0e00ea..5e29a43 100644 --- a/nyaa/templates/_formhelpers.html +++ b/nyaa/templates/_formhelpers.html @@ -24,6 +24,30 @@ {% endmacro %} + +{% macro render_markdown_editor(field, field_name='') %} +{% if field.errors %} +
+{% else %} +
+{% endif %} +
+ +
+
+ {{ render_field(field, class_='form-control markdown-source') }} +
+
+
+
+
+
+{% endmacro %} + + {% macro render_upload(field) %} {% if field.errors %}
diff --git a/nyaa/templates/upload.html b/nyaa/templates/upload.html index 25cbb78..feeb59d 100644 --- a/nyaa/templates/upload.html +++ b/nyaa/templates/upload.html @@ -3,6 +3,7 @@ {% block body %} {% from "_formhelpers.html" import render_field %} {% from "_formhelpers.html" import render_upload %} +{% from "_formhelpers.html" import render_markdown_editor %}

Upload Torrent