From 995095665414f1e914a7dfa707cc6b9680066632 Mon Sep 17 00:00:00 2001
From: Timur Ismagilov
Date: Tue, 1 Feb 2022 15:38:47 +0500
Subject: [PATCH] Editor: Split the toolbar into two parts
Better usage of space, actually
---
static/default.css | 9 +-
views/mutators.qtpl | 4 +-
views/mutators.qtpl.go | 276 +++++++++++++++++++++--------------------
3 files changed, 148 insertions(+), 141 deletions(-)
diff --git a/static/default.css b/static/default.css
index 5e16690..ec8014d 100644
--- a/static/default.css
+++ b/static/default.css
@@ -60,7 +60,8 @@ header { width: 100%; margin-bottom: 1rem; }
.layout { display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; margin: 0 1rem; row-gap: 1rem; }
.main-width { margin: 0; }
main { grid-column: 1 / span 1; grid-row: 1 / span 2; }
- .sibling-hyphae, .edit-toolbar, .help-topics { grid-column: 2 / span 1; grid-row: 1 / span 1; }
+ .sibling-hyphae, .markup-toolbar, .help-topics { grid-column: 2 / span 1; grid-row: 1 / span 1; }
+ .action-toolbar { grid-column: 2 / span 1; grid-row: 2 / span 1; }
.layout-card { width: 100%; }
.edit-toolbar__buttons {display: grid; }
}
@@ -73,8 +74,10 @@ header { width: 100%; margin-bottom: 1rem; }
.layout { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.layout-card {max-width: 18rem;}
.main-width { margin: 0 auto; }
- main { grid-column: 2 / span 1; }
- .sibling-hyphae, .edit-toolbar, .help-topics { grid-column: 3 / span 1; margin-left: 0; }
+ main { grid-column: 2 / span 1; grid-row: 1 / span 2; }
+ .sibling-hyphae, .markup-toolbar, .help-topics { grid-column: 3 / span 1; margin-left: 0; }
+ .markup-toolbar { grid-column: 3 / span 1; grid-row: 1 / span 2; }
+ .action-toolbar { grid-column: 1 / span 1; grid-row: 1 / span 1; }
.edit-toolbar__buttons { grid-template-columns: 1fr; }
}
diff --git a/views/mutators.qtpl b/views/mutators.qtpl
index cfb4e08..117b104 100644
--- a/views/mutators.qtpl
+++ b/views/mutators.qtpl
@@ -6,7 +6,7 @@
{% import "github.com/bouncepaw/mycorrhiza/user" %}
{% func Toolbar(u *user.User, lc *l18n.Localizer) %}
-
+
+
`)
-//line views/mutators.qtpl:72
+//line views/mutators.qtpl:74
}
-//line views/mutators.qtpl:72
+//line views/mutators.qtpl:74
func WriteToolbar(qq422016 qtio422016.Writer, u *user.User, lc *l18n.Localizer) {
-//line views/mutators.qtpl:72
+//line views/mutators.qtpl:74
qw422016 := qt422016.AcquireWriter(qq422016)
-//line views/mutators.qtpl:72
+//line views/mutators.qtpl:74
StreamToolbar(qw422016, u, lc)
-//line views/mutators.qtpl:72
+//line views/mutators.qtpl:74
qt422016.ReleaseWriter(qw422016)
-//line views/mutators.qtpl:72
+//line views/mutators.qtpl:74
}
-//line views/mutators.qtpl:72
+//line views/mutators.qtpl:74
func Toolbar(u *user.User, lc *l18n.Localizer) string {
-//line views/mutators.qtpl:72
+//line views/mutators.qtpl:74
qb422016 := qt422016.AcquireByteBuffer()
-//line views/mutators.qtpl:72
+//line views/mutators.qtpl:74
WriteToolbar(qb422016, u, lc)
-//line views/mutators.qtpl:72
+//line views/mutators.qtpl:74
qs422016 := string(qb422016.B)
-//line views/mutators.qtpl:72
+//line views/mutators.qtpl:74
qt422016.ReleaseByteBuffer(qb422016)
-//line views/mutators.qtpl:72
+//line views/mutators.qtpl:74
return qs422016
-//line views/mutators.qtpl:72
+//line views/mutators.qtpl:74
}
-//line views/mutators.qtpl:74
+//line views/mutators.qtpl:76
func StreamEditHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, textAreaFill, warning string) {
-//line views/mutators.qtpl:74
+//line views/mutators.qtpl:76
qw422016.N().S(`
`)
-//line views/mutators.qtpl:76
+//line views/mutators.qtpl:78
lc := l18n.FromRequest(rq)
-//line views/mutators.qtpl:77
+//line views/mutators.qtpl:79
qw422016.N().S(`
`)
-//line views/mutators.qtpl:80
+//line views/mutators.qtpl:82
qw422016.N().S(fmt.Sprintf(lc.Get("edit.title"), beautifulLink(hyphaName)))
-//line views/mutators.qtpl:80
+//line views/mutators.qtpl:82
qw422016.N().S(`
`)
-//line views/mutators.qtpl:81
+//line views/mutators.qtpl:83
qw422016.N().S(warning)
-//line views/mutators.qtpl:81
+//line views/mutators.qtpl:83
qw422016.N().S(`
`)
-//line views/mutators.qtpl:94
+//line views/mutators.qtpl:96
qw422016.N().S(Toolbar(user.FromRequest(rq), lc))
-//line views/mutators.qtpl:94
+//line views/mutators.qtpl:96
qw422016.N().S(`
`)
-//line views/mutators.qtpl:96
+//line views/mutators.qtpl:98
streameditScripts(qw422016)
-//line views/mutators.qtpl:96
+//line views/mutators.qtpl:98
qw422016.N().S(`
`)
-//line views/mutators.qtpl:97
+//line views/mutators.qtpl:99
}
-//line views/mutators.qtpl:97
+//line views/mutators.qtpl:99
func WriteEditHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, textAreaFill, warning string) {
-//line views/mutators.qtpl:97
+//line views/mutators.qtpl:99
qw422016 := qt422016.AcquireWriter(qq422016)
-//line views/mutators.qtpl:97
+//line views/mutators.qtpl:99
StreamEditHTML(qw422016, rq, hyphaName, textAreaFill, warning)
-//line views/mutators.qtpl:97
+//line views/mutators.qtpl:99
qt422016.ReleaseWriter(qw422016)
-//line views/mutators.qtpl:97
+//line views/mutators.qtpl:99
}
-//line views/mutators.qtpl:97
+//line views/mutators.qtpl:99
func EditHTML(rq *http.Request, hyphaName, textAreaFill, warning string) string {
-//line views/mutators.qtpl:97
+//line views/mutators.qtpl:99
qb422016 := qt422016.AcquireByteBuffer()
-//line views/mutators.qtpl:97
+//line views/mutators.qtpl:99
WriteEditHTML(qb422016, rq, hyphaName, textAreaFill, warning)
-//line views/mutators.qtpl:97
+//line views/mutators.qtpl:99
qs422016 := string(qb422016.B)
-//line views/mutators.qtpl:97
+//line views/mutators.qtpl:99
qt422016.ReleaseByteBuffer(qb422016)
-//line views/mutators.qtpl:97
+//line views/mutators.qtpl:99
return qs422016
-//line views/mutators.qtpl:97
+//line views/mutators.qtpl:99
}
-//line views/mutators.qtpl:99
+//line views/mutators.qtpl:101
func StreamPreviewHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, textAreaFill, message, warning string, renderedPage string) {
-//line views/mutators.qtpl:99
+//line views/mutators.qtpl:101
qw422016.N().S(`
`)
-//line views/mutators.qtpl:101
+//line views/mutators.qtpl:103
lc := l18n.FromRequest(rq)
-//line views/mutators.qtpl:102
+//line views/mutators.qtpl:104
qw422016.N().S(`
`)
-//line views/mutators.qtpl:123
+//line views/mutators.qtpl:125
streameditScripts(qw422016)
-//line views/mutators.qtpl:123
+//line views/mutators.qtpl:125
qw422016.N().S(`
`)
-//line views/mutators.qtpl:124
+//line views/mutators.qtpl:126
}
-//line views/mutators.qtpl:124
+//line views/mutators.qtpl:126
func WritePreviewHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, textAreaFill, message, warning string, renderedPage string) {
-//line views/mutators.qtpl:124
+//line views/mutators.qtpl:126
qw422016 := qt422016.AcquireWriter(qq422016)
-//line views/mutators.qtpl:124
+//line views/mutators.qtpl:126
StreamPreviewHTML(qw422016, rq, hyphaName, textAreaFill, message, warning, renderedPage)
-//line views/mutators.qtpl:124
+//line views/mutators.qtpl:126
qt422016.ReleaseWriter(qw422016)
-//line views/mutators.qtpl:124
+//line views/mutators.qtpl:126
}
-//line views/mutators.qtpl:124
+//line views/mutators.qtpl:126
func PreviewHTML(rq *http.Request, hyphaName, textAreaFill, message, warning string, renderedPage string) string {
-//line views/mutators.qtpl:124
+//line views/mutators.qtpl:126
qb422016 := qt422016.AcquireByteBuffer()
-//line views/mutators.qtpl:124
+//line views/mutators.qtpl:126
WritePreviewHTML(qb422016, rq, hyphaName, textAreaFill, message, warning, renderedPage)
-//line views/mutators.qtpl:124
+//line views/mutators.qtpl:126
qs422016 := string(qb422016.B)
-//line views/mutators.qtpl:124
+//line views/mutators.qtpl:126
qt422016.ReleaseByteBuffer(qb422016)
-//line views/mutators.qtpl:124
+//line views/mutators.qtpl:126
return qs422016
-//line views/mutators.qtpl:124
+//line views/mutators.qtpl:126
}
-//line views/mutators.qtpl:126
+//line views/mutators.qtpl:128
func streameditScripts(qw422016 *qt422016.Writer) {
-//line views/mutators.qtpl:126
+//line views/mutators.qtpl:128
qw422016.N().S(`
`)
-//line views/mutators.qtpl:128
+//line views/mutators.qtpl:130
for _, scriptPath := range cfg.EditScripts {
-//line views/mutators.qtpl:128
+//line views/mutators.qtpl:130
qw422016.N().S(`
`)
-//line views/mutators.qtpl:130
+//line views/mutators.qtpl:132
}
-//line views/mutators.qtpl:130
+//line views/mutators.qtpl:132
qw422016.N().S(`
`)
-//line views/mutators.qtpl:131
+//line views/mutators.qtpl:133
}
-//line views/mutators.qtpl:131
+//line views/mutators.qtpl:133
func writeeditScripts(qq422016 qtio422016.Writer) {
-//line views/mutators.qtpl:131
+//line views/mutators.qtpl:133
qw422016 := qt422016.AcquireWriter(qq422016)
-//line views/mutators.qtpl:131
+//line views/mutators.qtpl:133
streameditScripts(qw422016)
-//line views/mutators.qtpl:131
+//line views/mutators.qtpl:133
qt422016.ReleaseWriter(qw422016)
-//line views/mutators.qtpl:131
+//line views/mutators.qtpl:133
}
-//line views/mutators.qtpl:131
+//line views/mutators.qtpl:133
func editScripts() string {
-//line views/mutators.qtpl:131
+//line views/mutators.qtpl:133
qb422016 := qt422016.AcquireByteBuffer()
-//line views/mutators.qtpl:131
+//line views/mutators.qtpl:133
writeeditScripts(qb422016)
-//line views/mutators.qtpl:131
+//line views/mutators.qtpl:133
qs422016 := string(qb422016.B)
-//line views/mutators.qtpl:131
+//line views/mutators.qtpl:133
qt422016.ReleaseByteBuffer(qb422016)
-//line views/mutators.qtpl:131
+//line views/mutators.qtpl:133
return qs422016
-//line views/mutators.qtpl:131
+//line views/mutators.qtpl:133
}