From 26099e7ddabb5b5709b311dafd15583cd90588e1 Mon Sep 17 00:00:00 2001 From: handlerug Date: Sun, 20 Jun 2021 12:56:19 +0700 Subject: [PATCH] Sync edit and preview templates and fix some bugs --- static/default.css | 1 - views/mutators.qtpl | 14 +++++++------- views/mutators.qtpl.go | 14 +++++++------- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/static/default.css b/static/default.css index b83d0ad..edd168e 100644 --- a/static/default.css +++ b/static/default.css @@ -117,7 +117,6 @@ textarea {font-size:16px; font-family: 'PT Sans', 'Liberation Sans', sans-serif; .edit__preview { border: 2px dashed #ddd; } .edit-form { height: calc(100vh - 12rem); } .edit-form__textarea { width: 100%; height: calc(100% - 8rem); min-height: 4rem; } -.edit-form label { font-style: italic; } .edit-form__message { width: 100%; margin: 0.25em 0; } .edit-form__save { font-weight: bold; } .edit-toolbar__buttons, .edit-toolbar__ad { margin: .5rem; } diff --git a/views/mutators.qtpl b/views/mutators.qtpl index 0d0cc1a..9c9dd90 100644 --- a/views/mutators.qtpl +++ b/views/mutators.qtpl @@ -95,20 +95,20 @@ {%s= NavHTML(rq, hyphaName, "edit") %}
-

Edit {%s util.BeautifulName(hyphaName) %} (preview)

+

Edit {%s util.BeautifulName(hyphaName) %}

{%s= warning %}
- +

- +


- - + + Cancel
-

Note that the hypha is not saved yet. You can preview the changes ↓

+

Note that the hypha hasn't been saved yet. Here's the preview:

{%s= renderedPage %}
{%s= Toolbar(user.FromRequest(rq)) %} @@ -120,4 +120,4 @@ {% for _, scriptPath := range cfg.EditScripts %} {% endfor %} -{% endfunc %} \ No newline at end of file +{% endfunc %} diff --git a/views/mutators.qtpl.go b/views/mutators.qtpl.go index 3bd9981..fa1ccfb 100644 --- a/views/mutators.qtpl.go +++ b/views/mutators.qtpl.go @@ -269,11 +269,11 @@ func StreamPreviewHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, t qw422016.N().S(`
-

Edit `) +

Edit `) //line views/mutators.qtpl:98 qw422016.E().S(util.BeautifulName(hyphaName)) //line views/mutators.qtpl:98 - qw422016.N().S(` (preview)

+ qw422016.N().S(` `) //line views/mutators.qtpl:99 qw422016.N().S(warning) @@ -285,28 +285,28 @@ func StreamPreviewHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, t qw422016.E().S(hyphaName) //line views/mutators.qtpl:101 qw422016.N().S(`"> -

- +


- - + + Cancel -

Note that the hypha is not saved yet. You can preview the changes ↓

+

Note that the hypha hasn't been saved yet. Here's the preview:

`) //line views/mutators.qtpl:112 qw422016.N().S(renderedPage)