From f54cfe44ff91ee5b7ece0ca3270e75fc09ab23b0 Mon Sep 17 00:00:00 2001 From: Timur Ismagilov Date: Mon, 9 Aug 2021 00:19:55 +0500 Subject: [PATCH] Drop the hypha tabs TODO: * Make the hotkeys work again * Compensate the lack of the tabs on other pages --- hyphae/hyphae.go | 5 + static/default.css | 89 +++++++---- views/history.qtpl | 2 - views/history.qtpl.go | 284 +++++++++++++++++----------------- views/modal.qtpl | 3 - views/modal.qtpl.go | 275 ++++++++++++++++----------------- views/mutators.qtpl | 2 - views/mutators.qtpl.go | 174 ++++++++++----------- views/nav.qtpl | 57 +++---- views/nav.qtpl.go | 287 ++++++++++++++++++---------------- views/readers.qtpl | 17 +- views/readers.qtpl.go | 341 +++++++++++++++++++++-------------------- 12 files changed, 774 insertions(+), 762 deletions(-) diff --git a/hyphae/hyphae.go b/hyphae/hyphae.go index ebd810e..6729354 100644 --- a/hyphae/hyphae.go +++ b/hyphae/hyphae.go @@ -29,6 +29,11 @@ func (h *Hypha) TextPartPath() string { return h.TextPath } +// HasAttachment is true if the hypha has an attachment. +func (h *Hypha) HasAttachment() bool { + return h.BinaryPath != "" +} + var byNames = make(map[string]*Hypha) var byNamesMutex = sync.Mutex{} diff --git a/static/default.css b/static/default.css index 3562d96..3856a49 100644 --- a/static/default.css +++ b/static/default.css @@ -22,13 +22,6 @@ .layout { display: grid; row-gap: 1rem; } header { width: 100%; margin-bottom: 1rem; } -.hypha-tabs__flex { margin: 0; padding: 0; display: flex; flex-wrap: wrap; } -.hypha-tabs__tab { list-style-type: none; } -.hypha-tabs { padding: 0; margin: 0; } -.hypha-tabs__tab { margin-right: .5rem; padding: 0; } -.hypha-tabs__link { display: inline-block; padding: .25rem; text-decoration: none; } -.hypha-tabs__selection { display: inline-block; padding: .25rem; font-weight: bold; } - .layout-card li { list-style-type: none; } .backlinks__list { padding: 0; margin: 0; } .backlinks__link { text-decoration: none; display: block; padding: .25rem; padding-left: 1.25rem; } @@ -46,16 +39,11 @@ header { width: 100%; margin-bottom: 1rem; } .non-existent-hypha__way:last-child { margin-right: 0; } } -/* No longer a phone but still small screen: draw normal tabs, center main */ +/* No longer a phone but still small screen: center main */ @media screen and (min-width: 801px) { .main-width { padding: 1rem 2rem; width: 800px; margin: 0 auto; } main { border-radius: .25rem; } .layout-card { width: 800px; margin: 0 auto; } - - .hypha-tabs { padding: 0; } - .hypha-tabs__tab { border-radius: .25rem .25rem 0 0; margin-right: 0; } - .hypha-tabs__selection, .hypha-tabs__link { padding: .25rem .5rem; } - .hypha-tabs__tab:nth-of-type(1) { margin-left: 2rem; } } @@ -208,21 +196,10 @@ table, } .transclusion_blend .transclusion__link { display: none; } -.hypha-tabs__tab { background-color: #eee; } -.hypha-tabs__tab a { color: black; } -.hypha-tabs__tab_active { border-bottom: 2px white solid; background: white; } - @media screen and (max-width: 800px) { - .hypha-tabs { background: white; padding: .5rem 0 0 .75rem; } - .hypha-tabs__tab { background-color: white; } main { padding-top: 0; } } -@media screen and (min-width: 801px) { - .hypha-tabs__tab { border: 1px #ddd solid; } - .hypha-tabs__tab_active { border-bottom: 1px white solid; } -} - .layout-card { border-radius: .25rem; background-color: white; } .layout-card__title { font-size: 1rem; margin: 0; padding: .25rem .5rem; border-radius: .25rem .25rem 0 0; } .layout-card__title { border-bottom: 1px solid #eee; } @@ -248,7 +225,7 @@ td { border: #ddd 1px solid; } /* Dark theme! */ @media (prefers-color-scheme: dark) { html { background: #222; color: #ddd; } -main, article, .hypha-tabs__tab, header, .layout-card { background-color: #343434; color: #ddd; } +main, article, header, .layout-card { background-color: #343434; color: #ddd; } a, .wikilink_external { color: #f1fa8c; } a:visited, .wikilink_external:visited { color: #ffb86c; } @@ -257,8 +234,7 @@ a:visited, .wikilink_external:visited { color: #ffb86c; } .prevnext__el, .prevnext__el:visited { color: #ddd; } -.hypha-tabs__tab a, .hypha-tabs__tab { color: #ddd; background-color: #232323; border: 0; } -.layout-card__title, .hypha-tabs__tab_active { background-color: #343434; } +.layout-card__title { background-color: #343434; } .transclusion .transclusion__link, a.shy-link { color: #ddd; } @@ -279,10 +255,6 @@ table { border: 0; background-color: #444444; color: #ddd; } .transclusion code, .transclusion .codeblock { background-color: #454545; } mark { background: rgba(130, 80, 30, 5); color: inherit; } -@media screen and (max-width: 800px) { - .hypha-tabs a, - .hypha-tabs { background-color: #343434; } -} } kbd { @@ -777,4 +749,59 @@ kbd { text-decoration: none; border: 1px solid #999; border-radius: 1rem; +} + +/* + * Buttons beside the hypha title + */ +.edit-btn { + float: right; + margin: -0.25rem 0; +} +.edit-btn__link { + display: block; + text-decoration: none; + color: inherit; +} + +.jump-btn { + float: right; + margin: -0.25rem -1rem; +} +.jump-btn__link { + text-decoration: none; + color: inherit; +} + +/* + * Hypha bottom + */ +#hypha-bottom { + clear: both; +} +.hypha-info { + display: block; +} +.hypha-info__list { + padding: 0; + margin-bottom: 0; +} +.hypha-info__entry { + display: inline; +} +.hypha-info__link { + display: inline-block; + color: #999; +} +.hypha-info__link:hover { + color: inherit; +} +.hypha-info__link:after { + content: ", "; +} +.hypha-info__entry:last-of-type a:after { + content: none; +} +.hypha-info__entry:first-of-type a:first-letter { + text-transform: uppercase; } \ No newline at end of file diff --git a/views/history.qtpl b/views/history.qtpl index 40f198a..a96fc1a 100644 --- a/views/history.qtpl +++ b/views/history.qtpl @@ -16,7 +16,6 @@ if err != nil { text = err.Error() } %} -{%= NavHTML(rq, h.Name, "history") %}
@@ -112,7 +111,6 @@ if err != nil { {% endfunc %} {% func HistoryHTML(rq *http.Request, hyphaName, list string) %} -{%= NavHTML(rq, hyphaName, "history") %}
diff --git a/views/history.qtpl.go b/views/history.qtpl.go index 833b51d..d012749 100644 --- a/views/history.qtpl.go +++ b/views/history.qtpl.go @@ -54,64 +54,59 @@ func StreamPrimitiveDiffHTML(qw422016 *qt422016.Writer, rq *http.Request, h *hyp //line views/history.qtpl:18 qw422016.N().S(` -`) -//line views/history.qtpl:19 - StreamNavHTML(qw422016, rq, h.Name, "history") -//line views/history.qtpl:19 - qw422016.N().S(`

Diff `) -//line views/history.qtpl:23 +//line views/history.qtpl:22 qw422016.E().S(util.BeautifulName(h.Name)) -//line views/history.qtpl:23 +//line views/history.qtpl:22 qw422016.N().S(` at `) -//line views/history.qtpl:23 +//line views/history.qtpl:22 qw422016.E().S(hash) -//line views/history.qtpl:23 +//line views/history.qtpl:22 qw422016.N().S(`

`)
-//line views/history.qtpl:24
+//line views/history.qtpl:23
 	qw422016.E().S(text)
-//line views/history.qtpl:24
+//line views/history.qtpl:23
 	qw422016.N().S(`
`) -//line views/history.qtpl:28 +//line views/history.qtpl:27 } -//line views/history.qtpl:28 +//line views/history.qtpl:27 func WritePrimitiveDiffHTML(qq422016 qtio422016.Writer, rq *http.Request, h *hyphae.Hypha, u *user.User, hash string) { -//line views/history.qtpl:28 +//line views/history.qtpl:27 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/history.qtpl:28 +//line views/history.qtpl:27 StreamPrimitiveDiffHTML(qw422016, rq, h, u, hash) -//line views/history.qtpl:28 +//line views/history.qtpl:27 qt422016.ReleaseWriter(qw422016) -//line views/history.qtpl:28 +//line views/history.qtpl:27 } -//line views/history.qtpl:28 +//line views/history.qtpl:27 func PrimitiveDiffHTML(rq *http.Request, h *hyphae.Hypha, u *user.User, hash string) string { -//line views/history.qtpl:28 +//line views/history.qtpl:27 qb422016 := qt422016.AcquireByteBuffer() -//line views/history.qtpl:28 +//line views/history.qtpl:27 WritePrimitiveDiffHTML(qb422016, rq, h, u, hash) -//line views/history.qtpl:28 +//line views/history.qtpl:27 qs422016 := string(qb422016.B) -//line views/history.qtpl:28 +//line views/history.qtpl:27 qt422016.ReleaseByteBuffer(qb422016) -//line views/history.qtpl:28 +//line views/history.qtpl:27 return qs422016 -//line views/history.qtpl:28 +//line views/history.qtpl:27 } -//line views/history.qtpl:30 +//line views/history.qtpl:29 func StreamRecentChangesHTML(qw422016 *qt422016.Writer, n int) { -//line views/history.qtpl:30 +//line views/history.qtpl:29 qw422016.N().S(`
@@ -120,54 +115,54 @@ func StreamRecentChangesHTML(qw422016 *qt422016.Writer, n int) { @@ -175,271 +170,266 @@ func StreamRecentChangesHTML(qw422016 *qt422016.Writer, n int) {

Subscribe via RSS, Atom or JSON feed.

`) -//line views/history.qtpl:57 +//line views/history.qtpl:56 qw422016.N().S(` `) -//line views/history.qtpl:60 +//line views/history.qtpl:59 changes := history.RecentChanges(n) var year, day int var month time.Month -//line views/history.qtpl:63 +//line views/history.qtpl:62 qw422016.N().S(`
`) -//line views/history.qtpl:65 +//line views/history.qtpl:64 if len(changes) == 0 { -//line views/history.qtpl:65 +//line views/history.qtpl:64 qw422016.N().S(`

Could not find any recent changes.

`) -//line views/history.qtpl:67 +//line views/history.qtpl:66 } else { -//line views/history.qtpl:67 +//line views/history.qtpl:66 qw422016.N().S(` `) -//line views/history.qtpl:68 +//line views/history.qtpl:67 for i, entry := range changes { -//line views/history.qtpl:68 +//line views/history.qtpl:67 qw422016.N().S(` `) -//line views/history.qtpl:70 +//line views/history.qtpl:69 y, m, d := entry.Time.UTC().Date() -//line views/history.qtpl:70 +//line views/history.qtpl:69 qw422016.N().S(` `) -//line views/history.qtpl:71 +//line views/history.qtpl:70 if d != day || m != month || y != year { -//line views/history.qtpl:71 +//line views/history.qtpl:70 qw422016.N().S(`

`) -//line views/history.qtpl:73 +//line views/history.qtpl:72 qw422016.E().S(fmt.Sprintf("%04d-%02d-%02d", y, m, d)) -//line views/history.qtpl:73 +//line views/history.qtpl:72 qw422016.N().S(`

`) -//line views/history.qtpl:75 +//line views/history.qtpl:74 year, month, day = y, m, d -//line views/history.qtpl:75 +//line views/history.qtpl:74 qw422016.N().S(` `) -//line views/history.qtpl:76 +//line views/history.qtpl:75 } -//line views/history.qtpl:76 +//line views/history.qtpl:75 qw422016.N().S(`
`) -//line views/history.qtpl:80 +//line views/history.qtpl:79 qw422016.N().S(recentChangesEntry(entry)) -//line views/history.qtpl:80 +//line views/history.qtpl:79 qw422016.N().S(`
`) -//line views/history.qtpl:83 +//line views/history.qtpl:82 } -//line views/history.qtpl:83 +//line views/history.qtpl:82 qw422016.N().S(` `) -//line views/history.qtpl:84 +//line views/history.qtpl:83 } -//line views/history.qtpl:84 +//line views/history.qtpl:83 qw422016.N().S(` `) -//line views/history.qtpl:85 +//line views/history.qtpl:84 qw422016.N().S(helpTopicBadgeHTML("en", "recent_changes")) -//line views/history.qtpl:85 +//line views/history.qtpl:84 qw422016.N().S(`
`) -//line views/history.qtpl:89 +//line views/history.qtpl:88 } -//line views/history.qtpl:89 +//line views/history.qtpl:88 func WriteRecentChangesHTML(qq422016 qtio422016.Writer, n int) { -//line views/history.qtpl:89 +//line views/history.qtpl:88 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/history.qtpl:89 +//line views/history.qtpl:88 StreamRecentChangesHTML(qw422016, n) -//line views/history.qtpl:89 +//line views/history.qtpl:88 qt422016.ReleaseWriter(qw422016) -//line views/history.qtpl:89 +//line views/history.qtpl:88 } -//line views/history.qtpl:89 +//line views/history.qtpl:88 func RecentChangesHTML(n int) string { -//line views/history.qtpl:89 +//line views/history.qtpl:88 qb422016 := qt422016.AcquireByteBuffer() -//line views/history.qtpl:89 +//line views/history.qtpl:88 WriteRecentChangesHTML(qb422016, n) -//line views/history.qtpl:89 +//line views/history.qtpl:88 qs422016 := string(qb422016.B) -//line views/history.qtpl:89 +//line views/history.qtpl:88 qt422016.ReleaseByteBuffer(qb422016) -//line views/history.qtpl:89 +//line views/history.qtpl:88 return qs422016 -//line views/history.qtpl:89 +//line views/history.qtpl:88 } -//line views/history.qtpl:91 +//line views/history.qtpl:90 func streamrecentChangesEntry(qw422016 *qt422016.Writer, rev history.Revision) { -//line views/history.qtpl:91 +//line views/history.qtpl:90 qw422016.N().S(`
`) -//line views/history.qtpl:96 +//line views/history.qtpl:95 qw422016.E().S(rev.Hash) -//line views/history.qtpl:96 +//line views/history.qtpl:95 qw422016.N().S(` `) -//line views/history.qtpl:98 +//line views/history.qtpl:97 if rev.Username != "anon" { -//line views/history.qtpl:98 +//line views/history.qtpl:97 qw422016.N().S(` `) -//line views/history.qtpl:102 +//line views/history.qtpl:101 } -//line views/history.qtpl:102 +//line views/history.qtpl:101 qw422016.N().S(`
`) -//line views/history.qtpl:106 +//line views/history.qtpl:105 qw422016.N().S(rev.HyphaeLinksHTML()) -//line views/history.qtpl:106 +//line views/history.qtpl:105 qw422016.N().S(` `) -//line views/history.qtpl:109 +//line views/history.qtpl:108 qw422016.E().S(rev.Message) -//line views/history.qtpl:109 +//line views/history.qtpl:108 qw422016.N().S(`
`) -//line views/history.qtpl:112 +//line views/history.qtpl:111 } -//line views/history.qtpl:112 +//line views/history.qtpl:111 func writerecentChangesEntry(qq422016 qtio422016.Writer, rev history.Revision) { -//line views/history.qtpl:112 +//line views/history.qtpl:111 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/history.qtpl:112 +//line views/history.qtpl:111 streamrecentChangesEntry(qw422016, rev) -//line views/history.qtpl:112 +//line views/history.qtpl:111 qt422016.ReleaseWriter(qw422016) -//line views/history.qtpl:112 +//line views/history.qtpl:111 } -//line views/history.qtpl:112 +//line views/history.qtpl:111 func recentChangesEntry(rev history.Revision) string { -//line views/history.qtpl:112 +//line views/history.qtpl:111 qb422016 := qt422016.AcquireByteBuffer() -//line views/history.qtpl:112 +//line views/history.qtpl:111 writerecentChangesEntry(qb422016, rev) -//line views/history.qtpl:112 +//line views/history.qtpl:111 qs422016 := string(qb422016.B) -//line views/history.qtpl:112 +//line views/history.qtpl:111 qt422016.ReleaseByteBuffer(qb422016) -//line views/history.qtpl:112 +//line views/history.qtpl:111 return qs422016 -//line views/history.qtpl:112 +//line views/history.qtpl:111 } -//line views/history.qtpl:114 +//line views/history.qtpl:113 func StreamHistoryHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, list string) { -//line views/history.qtpl:114 - qw422016.N().S(` -`) -//line views/history.qtpl:115 - StreamNavHTML(qw422016, rq, hyphaName, "history") -//line views/history.qtpl:115 +//line views/history.qtpl:113 qw422016.N().S(`

History of `) -//line views/history.qtpl:119 +//line views/history.qtpl:117 qw422016.E().S(util.BeautifulName(hyphaName)) -//line views/history.qtpl:119 +//line views/history.qtpl:117 qw422016.N().S(`

`) -//line views/history.qtpl:120 +//line views/history.qtpl:118 qw422016.N().S(list) -//line views/history.qtpl:120 +//line views/history.qtpl:118 qw422016.N().S(`
`) -//line views/history.qtpl:124 +//line views/history.qtpl:122 } -//line views/history.qtpl:124 +//line views/history.qtpl:122 func WriteHistoryHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, list string) { -//line views/history.qtpl:124 +//line views/history.qtpl:122 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/history.qtpl:124 +//line views/history.qtpl:122 StreamHistoryHTML(qw422016, rq, hyphaName, list) -//line views/history.qtpl:124 +//line views/history.qtpl:122 qt422016.ReleaseWriter(qw422016) -//line views/history.qtpl:124 +//line views/history.qtpl:122 } -//line views/history.qtpl:124 +//line views/history.qtpl:122 func HistoryHTML(rq *http.Request, hyphaName, list string) string { -//line views/history.qtpl:124 +//line views/history.qtpl:122 qb422016 := qt422016.AcquireByteBuffer() -//line views/history.qtpl:124 +//line views/history.qtpl:122 WriteHistoryHTML(qb422016, rq, hyphaName, list) -//line views/history.qtpl:124 +//line views/history.qtpl:122 qs422016 := string(qb422016.B) -//line views/history.qtpl:124 +//line views/history.qtpl:122 qt422016.ReleaseByteBuffer(qb422016) -//line views/history.qtpl:124 +//line views/history.qtpl:122 return qs422016 -//line views/history.qtpl:124 +//line views/history.qtpl:122 } diff --git a/views/modal.qtpl b/views/modal.qtpl index 7f28a8e..e0d4146 100644 --- a/views/modal.qtpl +++ b/views/modal.qtpl @@ -2,7 +2,6 @@ {% import "github.com/bouncepaw/mycorrhiza/util" %} {% func DeleteAskHTML(rq *http.Request, hyphaName string, isOld bool) %} -{%= NavHTML(rq, hyphaName, "delete-ask") %} {%= modalBegin( "delete-confirm", hyphaName, @@ -14,7 +13,6 @@ {% endfunc %} {% func UnattachAskHTML(rq *http.Request, hyphaName string, isOld bool) %} -{%= NavHTML(rq, hyphaName, "unattach-ask") %} {%= modalBegin( "unattach", hyphaName, @@ -25,7 +23,6 @@ {% endfunc %} {% func RenameAskHTML(rq *http.Request, hyphaName string, isOld bool) %} -{%= NavHTML(rq, hyphaName, "rename-ask") %} {%= modalBegin( "rename-confirm", hyphaName, diff --git a/views/modal.qtpl.go b/views/modal.qtpl.go index 3c6bf4b..15fab62 100644 --- a/views/modal.qtpl.go +++ b/views/modal.qtpl.go @@ -29,140 +29,125 @@ func StreamDeleteAskHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName qw422016.N().S(` `) //line views/modal.qtpl:5 - StreamNavHTML(qw422016, rq, hyphaName, "delete-ask") -//line views/modal.qtpl:5 - qw422016.N().S(` -`) -//line views/modal.qtpl:6 streammodalBegin(qw422016, "delete-confirm", hyphaName, "", "Delete "+util.BeautifulName(hyphaName)+"?") -//line views/modal.qtpl:10 +//line views/modal.qtpl:9 qw422016.N().S(` `) -//line views/modal.qtpl:11 +//line views/modal.qtpl:10 streammodalReallyWant(qw422016, hyphaName, "unattach") -//line views/modal.qtpl:11 +//line views/modal.qtpl:10 qw422016.N().S(`

In this version of Mycorrhiza Wiki you cannot undelete a deleted hypha but the history can still be accessed.

`) -//line views/modal.qtpl:13 +//line views/modal.qtpl:12 streammodalEnd(qw422016, hyphaName, true) +//line views/modal.qtpl:12 + qw422016.N().S(` +`) //line views/modal.qtpl:13 - qw422016.N().S(` -`) -//line views/modal.qtpl:14 } -//line views/modal.qtpl:14 +//line views/modal.qtpl:13 func WriteDeleteAskHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName string, isOld bool) { -//line views/modal.qtpl:14 +//line views/modal.qtpl:13 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/modal.qtpl:14 +//line views/modal.qtpl:13 StreamDeleteAskHTML(qw422016, rq, hyphaName, isOld) -//line views/modal.qtpl:14 +//line views/modal.qtpl:13 qt422016.ReleaseWriter(qw422016) -//line views/modal.qtpl:14 +//line views/modal.qtpl:13 } -//line views/modal.qtpl:14 +//line views/modal.qtpl:13 func DeleteAskHTML(rq *http.Request, hyphaName string, isOld bool) string { -//line views/modal.qtpl:14 +//line views/modal.qtpl:13 qb422016 := qt422016.AcquireByteBuffer() -//line views/modal.qtpl:14 +//line views/modal.qtpl:13 WriteDeleteAskHTML(qb422016, rq, hyphaName, isOld) -//line views/modal.qtpl:14 +//line views/modal.qtpl:13 qs422016 := string(qb422016.B) -//line views/modal.qtpl:14 +//line views/modal.qtpl:13 qt422016.ReleaseByteBuffer(qb422016) -//line views/modal.qtpl:14 +//line views/modal.qtpl:13 return qs422016 -//line views/modal.qtpl:14 +//line views/modal.qtpl:13 } -//line views/modal.qtpl:16 +//line views/modal.qtpl:15 func StreamUnattachAskHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName string, isOld bool) { +//line views/modal.qtpl:15 + qw422016.N().S(` +`) //line views/modal.qtpl:16 - qw422016.N().S(` -`) -//line views/modal.qtpl:17 - StreamNavHTML(qw422016, rq, hyphaName, "unattach-ask") -//line views/modal.qtpl:17 - qw422016.N().S(` -`) -//line views/modal.qtpl:18 streammodalBegin(qw422016, "unattach", hyphaName, "", "Unattach "+util.BeautifulName(hyphaName)+"?") +//line views/modal.qtpl:20 + qw422016.N().S(` +`) +//line views/modal.qtpl:21 + streammodalReallyWant(qw422016, hyphaName, "unattach") +//line views/modal.qtpl:21 + qw422016.N().S(` +`) +//line views/modal.qtpl:22 + streammodalEnd(qw422016, hyphaName, true) //line views/modal.qtpl:22 qw422016.N().S(` `) //line views/modal.qtpl:23 - streammodalReallyWant(qw422016, hyphaName, "unattach") +} + //line views/modal.qtpl:23 - qw422016.N().S(` -`) -//line views/modal.qtpl:24 - streammodalEnd(qw422016, hyphaName, true) -//line views/modal.qtpl:24 - qw422016.N().S(` -`) -//line views/modal.qtpl:25 -} - -//line views/modal.qtpl:25 func WriteUnattachAskHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName string, isOld bool) { -//line views/modal.qtpl:25 +//line views/modal.qtpl:23 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/modal.qtpl:25 +//line views/modal.qtpl:23 StreamUnattachAskHTML(qw422016, rq, hyphaName, isOld) -//line views/modal.qtpl:25 +//line views/modal.qtpl:23 qt422016.ReleaseWriter(qw422016) -//line views/modal.qtpl:25 +//line views/modal.qtpl:23 } -//line views/modal.qtpl:25 +//line views/modal.qtpl:23 func UnattachAskHTML(rq *http.Request, hyphaName string, isOld bool) string { -//line views/modal.qtpl:25 +//line views/modal.qtpl:23 qb422016 := qt422016.AcquireByteBuffer() -//line views/modal.qtpl:25 +//line views/modal.qtpl:23 WriteUnattachAskHTML(qb422016, rq, hyphaName, isOld) -//line views/modal.qtpl:25 +//line views/modal.qtpl:23 qs422016 := string(qb422016.B) -//line views/modal.qtpl:25 +//line views/modal.qtpl:23 qt422016.ReleaseByteBuffer(qb422016) -//line views/modal.qtpl:25 +//line views/modal.qtpl:23 return qs422016 -//line views/modal.qtpl:25 +//line views/modal.qtpl:23 } -//line views/modal.qtpl:27 +//line views/modal.qtpl:25 func StreamRenameAskHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName string, isOld bool) { -//line views/modal.qtpl:27 +//line views/modal.qtpl:25 qw422016.N().S(` `) -//line views/modal.qtpl:28 - StreamNavHTML(qw422016, rq, hyphaName, "rename-ask") -//line views/modal.qtpl:28 - qw422016.N().S(` -`) -//line views/modal.qtpl:29 +//line views/modal.qtpl:26 streammodalBegin(qw422016, "rename-confirm", hyphaName, ` method="post" enctype="multipart/form-data"`, "Rename "+util.BeautifulName(hyphaName)) -//line views/modal.qtpl:33 +//line views/modal.qtpl:30 qw422016.N().S(` @@ -170,186 +155,186 @@ func StreamRenameAskHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName

If you rename this hypha, all incoming links and all relative outcoming links will break. You will also lose all history for the new name. Rename carefully.

`) -//line views/modal.qtpl:41 +//line views/modal.qtpl:38 streammodalEnd(qw422016, hyphaName, false) -//line views/modal.qtpl:41 +//line views/modal.qtpl:38 qw422016.N().S(` `) -//line views/modal.qtpl:42 +//line views/modal.qtpl:39 } -//line views/modal.qtpl:42 +//line views/modal.qtpl:39 func WriteRenameAskHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName string, isOld bool) { -//line views/modal.qtpl:42 +//line views/modal.qtpl:39 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/modal.qtpl:42 +//line views/modal.qtpl:39 StreamRenameAskHTML(qw422016, rq, hyphaName, isOld) -//line views/modal.qtpl:42 +//line views/modal.qtpl:39 qt422016.ReleaseWriter(qw422016) -//line views/modal.qtpl:42 +//line views/modal.qtpl:39 } -//line views/modal.qtpl:42 +//line views/modal.qtpl:39 func RenameAskHTML(rq *http.Request, hyphaName string, isOld bool) string { -//line views/modal.qtpl:42 +//line views/modal.qtpl:39 qb422016 := qt422016.AcquireByteBuffer() -//line views/modal.qtpl:42 +//line views/modal.qtpl:39 WriteRenameAskHTML(qb422016, rq, hyphaName, isOld) -//line views/modal.qtpl:42 +//line views/modal.qtpl:39 qs422016 := string(qb422016.B) -//line views/modal.qtpl:42 +//line views/modal.qtpl:39 qt422016.ReleaseByteBuffer(qb422016) -//line views/modal.qtpl:42 +//line views/modal.qtpl:39 return qs422016 -//line views/modal.qtpl:42 +//line views/modal.qtpl:39 } -//line views/modal.qtpl:44 +//line views/modal.qtpl:41 func streammodalReallyWant(qw422016 *qt422016.Writer, hyphaName, verb string) { -//line views/modal.qtpl:44 +//line views/modal.qtpl:41 qw422016.N().S(` `) -//line views/modal.qtpl:46 +//line views/modal.qtpl:43 } -//line views/modal.qtpl:46 +//line views/modal.qtpl:43 func writemodalReallyWant(qq422016 qtio422016.Writer, hyphaName, verb string) { -//line views/modal.qtpl:46 +//line views/modal.qtpl:43 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/modal.qtpl:46 +//line views/modal.qtpl:43 streammodalReallyWant(qw422016, hyphaName, verb) -//line views/modal.qtpl:46 +//line views/modal.qtpl:43 qt422016.ReleaseWriter(qw422016) -//line views/modal.qtpl:46 +//line views/modal.qtpl:43 } -//line views/modal.qtpl:46 +//line views/modal.qtpl:43 func modalReallyWant(hyphaName, verb string) string { -//line views/modal.qtpl:46 +//line views/modal.qtpl:43 qb422016 := qt422016.AcquireByteBuffer() -//line views/modal.qtpl:46 +//line views/modal.qtpl:43 writemodalReallyWant(qb422016, hyphaName, verb) -//line views/modal.qtpl:46 +//line views/modal.qtpl:43 qs422016 := string(qb422016.B) -//line views/modal.qtpl:46 +//line views/modal.qtpl:43 qt422016.ReleaseByteBuffer(qb422016) -//line views/modal.qtpl:46 +//line views/modal.qtpl:43 return qs422016 -//line views/modal.qtpl:46 +//line views/modal.qtpl:43 } -//line views/modal.qtpl:48 +//line views/modal.qtpl:45 func streammodalBegin(qw422016 *qt422016.Writer, path, hyphaName, formAttrs, legend string) { -//line views/modal.qtpl:48 +//line views/modal.qtpl:45 qw422016.N().S(`
`) -//line views/modal.qtpl:63 +//line views/modal.qtpl:60 } -//line views/modal.qtpl:63 +//line views/modal.qtpl:60 func writemodalEnd(qq422016 qtio422016.Writer, hyphaName string, shouldFocusOnConfirm bool) { -//line views/modal.qtpl:63 +//line views/modal.qtpl:60 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/modal.qtpl:63 +//line views/modal.qtpl:60 streammodalEnd(qw422016, hyphaName, shouldFocusOnConfirm) -//line views/modal.qtpl:63 +//line views/modal.qtpl:60 qt422016.ReleaseWriter(qw422016) -//line views/modal.qtpl:63 +//line views/modal.qtpl:60 } -//line views/modal.qtpl:63 +//line views/modal.qtpl:60 func modalEnd(hyphaName string, shouldFocusOnConfirm bool) string { -//line views/modal.qtpl:63 +//line views/modal.qtpl:60 qb422016 := qt422016.AcquireByteBuffer() -//line views/modal.qtpl:63 +//line views/modal.qtpl:60 writemodalEnd(qb422016, hyphaName, shouldFocusOnConfirm) -//line views/modal.qtpl:63 +//line views/modal.qtpl:60 qs422016 := string(qb422016.B) -//line views/modal.qtpl:63 +//line views/modal.qtpl:60 qt422016.ReleaseByteBuffer(qb422016) -//line views/modal.qtpl:63 +//line views/modal.qtpl:60 return qs422016 -//line views/modal.qtpl:63 +//line views/modal.qtpl:60 } diff --git a/views/mutators.qtpl b/views/mutators.qtpl index f4e2b59..d9274f1 100644 --- a/views/mutators.qtpl +++ b/views/mutators.qtpl @@ -70,7 +70,6 @@ {% endfunc %} {% func EditHTML(rq *http.Request, hyphaName, textAreaFill, warning string) %} -{%s= NavHTML(rq, hyphaName, "edit") %}

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

@@ -93,7 +92,6 @@ {% endfunc %} {% func PreviewHTML(rq *http.Request, hyphaName, textAreaFill, message, warning string, renderedPage string) %} -{%s= NavHTML(rq, hyphaName, "edit") %}

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

diff --git a/views/mutators.qtpl.go b/views/mutators.qtpl.go index dcf7226..aef0082 100644 --- a/views/mutators.qtpl.go +++ b/views/mutators.qtpl.go @@ -177,33 +177,28 @@ func Toolbar(u *user.User) string { func StreamEditHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, textAreaFill, warning string) { //line views/mutators.qtpl:72 qw422016.N().S(` -`) -//line views/mutators.qtpl:73 - qw422016.N().S(NavHTML(rq, hyphaName, "edit")) -//line views/mutators.qtpl:73 - qw422016.N().S(`

Edit `) -//line views/mutators.qtpl:76 +//line views/mutators.qtpl:75 qw422016.E().S(util.BeautifulName(hyphaName)) -//line views/mutators.qtpl:76 +//line views/mutators.qtpl:75 qw422016.N().S(`

`) -//line views/mutators.qtpl:77 +//line views/mutators.qtpl:76 qw422016.N().S(warning) -//line views/mutators.qtpl:77 +//line views/mutators.qtpl:76 qw422016.N().S(`



@@ -212,195 +207,190 @@ func StreamEditHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, text Cancel
`) -//line views/mutators.qtpl:90 +//line views/mutators.qtpl:89 qw422016.N().S(Toolbar(user.FromRequest(rq))) -//line views/mutators.qtpl:90 +//line views/mutators.qtpl:89 qw422016.N().S(`
`) -//line views/mutators.qtpl:92 +//line views/mutators.qtpl:91 streameditScripts(qw422016) +//line views/mutators.qtpl:91 + qw422016.N().S(` +`) //line views/mutators.qtpl:92 - qw422016.N().S(` -`) -//line views/mutators.qtpl:93 } -//line views/mutators.qtpl:93 +//line views/mutators.qtpl:92 func WriteEditHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, textAreaFill, warning string) { -//line views/mutators.qtpl:93 +//line views/mutators.qtpl:92 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/mutators.qtpl:93 +//line views/mutators.qtpl:92 StreamEditHTML(qw422016, rq, hyphaName, textAreaFill, warning) -//line views/mutators.qtpl:93 +//line views/mutators.qtpl:92 qt422016.ReleaseWriter(qw422016) -//line views/mutators.qtpl:93 +//line views/mutators.qtpl:92 } -//line views/mutators.qtpl:93 +//line views/mutators.qtpl:92 func EditHTML(rq *http.Request, hyphaName, textAreaFill, warning string) string { -//line views/mutators.qtpl:93 +//line views/mutators.qtpl:92 qb422016 := qt422016.AcquireByteBuffer() -//line views/mutators.qtpl:93 +//line views/mutators.qtpl:92 WriteEditHTML(qb422016, rq, hyphaName, textAreaFill, warning) -//line views/mutators.qtpl:93 +//line views/mutators.qtpl:92 qs422016 := string(qb422016.B) -//line views/mutators.qtpl:93 +//line views/mutators.qtpl:92 qt422016.ReleaseByteBuffer(qb422016) -//line views/mutators.qtpl:93 +//line views/mutators.qtpl:92 return qs422016 -//line views/mutators.qtpl:93 +//line views/mutators.qtpl:92 } -//line views/mutators.qtpl:95 +//line views/mutators.qtpl:94 func StreamPreviewHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, textAreaFill, message, warning string, renderedPage string) { -//line views/mutators.qtpl:95 - qw422016.N().S(` -`) -//line views/mutators.qtpl:96 - qw422016.N().S(NavHTML(rq, hyphaName, "edit")) -//line views/mutators.qtpl:96 +//line views/mutators.qtpl:94 qw422016.N().S(`

Edit `) -//line views/mutators.qtpl:99 +//line views/mutators.qtpl:97 qw422016.E().S(util.BeautifulName(hyphaName)) -//line views/mutators.qtpl:99 +//line views/mutators.qtpl:97 qw422016.N().S(`

`) -//line views/mutators.qtpl:100 +//line views/mutators.qtpl:98 qw422016.N().S(warning) -//line views/mutators.qtpl:100 +//line views/mutators.qtpl:98 qw422016.N().S(`





Cancel

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

`) -//line views/mutators.qtpl:113 +//line views/mutators.qtpl:111 qw422016.N().S(renderedPage) -//line views/mutators.qtpl:113 +//line views/mutators.qtpl:111 qw422016.N().S(`
`) -//line views/mutators.qtpl:115 +//line views/mutators.qtpl:113 qw422016.N().S(Toolbar(user.FromRequest(rq))) -//line views/mutators.qtpl:115 +//line views/mutators.qtpl:113 qw422016.N().S(`
`) -//line views/mutators.qtpl:117 +//line views/mutators.qtpl:115 streameditScripts(qw422016) -//line views/mutators.qtpl:117 +//line views/mutators.qtpl:115 qw422016.N().S(` `) -//line views/mutators.qtpl:118 +//line views/mutators.qtpl:116 } -//line views/mutators.qtpl:118 +//line views/mutators.qtpl:116 func WritePreviewHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, textAreaFill, message, warning string, renderedPage string) { -//line views/mutators.qtpl:118 +//line views/mutators.qtpl:116 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/mutators.qtpl:118 +//line views/mutators.qtpl:116 StreamPreviewHTML(qw422016, rq, hyphaName, textAreaFill, message, warning, renderedPage) -//line views/mutators.qtpl:118 +//line views/mutators.qtpl:116 qt422016.ReleaseWriter(qw422016) -//line views/mutators.qtpl:118 +//line views/mutators.qtpl:116 } -//line views/mutators.qtpl:118 +//line views/mutators.qtpl:116 func PreviewHTML(rq *http.Request, hyphaName, textAreaFill, message, warning string, renderedPage string) string { -//line views/mutators.qtpl:118 +//line views/mutators.qtpl:116 qb422016 := qt422016.AcquireByteBuffer() -//line views/mutators.qtpl:118 +//line views/mutators.qtpl:116 WritePreviewHTML(qb422016, rq, hyphaName, textAreaFill, message, warning, renderedPage) -//line views/mutators.qtpl:118 +//line views/mutators.qtpl:116 qs422016 := string(qb422016.B) -//line views/mutators.qtpl:118 +//line views/mutators.qtpl:116 qt422016.ReleaseByteBuffer(qb422016) -//line views/mutators.qtpl:118 +//line views/mutators.qtpl:116 return qs422016 -//line views/mutators.qtpl:118 +//line views/mutators.qtpl:116 } -//line views/mutators.qtpl:120 +//line views/mutators.qtpl:118 func streameditScripts(qw422016 *qt422016.Writer) { -//line views/mutators.qtpl:120 +//line views/mutators.qtpl:118 qw422016.N().S(` `) -//line views/mutators.qtpl:122 +//line views/mutators.qtpl:120 for _, scriptPath := range cfg.EditScripts { -//line views/mutators.qtpl:122 +//line views/mutators.qtpl:120 qw422016.N().S(` `) -//line views/mutators.qtpl:124 +//line views/mutators.qtpl:122 } -//line views/mutators.qtpl:124 +//line views/mutators.qtpl:122 qw422016.N().S(` `) -//line views/mutators.qtpl:125 +//line views/mutators.qtpl:123 } -//line views/mutators.qtpl:125 +//line views/mutators.qtpl:123 func writeeditScripts(qq422016 qtio422016.Writer) { -//line views/mutators.qtpl:125 +//line views/mutators.qtpl:123 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/mutators.qtpl:125 +//line views/mutators.qtpl:123 streameditScripts(qw422016) -//line views/mutators.qtpl:125 +//line views/mutators.qtpl:123 qt422016.ReleaseWriter(qw422016) -//line views/mutators.qtpl:125 +//line views/mutators.qtpl:123 } -//line views/mutators.qtpl:125 +//line views/mutators.qtpl:123 func editScripts() string { -//line views/mutators.qtpl:125 +//line views/mutators.qtpl:123 qb422016 := qt422016.AcquireByteBuffer() -//line views/mutators.qtpl:125 +//line views/mutators.qtpl:123 writeeditScripts(qb422016) -//line views/mutators.qtpl:125 +//line views/mutators.qtpl:123 qs422016 := string(qb422016.B) -//line views/mutators.qtpl:125 +//line views/mutators.qtpl:123 qt422016.ReleaseByteBuffer(qb422016) -//line views/mutators.qtpl:125 +//line views/mutators.qtpl:123 return qs422016 -//line views/mutators.qtpl:125 +//line views/mutators.qtpl:123 } diff --git a/views/nav.qtpl b/views/nav.qtpl index 8cbc5ed..e295c94 100644 --- a/views/nav.qtpl +++ b/views/nav.qtpl @@ -1,48 +1,29 @@ {% import "net/http" %} {% import "strings" %} {% import "github.com/bouncepaw/mycorrhiza/user" %} +{% import "github.com/bouncepaw/mycorrhiza/hyphae" %} -This is the