diff --git a/assets/assets.qtpl.go b/assets/assets.qtpl.go index 83a3131..1b8fd71 100644 --- a/assets/assets.qtpl.go +++ b/assets/assets.qtpl.go @@ -23,7 +23,11 @@ func StreamDefaultCSS(qw422016 *qt422016.Writer) { qw422016.N().S(` `) //line assets/assets.qtpl:2 - qw422016.N().S(`.modal__title { font-size: 2rem; } + qw422016.N().S(`.amnt-grid { display: grid; grid-template-columns: 1fr 1fr; } +.upload-binary__input { display: block; margin: .25rem 0; } + +.modal__title { font-size: 2rem; } +.modal__title_small { font-size: 1.5rem; } .modal__confirmation-msg { margin: 0 0 .5rem 0; } .modal__action { display: inline-block; font-size: 1rem; padding: .25rem; border-radius: .25rem; } .modal__submit { border: 1px #999 solid; } @@ -56,6 +60,7 @@ header { width: 100%; margin-bottom: 1rem; } .backlinks__link { text-decoration: none; display: block; padding: .25rem; padding-left: 1.25rem; } @media screen and (max-width: 800px) { + .amnt-grid { grid-template-columns: 1fr; } .layout { grid-template-column: auto; grid-template-row: auto auto auto; } .main-width { width: 100%; } main { padding: 1rem; margin: 0; } diff --git a/assets/default.css b/assets/default.css index bc4f3e1..d785cfc 100644 --- a/assets/default.css +++ b/assets/default.css @@ -1,4 +1,8 @@ +.amnt-grid { display: grid; grid-template-columns: 1fr 1fr; } +.upload-binary__input { display: block; margin: .25rem 0; } + .modal__title { font-size: 2rem; } +.modal__title_small { font-size: 1.5rem; } .modal__confirmation-msg { margin: 0 0 .5rem 0; } .modal__action { display: inline-block; font-size: 1rem; padding: .25rem; border-radius: .25rem; } .modal__submit { border: 1px #999 solid; } @@ -31,6 +35,7 @@ header { width: 100%; margin-bottom: 1rem; } .backlinks__link { text-decoration: none; display: block; padding: .25rem; padding-left: 1.25rem; } @media screen and (max-width: 800px) { + .amnt-grid { grid-template-columns: 1fr; } .layout { grid-template-column: auto; grid-template-row: auto auto auto; } .main-width { width: 100%; } main { padding: 1rem; margin: 0; } diff --git a/http_readers.go b/http_readers.go index b7711c6..a75b682 100644 --- a/http_readers.go +++ b/http_readers.go @@ -24,6 +24,21 @@ func init() { http.HandleFunc("/text/", handlerText) http.HandleFunc("/binary/", handlerBinary) http.HandleFunc("/rev/", handlerRevision) + http.HandleFunc("/attachment/", handlerAttachment) +} + +func handlerAttachment(w http.ResponseWriter, rq *http.Request) { + log.Println(rq.URL) + var ( + hyphaName = HyphaNameFromRq(rq, "attachment") + h = hyphae.ByName(hyphaName) + u = user.FromRequest(rq) + ) + util.HTTP200Page(w, + views.BaseHTML( + fmt.Sprintf("Attachment of %s", util.BeautifulName(hyphaName)), + views.AttachmentMenuHTML(rq, h, u), + u)) } // handlerRevision displays a specific revision of text part a page diff --git a/main.go b/main.go index ba4ce5b..f8780b1 100644 --- a/main.go +++ b/main.go @@ -178,7 +178,7 @@ func main() { // See http_admin.go for /admin, /admin/* initAdmin() - // See http_readers.go for /page/, /hypha/, /text/, /binary/ + // See http_readers.go for /page/, /hypha/, /text/, /binary/, /attachment/ // See http_mutators.go for /upload-binary/, /upload-text/, /edit/, /delete-ask/, /delete-confirm/, /rename-ask/, /rename-confirm/, /unattach-ask/, /unattach-confirm/ // See http_auth.go for /login, /login-data, /logout, /logout-confirm // See http_history.go for /history/, /recent-changes diff --git a/views/modal.qtpl b/views/modal.qtpl index 8ca4ec6..bb1a559 100644 --- a/views/modal.qtpl +++ b/views/modal.qtpl @@ -16,7 +16,7 @@ {% func UnattachAskHTML(rq *http.Request, hyphaName string, isOld bool) %} {%= NavHTML(rq, hyphaName, "unattach-ask") %} {%= modalBegin( - "unattach-confirm", + "unattach", hyphaName, "", "Unattach "+util.BeautifulName(hyphaName)+"?") %} diff --git a/views/modal.qtpl.go b/views/modal.qtpl.go index 9e81e54..3efb837 100644 --- a/views/modal.qtpl.go +++ b/views/modal.qtpl.go @@ -94,7 +94,7 @@ func StreamUnattachAskHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaNam `) //line views/modal.qtpl:18 streammodalBegin(qw422016, - "unattach-confirm", + "unattach", hyphaName, "", "Unattach "+util.BeautifulName(hyphaName)+"?") diff --git a/views/nav.qtpl b/views/nav.qtpl index 900b8e1..cecdc63 100644 --- a/views/nav.qtpl +++ b/views/nav.qtpl @@ -12,6 +12,7 @@ type navEntry struct { var navEntries = []navEntry{ {"page", "Hypha"}, {"edit", "Edit"}, + {"attachment", "Attachment"}, {"history", "History"}, {"revision", "NOT REACHED"}, {"rename-ask", "Rename"}, diff --git a/views/nav.qtpl.go b/views/nav.qtpl.go index 82c062d..b1cabdb 100644 --- a/views/nav.qtpl.go +++ b/views/nav.qtpl.go @@ -40,6 +40,7 @@ type navEntry struct { var navEntries = []navEntry{ {"page", "Hypha"}, {"edit", "Edit"}, + {"attachment", "Attachment"}, {"history", "History"}, {"revision", "NOT REACHED"}, {"rename-ask", "Rename"}, @@ -47,268 +48,268 @@ var navEntries = []navEntry{ {"text", "Raw text"}, } -//line views/nav.qtpl:23 +//line views/nav.qtpl:24 func StreamNavHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, navType string, revisionHash ...string) { -//line views/nav.qtpl:23 +//line views/nav.qtpl:24 qw422016.N().S(` `) -//line views/nav.qtpl:25 +//line views/nav.qtpl:26 u := user.FromRequest(rq) -//line views/nav.qtpl:26 +//line views/nav.qtpl:27 qw422016.N().S(` `) -//line views/nav.qtpl:46 +//line views/nav.qtpl:47 } -//line views/nav.qtpl:46 +//line views/nav.qtpl:47 func WriteNavHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, navType string, revisionHash ...string) { -//line views/nav.qtpl:46 +//line views/nav.qtpl:47 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/nav.qtpl:46 +//line views/nav.qtpl:47 StreamNavHTML(qw422016, rq, hyphaName, navType, revisionHash...) -//line views/nav.qtpl:46 +//line views/nav.qtpl:47 qt422016.ReleaseWriter(qw422016) -//line views/nav.qtpl:46 +//line views/nav.qtpl:47 } -//line views/nav.qtpl:46 +//line views/nav.qtpl:47 func NavHTML(rq *http.Request, hyphaName, navType string, revisionHash ...string) string { -//line views/nav.qtpl:46 +//line views/nav.qtpl:47 qb422016 := qt422016.AcquireByteBuffer() -//line views/nav.qtpl:46 +//line views/nav.qtpl:47 WriteNavHTML(qb422016, rq, hyphaName, navType, revisionHash...) -//line views/nav.qtpl:46 +//line views/nav.qtpl:47 qs422016 := string(qb422016.B) -//line views/nav.qtpl:46 +//line views/nav.qtpl:47 qt422016.ReleaseByteBuffer(qb422016) -//line views/nav.qtpl:46 +//line views/nav.qtpl:47 return qs422016 -//line views/nav.qtpl:46 +//line views/nav.qtpl:47 } -//line views/nav.qtpl:48 +//line views/nav.qtpl:49 func StreamUserMenuHTML(qw422016 *qt422016.Writer, u *user.User) { -//line views/nav.qtpl:48 +//line views/nav.qtpl:49 qw422016.N().S(` `) -//line views/nav.qtpl:49 +//line views/nav.qtpl:50 if user.AuthUsed { -//line views/nav.qtpl:49 +//line views/nav.qtpl:50 qw422016.N().S(`
  • `) -//line views/nav.qtpl:51 +//line views/nav.qtpl:52 if u.Group == "anon" { -//line views/nav.qtpl:51 +//line views/nav.qtpl:52 qw422016.N().S(` Login `) -//line views/nav.qtpl:53 +//line views/nav.qtpl:54 } else { -//line views/nav.qtpl:53 +//line views/nav.qtpl:54 qw422016.N().S(` `) -//line views/nav.qtpl:54 +//line views/nav.qtpl:55 qw422016.E().S(u.Name) -//line views/nav.qtpl:54 +//line views/nav.qtpl:55 qw422016.N().S(` `) -//line views/nav.qtpl:55 +//line views/nav.qtpl:56 } -//line views/nav.qtpl:55 +//line views/nav.qtpl:56 qw422016.N().S(`
  • `) -//line views/nav.qtpl:57 +//line views/nav.qtpl:58 } -//line views/nav.qtpl:57 +//line views/nav.qtpl:58 qw422016.N().S(` `) -//line views/nav.qtpl:58 +//line views/nav.qtpl:59 } -//line views/nav.qtpl:58 +//line views/nav.qtpl:59 func WriteUserMenuHTML(qq422016 qtio422016.Writer, u *user.User) { -//line views/nav.qtpl:58 +//line views/nav.qtpl:59 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/nav.qtpl:58 +//line views/nav.qtpl:59 StreamUserMenuHTML(qw422016, u) -//line views/nav.qtpl:58 +//line views/nav.qtpl:59 qt422016.ReleaseWriter(qw422016) -//line views/nav.qtpl:58 +//line views/nav.qtpl:59 } -//line views/nav.qtpl:58 +//line views/nav.qtpl:59 func UserMenuHTML(u *user.User) string { -//line views/nav.qtpl:58 +//line views/nav.qtpl:59 qb422016 := qt422016.AcquireByteBuffer() -//line views/nav.qtpl:58 +//line views/nav.qtpl:59 WriteUserMenuHTML(qb422016, u) -//line views/nav.qtpl:58 +//line views/nav.qtpl:59 qs422016 := string(qb422016.B) -//line views/nav.qtpl:58 +//line views/nav.qtpl:59 qt422016.ReleaseByteBuffer(qb422016) -//line views/nav.qtpl:58 +//line views/nav.qtpl:59 return qs422016 -//line views/nav.qtpl:58 +//line views/nav.qtpl:59 } -//line views/nav.qtpl:60 +//line views/nav.qtpl:61 func StreamRelativeHyphaeHTML(qw422016 *qt422016.Writer, relatives string) { -//line views/nav.qtpl:60 +//line views/nav.qtpl:61 qw422016.N().S(` `) -//line views/nav.qtpl:65 +//line views/nav.qtpl:66 } -//line views/nav.qtpl:65 +//line views/nav.qtpl:66 func WriteRelativeHyphaeHTML(qq422016 qtio422016.Writer, relatives string) { -//line views/nav.qtpl:65 +//line views/nav.qtpl:66 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/nav.qtpl:65 +//line views/nav.qtpl:66 StreamRelativeHyphaeHTML(qw422016, relatives) -//line views/nav.qtpl:65 +//line views/nav.qtpl:66 qt422016.ReleaseWriter(qw422016) -//line views/nav.qtpl:65 +//line views/nav.qtpl:66 } -//line views/nav.qtpl:65 +//line views/nav.qtpl:66 func RelativeHyphaeHTML(relatives string) string { -//line views/nav.qtpl:65 +//line views/nav.qtpl:66 qb422016 := qt422016.AcquireByteBuffer() -//line views/nav.qtpl:65 +//line views/nav.qtpl:66 WriteRelativeHyphaeHTML(qb422016, relatives) -//line views/nav.qtpl:65 +//line views/nav.qtpl:66 qs422016 := string(qb422016.B) -//line views/nav.qtpl:65 +//line views/nav.qtpl:66 qt422016.ReleaseByteBuffer(qb422016) -//line views/nav.qtpl:65 +//line views/nav.qtpl:66 return qs422016 -//line views/nav.qtpl:65 +//line views/nav.qtpl:66 } -//line views/nav.qtpl:67 +//line views/nav.qtpl:68 func StreamSubhyphaeHTML(qw422016 *qt422016.Writer, subhyphae string) { -//line views/nav.qtpl:67 +//line views/nav.qtpl:68 qw422016.N().S(` `) -//line views/nav.qtpl:68 +//line views/nav.qtpl:69 if strings.TrimSpace(subhyphae) != "" { -//line views/nav.qtpl:68 +//line views/nav.qtpl:69 qw422016.N().S(`

    Subhyphae

    `) -//line views/nav.qtpl:77 +//line views/nav.qtpl:78 } -//line views/nav.qtpl:77 +//line views/nav.qtpl:78 qw422016.N().S(` `) -//line views/nav.qtpl:78 +//line views/nav.qtpl:79 } -//line views/nav.qtpl:78 +//line views/nav.qtpl:79 func WriteSubhyphaeHTML(qq422016 qtio422016.Writer, subhyphae string) { -//line views/nav.qtpl:78 +//line views/nav.qtpl:79 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/nav.qtpl:78 +//line views/nav.qtpl:79 StreamSubhyphaeHTML(qw422016, subhyphae) -//line views/nav.qtpl:78 +//line views/nav.qtpl:79 qt422016.ReleaseWriter(qw422016) -//line views/nav.qtpl:78 +//line views/nav.qtpl:79 } -//line views/nav.qtpl:78 +//line views/nav.qtpl:79 func SubhyphaeHTML(subhyphae string) string { -//line views/nav.qtpl:78 +//line views/nav.qtpl:79 qb422016 := qt422016.AcquireByteBuffer() -//line views/nav.qtpl:78 +//line views/nav.qtpl:79 WriteSubhyphaeHTML(qb422016, subhyphae) -//line views/nav.qtpl:78 +//line views/nav.qtpl:79 qs422016 := string(qb422016.B) -//line views/nav.qtpl:78 +//line views/nav.qtpl:79 qt422016.ReleaseByteBuffer(qb422016) -//line views/nav.qtpl:78 +//line views/nav.qtpl:79 return qs422016 -//line views/nav.qtpl:78 +//line views/nav.qtpl:79 } diff --git a/views/readers.qtpl b/views/readers.qtpl index 9bbdb9e..2a80c4f 100644 --- a/views/readers.qtpl +++ b/views/readers.qtpl @@ -1,10 +1,75 @@ {% import "net/http" %} +{% import "strings" %} {% import "path" %} +{% import "os" %} {% import "github.com/bouncepaw/mycorrhiza/hyphae" %} +{% import "github.com/bouncepaw/mycorrhiza/mimetype" %} +{% import "github.com/bouncepaw/mycorrhiza/tree" %} {% import "github.com/bouncepaw/mycorrhiza/user" %} {% import "github.com/bouncepaw/mycorrhiza/util" %} -{% import "github.com/bouncepaw/mycorrhiza/tree" %} + +{% func AttachmentMenuHTML(rq *http.Request, h *hyphae.Hypha, u *user.User) %} +{%= NavHTML(rq, h.Name, "attachment") %} +
    +
    +

    Attachment of {%s util.BeautifulName(h.Name) %}

    + {% if h.BinaryPath == "" %} +

    This hypha has no attachment, you can upload it here.

    + {% else %} +

    You can manage the hypha's attachment on this page.

    + {% endif %} + +
    + + {% if h.BinaryPath != "" %} + {% code + mime := mimetype.FromExtension(path.Ext(h.BinaryPath)) + fileinfo, err := os.Stat(h.BinaryPath) %} + {% if err == nil %} +
    + Stat + +

    MIME type: {%s mime %}

    +
    + {% endif %} + + {% if strings.HasPrefix(mime, "image/") %} +
    + Include + +
    img { {%s h.Name %} }
    +
    + {% endif %} + {% endif %} + + {% if u.CanProceed("upload-binary") %} + + {% endif %} + + {% if h.BinaryPath != "" && u.CanProceed("unattach-confirm") %} + + {% endif %} + +
    +
    +
    +{% endfunc %} If `contents` == "", a helpful message is shown instead. {% func HyphaHTML(rq *http.Request, h *hyphae.Hypha, contents string) %} @@ -18,6 +83,16 @@ If `contents` == "", a helpful message is shown instead. {%s= NaviTitleHTML(h) %} {% if contents == "" %}

    This hypha has no text. Why not create it?

    + {% if u := user.FromRequest(rq); (!user.AuthUsed || u.Group != "anon") && !h.Exists %} +
    + + + +
    +
    + {% endif %} {% else %} {%s= contents %} {% endif %} @@ -30,19 +105,6 @@ If `contents` == "", a helpful message is shown instead. {% endif %} -{% if u := user.FromRequest(rq); !user.AuthUsed || u.Group != "anon" %} -
    - {% if h.Exists && h.BinaryPath != "" %} - Unattach current attachment? - {% endif %} - -
    - - -
    -{% endif %} {%= SubhyphaeHTML(subhyphae) %} {%= RelativeHyphaeHTML(relatives) %} diff --git a/views/readers.qtpl.go b/views/readers.qtpl.go index fc358ff..4244b5c 100644 --- a/views/readers.qtpl.go +++ b/views/readers.qtpl.go @@ -8,276 +8,447 @@ package views import "net/http" //line views/readers.qtpl:2 +import "strings" + +//line views/readers.qtpl:3 import "path" //line views/readers.qtpl:4 -import "github.com/bouncepaw/mycorrhiza/hyphae" - -//line views/readers.qtpl:5 -import "github.com/bouncepaw/mycorrhiza/user" +import "os" //line views/readers.qtpl:6 -import "github.com/bouncepaw/mycorrhiza/util" +import "github.com/bouncepaw/mycorrhiza/hyphae" //line views/readers.qtpl:7 +import "github.com/bouncepaw/mycorrhiza/mimetype" + +//line views/readers.qtpl:8 import "github.com/bouncepaw/mycorrhiza/tree" -// If `contents` == "", a helpful message is shown instead. +//line views/readers.qtpl:9 +import "github.com/bouncepaw/mycorrhiza/user" //line views/readers.qtpl:10 +import "github.com/bouncepaw/mycorrhiza/util" + +//line views/readers.qtpl:12 import ( qtio422016 "io" qt422016 "github.com/valyala/quicktemplate" ) -//line views/readers.qtpl:10 +//line views/readers.qtpl:12 var ( _ = qtio422016.Copy _ = qt422016.AcquireByteBuffer ) -//line views/readers.qtpl:10 -func StreamHyphaHTML(qw422016 *qt422016.Writer, rq *http.Request, h *hyphae.Hypha, contents string) { -//line views/readers.qtpl:10 +//line views/readers.qtpl:12 +func StreamAttachmentMenuHTML(qw422016 *qt422016.Writer, rq *http.Request, h *hyphae.Hypha, u *user.User) { +//line views/readers.qtpl:12 qw422016.N().S(` `) -//line views/readers.qtpl:12 - relatives, subhyphae, prevHyphaName, nextHyphaName := tree.Tree(h.Name) - +//line views/readers.qtpl:13 + StreamNavHTML(qw422016, rq, h.Name, "attachment") //line views/readers.qtpl:13 qw422016.N().S(` +
    +
    +

    Attachment of `) +//line views/readers.qtpl:16 + qw422016.E().S(util.BeautifulName(h.Name)) +//line views/readers.qtpl:16 + qw422016.N().S(`

    + `) +//line views/readers.qtpl:17 + if h.BinaryPath == "" { +//line views/readers.qtpl:17 + qw422016.N().S(` +

    This hypha has no attachment, you can upload it here.

    + `) +//line views/readers.qtpl:19 + } else { +//line views/readers.qtpl:19 + qw422016.N().S(` +

    You can manage the hypha's attachment on this page.

    + `) +//line views/readers.qtpl:21 + } +//line views/readers.qtpl:21 + qw422016.N().S(` + +
    + + `) +//line views/readers.qtpl:25 + if h.BinaryPath != "" { +//line views/readers.qtpl:25 + qw422016.N().S(` + `) +//line views/readers.qtpl:27 + mime := mimetype.FromExtension(path.Ext(h.BinaryPath)) + fileinfo, err := os.Stat(h.BinaryPath) + +//line views/readers.qtpl:28 + qw422016.N().S(` + `) +//line views/readers.qtpl:29 + if err == nil { +//line views/readers.qtpl:29 + qw422016.N().S(` +
    + Stat + +

    MIME type: `) +//line views/readers.qtpl:33 + qw422016.E().S(mime) +//line views/readers.qtpl:33 + qw422016.N().S(`

    +
    + `) +//line views/readers.qtpl:35 + } +//line views/readers.qtpl:35 + qw422016.N().S(` + + `) +//line views/readers.qtpl:37 + if strings.HasPrefix(mime, "image/") { +//line views/readers.qtpl:37 + qw422016.N().S(` +
    + Include + +
    img { `)
    +//line views/readers.qtpl:41
    +			qw422016.E().S(h.Name)
    +//line views/readers.qtpl:41
    +			qw422016.N().S(` }
    +
    + `) +//line views/readers.qtpl:43 + } +//line views/readers.qtpl:43 + qw422016.N().S(` + `) +//line views/readers.qtpl:44 + } +//line views/readers.qtpl:44 + qw422016.N().S(` + + `) +//line views/readers.qtpl:46 + if u.CanProceed("upload-binary") { +//line views/readers.qtpl:46 + qw422016.N().S(` + + `) +//line views/readers.qtpl:57 + } +//line views/readers.qtpl:57 + qw422016.N().S(` + + `) +//line views/readers.qtpl:59 + if h.BinaryPath != "" && u.CanProceed("unattach-confirm") { +//line views/readers.qtpl:59 + qw422016.N().S(` + + `) +//line views/readers.qtpl:67 + } +//line views/readers.qtpl:67 + qw422016.N().S(` + +
    +
    +
    `) -//line views/readers.qtpl:14 +//line views/readers.qtpl:72 +} + +//line views/readers.qtpl:72 +func WriteAttachmentMenuHTML(qq422016 qtio422016.Writer, rq *http.Request, h *hyphae.Hypha, u *user.User) { +//line views/readers.qtpl:72 + qw422016 := qt422016.AcquireWriter(qq422016) +//line views/readers.qtpl:72 + StreamAttachmentMenuHTML(qw422016, rq, h, u) +//line views/readers.qtpl:72 + qt422016.ReleaseWriter(qw422016) +//line views/readers.qtpl:72 +} + +//line views/readers.qtpl:72 +func AttachmentMenuHTML(rq *http.Request, h *hyphae.Hypha, u *user.User) string { +//line views/readers.qtpl:72 + qb422016 := qt422016.AcquireByteBuffer() +//line views/readers.qtpl:72 + WriteAttachmentMenuHTML(qb422016, rq, h, u) +//line views/readers.qtpl:72 + qs422016 := string(qb422016.B) +//line views/readers.qtpl:72 + qt422016.ReleaseByteBuffer(qb422016) +//line views/readers.qtpl:72 + return qs422016 +//line views/readers.qtpl:72 +} + +// If `contents` == "", a helpful message is shown instead. + +//line views/readers.qtpl:75 +func StreamHyphaHTML(qw422016 *qt422016.Writer, rq *http.Request, h *hyphae.Hypha, contents string) { +//line views/readers.qtpl:75 + qw422016.N().S(` +`) +//line views/readers.qtpl:77 + relatives, subhyphae, prevHyphaName, nextHyphaName := tree.Tree(h.Name) + +//line views/readers.qtpl:78 + qw422016.N().S(` +`) +//line views/readers.qtpl:79 StreamNavHTML(qw422016, rq, h.Name, "page") -//line views/readers.qtpl:14 +//line views/readers.qtpl:79 qw422016.N().S(`
    `) -//line views/readers.qtpl:18 +//line views/readers.qtpl:83 qw422016.N().S(NaviTitleHTML(h)) -//line views/readers.qtpl:18 +//line views/readers.qtpl:83 qw422016.N().S(` `) -//line views/readers.qtpl:19 +//line views/readers.qtpl:84 if contents == "" { -//line views/readers.qtpl:19 +//line views/readers.qtpl:84 qw422016.N().S(`

    This hypha has no text. Why not create it?

    `) -//line views/readers.qtpl:21 - } else { -//line views/readers.qtpl:21 - qw422016.N().S(` - `) -//line views/readers.qtpl:22 - qw422016.N().S(contents) -//line views/readers.qtpl:22 +//line views/readers.qtpl:86 + if u := user.FromRequest(rq); (!user.AuthUsed || u.Group != "anon") && !h.Exists { +//line views/readers.qtpl:86 + qw422016.N().S(` +
    + + + +
    +
    + `) +//line views/readers.qtpl:95 + } +//line views/readers.qtpl:95 qw422016.N().S(` `) -//line views/readers.qtpl:23 +//line views/readers.qtpl:96 + } else { +//line views/readers.qtpl:96 + qw422016.N().S(` + `) +//line views/readers.qtpl:97 + qw422016.N().S(contents) +//line views/readers.qtpl:97 + qw422016.N().S(` + `) +//line views/readers.qtpl:98 } -//line views/readers.qtpl:23 +//line views/readers.qtpl:98 qw422016.N().S(`
    `) -//line views/readers.qtpl:26 +//line views/readers.qtpl:101 if prevHyphaName != "" { -//line views/readers.qtpl:26 +//line views/readers.qtpl:101 qw422016.N().S(` `) -//line views/readers.qtpl:28 +//line views/readers.qtpl:103 } -//line views/readers.qtpl:28 +//line views/readers.qtpl:103 qw422016.N().S(` `) -//line views/readers.qtpl:29 +//line views/readers.qtpl:104 if nextHyphaName != "" { -//line views/readers.qtpl:29 +//line views/readers.qtpl:104 qw422016.N().S(` `) -//line views/readers.qtpl:31 +//line views/readers.qtpl:106 } -//line views/readers.qtpl:31 +//line views/readers.qtpl:106 qw422016.N().S(`
    `) -//line views/readers.qtpl:33 - if u := user.FromRequest(rq); !user.AuthUsed || u.Group != "anon" { -//line views/readers.qtpl:33 - qw422016.N().S(` -
    - `) -//line views/readers.qtpl:37 - if h.Exists && h.BinaryPath != "" { -//line views/readers.qtpl:37 - qw422016.N().S(` - Unattach current attachment? - `) -//line views/readers.qtpl:39 - } -//line views/readers.qtpl:39 - qw422016.N().S(` - -
    - - -
    -`) -//line views/readers.qtpl:45 - } -//line views/readers.qtpl:45 - qw422016.N().S(` -`) -//line views/readers.qtpl:46 +//line views/readers.qtpl:108 StreamSubhyphaeHTML(qw422016, subhyphae) -//line views/readers.qtpl:46 +//line views/readers.qtpl:108 qw422016.N().S(`
    `) -//line views/readers.qtpl:48 +//line views/readers.qtpl:110 StreamRelativeHyphaeHTML(qw422016, relatives) -//line views/readers.qtpl:48 +//line views/readers.qtpl:110 qw422016.N().S(` `) -//line views/readers.qtpl:49 +//line views/readers.qtpl:111 StreamBackLinksHTML(qw422016, h) -//line views/readers.qtpl:49 +//line views/readers.qtpl:111 qw422016.N().S(`
    `) -//line views/readers.qtpl:51 +//line views/readers.qtpl:113 } -//line views/readers.qtpl:51 +//line views/readers.qtpl:113 func WriteHyphaHTML(qq422016 qtio422016.Writer, rq *http.Request, h *hyphae.Hypha, contents string) { -//line views/readers.qtpl:51 +//line views/readers.qtpl:113 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/readers.qtpl:51 +//line views/readers.qtpl:113 StreamHyphaHTML(qw422016, rq, h, contents) -//line views/readers.qtpl:51 +//line views/readers.qtpl:113 qt422016.ReleaseWriter(qw422016) -//line views/readers.qtpl:51 +//line views/readers.qtpl:113 } -//line views/readers.qtpl:51 +//line views/readers.qtpl:113 func HyphaHTML(rq *http.Request, h *hyphae.Hypha, contents string) string { -//line views/readers.qtpl:51 +//line views/readers.qtpl:113 qb422016 := qt422016.AcquireByteBuffer() -//line views/readers.qtpl:51 +//line views/readers.qtpl:113 WriteHyphaHTML(qb422016, rq, h, contents) -//line views/readers.qtpl:51 +//line views/readers.qtpl:113 qs422016 := string(qb422016.B) -//line views/readers.qtpl:51 +//line views/readers.qtpl:113 qt422016.ReleaseByteBuffer(qb422016) -//line views/readers.qtpl:51 +//line views/readers.qtpl:113 return qs422016 -//line views/readers.qtpl:51 +//line views/readers.qtpl:113 } -//line views/readers.qtpl:53 +//line views/readers.qtpl:115 func StreamRevisionHTML(qw422016 *qt422016.Writer, rq *http.Request, h *hyphae.Hypha, contents, revHash string) { -//line views/readers.qtpl:53 +//line views/readers.qtpl:115 qw422016.N().S(` `) -//line views/readers.qtpl:55 +//line views/readers.qtpl:117 relatives, subhyphae, _, _ := tree.Tree(h.Name) -//line views/readers.qtpl:56 +//line views/readers.qtpl:118 qw422016.N().S(` `) -//line views/readers.qtpl:57 +//line views/readers.qtpl:119 StreamNavHTML(qw422016, rq, h.Name, "revision", revHash) -//line views/readers.qtpl:57 +//line views/readers.qtpl:119 qw422016.N().S(`

    Please note that viewing binary parts of hyphae is not supported in history for now.

    `) -//line views/readers.qtpl:62 +//line views/readers.qtpl:124 qw422016.N().S(NaviTitleHTML(h)) -//line views/readers.qtpl:62 +//line views/readers.qtpl:124 qw422016.N().S(` `) -//line views/readers.qtpl:63 +//line views/readers.qtpl:125 qw422016.N().S(contents) -//line views/readers.qtpl:63 +//line views/readers.qtpl:125 qw422016.N().S(`
    `) -//line views/readers.qtpl:65 +//line views/readers.qtpl:127 StreamSubhyphaeHTML(qw422016, subhyphae) -//line views/readers.qtpl:65 +//line views/readers.qtpl:127 qw422016.N().S(`
    `) -//line views/readers.qtpl:67 +//line views/readers.qtpl:129 StreamRelativeHyphaeHTML(qw422016, relatives) -//line views/readers.qtpl:67 +//line views/readers.qtpl:129 qw422016.N().S(`
    `) -//line views/readers.qtpl:69 +//line views/readers.qtpl:131 } -//line views/readers.qtpl:69 +//line views/readers.qtpl:131 func WriteRevisionHTML(qq422016 qtio422016.Writer, rq *http.Request, h *hyphae.Hypha, contents, revHash string) { -//line views/readers.qtpl:69 +//line views/readers.qtpl:131 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/readers.qtpl:69 +//line views/readers.qtpl:131 StreamRevisionHTML(qw422016, rq, h, contents, revHash) -//line views/readers.qtpl:69 +//line views/readers.qtpl:131 qt422016.ReleaseWriter(qw422016) -//line views/readers.qtpl:69 +//line views/readers.qtpl:131 } -//line views/readers.qtpl:69 +//line views/readers.qtpl:131 func RevisionHTML(rq *http.Request, h *hyphae.Hypha, contents, revHash string) string { -//line views/readers.qtpl:69 +//line views/readers.qtpl:131 qb422016 := qt422016.AcquireByteBuffer() -//line views/readers.qtpl:69 +//line views/readers.qtpl:131 WriteRevisionHTML(qb422016, rq, h, contents, revHash) -//line views/readers.qtpl:69 +//line views/readers.qtpl:131 qs422016 := string(qb422016.B) -//line views/readers.qtpl:69 +//line views/readers.qtpl:131 qt422016.ReleaseByteBuffer(qb422016) -//line views/readers.qtpl:69 +//line views/readers.qtpl:131 return qs422016 -//line views/readers.qtpl:69 +//line views/readers.qtpl:131 }