diff options
| author | rubenwardy <rw@rubenwardy.com> | 2018-12-23 17:02:02 +0000 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2018-12-23 17:02:02 +0000 |
| commit | 86566bcd396a4405067d0ddf09f76cfb2e30715a (patch) | |
| tree | b675aaf1af70feb909f5f58edca1f367a00fff3e /app/templates | |
| parent | a7fcce4448798a4c35eb2ac73d3133e2b075fe42 (diff) | |
| download | cheatdb-86566bcd396a4405067d0ddf09f76cfb2e30715a.tar.xz | |
Improve markdown editor style, switch to EasyMDE, add to comment reply fields
Diffstat (limited to 'app/templates')
| -rw-r--r-- | app/templates/base.html | 7 | ||||
| -rw-r--r-- | app/templates/macros/threads.html | 2 | ||||
| -rw-r--r-- | app/templates/packages/create_edit.html | 9 | ||||
| -rw-r--r-- | app/templates/threads/new.html | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/app/templates/base.html b/app/templates/base.html index 10f8abf..4232908 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -125,6 +125,13 @@ <script src="/static/jquery.min.js"></script> <script src="/static/popper.min.js"></script> <script src="/static/bootstrap.min.js"></script> + <script src="/static/easymde.min.js"></script> + <link rel="stylesheet" type="text/css" href="/static/easymde.min.css"> + <script> + $("textarea.markdown").each(function() { + new EasyMDE({ element: this, hideIcons: ["image"] }); + }) + </script> {% block scriptextra %}{% endblock %} </body> </html> diff --git a/app/templates/macros/threads.html b/app/templates/macros/threads.html index 0f6df88..ff952f9 100644 --- a/app/templates/macros/threads.html +++ b/app/templates/macros/threads.html @@ -44,7 +44,7 @@ <form method="post" action="{{ url_for('thread_page', id=thread.id)}}" class="card-body"> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" /> - <textarea class="form-control" required maxlength=500 name="comment" placeholder="Markdown supported"></textarea><br /> + <textarea class="form-control markdown" required maxlength=500 name="comment"></textarea><br /> <input class="btn btn-primary" type="submit" value="Comment" /> </form> </div> diff --git a/app/templates/packages/create_edit.html b/app/templates/packages/create_edit.html index c90ac6c..e77fd8f 100644 --- a/app/templates/packages/create_edit.html +++ b/app/templates/packages/create_edit.html @@ -11,13 +11,6 @@ {% block scriptextra %} {{ form_scripts() }} - - <script src="/static/simplemde.min.js"></script> - <link rel="stylesheet" type="text/css" href="/static/simplemde.min.css"> - <script> - var simplemde = new SimpleMDE({ element: $("#desc")[0] }); - </script> - {% if enable_wizard %} <script src="/static/url.min.js"></script> <script src="/static/polltask.js"></script> @@ -54,7 +47,7 @@ {{ render_field(form.name, class_="pkg_meta") }} {{ render_field(form.title, class_="pkg_meta") }} {{ render_field(form.shortDesc, class_="pkg_meta") }} - {{ render_field(form.desc, class_="pkg_meta") }} + {{ render_field(form.desc, class_="pkg_meta", fieldclass="form-control markdown") }} {{ render_multiselect_field(form.tags, class_="pkg_meta") }} <div class="pkg_meta"> {{ render_field(form.license, class_="not_txp") }} diff --git a/app/templates/threads/new.html b/app/templates/threads/new.html index 10fa7c8..e460618 100644 --- a/app/templates/threads/new.html +++ b/app/templates/threads/new.html @@ -22,7 +22,7 @@ <a name="reply"></a> </div> <div class="card-body"> - {{ render_field(form.comment, label="", class_="m-0") }} + {{ render_field(form.comment, label="", class_="m-0", fieldclass="form-control markdown") }} </div> </div> </div> |
