1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-10-30 03:36:16 +00:00

Reimplement empty hypha notice with go templates

This commit is contained in:
Timur Ismagilov 2022-04-24 14:11:53 +03:00
parent 79519f0a7d
commit 49b94074d1
10 changed files with 376 additions and 652 deletions

View File

@ -2,7 +2,6 @@ package hypview
import (
"embed"
"fmt"
"github.com/bouncepaw/mycorrhiza/cfg"
"github.com/bouncepaw/mycorrhiza/viewutil"
"log"
@ -12,15 +11,49 @@ import (
var (
//go:embed *.html
fs embed.FS
ruTranslation = ``
chainNaviTitle viewutil.Chain
fs embed.FS
ruTranslation = `
{{define "empty heading"}}Эта гифа не существует{{end}}
{{define "empty no rights"}}У вас нет прав для создания новых гиф. Вы можете:{{end}}
{{define "empty log in"}}Войти в свою учётную запись, если она у вас есть{{end}}
{{define "empty register"}}Создать новую учётную запись{{end}}
{{define "write a text"}}Написать текст{{end}}
{{define "write a text tip"}}Напишите заметку, дневник, статью, рассказ или иной текст с помощью <a href="/help/en/mycomarkup" class="shy-link">микоразметки</a>. Сохраняется полная история правок документа.{{end}}
{{define "write a text writing conventions"}}Не забывайте следовать правилам оформления этой вики, если они имеются.{{end}}
{{define "write a text btn"}}Создать{{end}}
{{define "upload a media"}}Загрузить медиа{{end}}
{{define "upload a media tip"}}Загрузите изображение, видео или аудио. Распространённые форматы можно просматривать из браузера, остальные просто скачать. Позже вы можете дописать пояснение к этому медиа.{{end}}
{{define "upload a media btn"}}Загрузить{{end}}
`
chainNaviTitle viewutil.Chain
chainEmptyHypha viewutil.Chain
)
func Init() {
chainNaviTitle = viewutil.
En(viewutil.CopyEnWith(fs, "view_navititle.html")).
Ru(template.Must(viewutil.CopyRuWith(fs, "view_navititle.html").Parse(ruTranslation)))
Ru(viewutil.CopyRuWith(fs, "view_navititle.html")) // no text inside
chainEmptyHypha = viewutil.
En(viewutil.CopyEnWith(fs, "view_empty_hypha.html")).
Ru(template.Must(viewutil.CopyRuWith(fs, "view_empty_hypha.html").Parse(ruTranslation)))
}
type emptyHyphaData struct {
HyphaName string
AllowRegistration bool
UseAuth bool
}
func EmptyHypha(meta viewutil.Meta, hyphaName string) string {
var buf strings.Builder
if err := chainEmptyHypha.Get(meta).ExecuteTemplate(&buf, "empty hypha card", emptyHyphaData{
HyphaName: hyphaName,
AllowRegistration: cfg.AllowRegistration,
UseAuth: cfg.UseAuth,
}); err != nil {
log.Println(err)
}
return buf.String()
}
type naviTitleData struct {
@ -57,6 +90,5 @@ func naviTitleify(hyphaName string) ([]string, []string) {
partsWithParents = append(partsWithParents, prevAcc)
}
fmt.Printf("%q — %q\n", parts, partsWithParents)
return parts, partsWithParents
}

View File

@ -0,0 +1,32 @@
{{define "empty hypha card"}}
<section class="non-existent-hypha">
<h2 class="non-existent-hypha__title">{{block "empty heading" .}}This hypha does not exist{{end}}</h2>
{{if and .UseAuth (eq .Meta.U.Group "anon")}}
<p>{{block "empty no rights" .}}You are not authorized to create new hyphae. Here is what you can do:{{end}}</p>
<ul>
<li><a href="/login">{{block "empty log in" .}}Log in to your account, if you have one{{end}}</a></li>
{{if .AllowRegistration}}<li><a href="/register">{{block "empty register" .}}Register a new account{{end}}</a></li>{{end}}
</ul>
{{else}}
<div class="non-existent-hypha__ways">
<section class="non-existent-hypha__way">
<h3 class="non-existent-hypha__subtitle">📝 {{block "write a text" .}}Write a text{{end}}</h3>
<p>{{block "write a text tip" .}}Write a note, a diary, an article, a story or anything textual using <a href="/help/en/mycomarkup" class="shy-link">Mycomarkup</a>. Full history of edits to the document will be saved.{{end}}</p>
<p>{{block "write a text writing conventions" .}}Make sure to follow this wiki's writing conventions if there are any.{{end}}</p>
<a class="btn btn_accent stick-to-bottom" href="/edit/{{.HyphaName}}">{{block "write a text btn" .}}Create{{end}}</a>
</section>
<section class="non-existent-hypha__way">
<h3 class="non-existent-hypha__subtitle">🖼 {{block "upload a media" .}}Upload a media{{end}}</h3>
<p>{{block "upload a media tip" .}}Upload a picture, a video or an audio. Most common formats can be accessed from the browser, others can be only downloaded afterwards. You can write a description for the media later.{{end}}</p>
<form action="/upload-binary/{{.HyphaName}}"
method="post" enctype="multipart/form-data"
class="upload-binary">
<input type="file" id="upload-binary__input" name="binary">
<button type="submit" class="btn stick-to-bottom" value="Upload">{{block "upload a media btn" .}}Upload{{end}}</button>
</form>
</section>
</div>
{{end}}
</section>
{{end}}

View File

@ -84,18 +84,6 @@
"reindex_no_rights": "You must be an admin to reindex hyphae.",
"header_no_rights": "You must be a moderator to update header links.",
"notexist_heading": "This hypha does not exist",
"notexist_norights": "You are not authorized to create new hyphae. Here is what you can do:",
"notexist_login": "Log in to your account, if you have one",
"notexist_register": "Register a new account",
"notexist_write": "Write a text",
"notexist_write_tip1": "Write a note, a diary, an article, a story or anything textual using {{.myco}}. Full history of edits to the document will be saved.",
"notexist_write_myco": "Mycomarkup",
"notexist_write_tip2": "Make sure to follow this wiki's writing conventions if there are any.",
"notexist_write_button": "Create",
"notexist_media": "Upload a media",
"notexist_media_tip1": "Upload a picture, a video or an audio. Most common formats can be accessed from the browser, others can be only downloaded afterwards. You can write a description for the media later.",
"media_download": "Download media",
"media_novideo": "Your browser does not support video.",
"media_novideo_link": "Download video",

View File

@ -89,18 +89,6 @@
"no_rights": "Недостаточно прав",
"reindex_no_rights": "Вы должны быть администратором, чтобы переиндексировать гифы.",
"header_no_rights": "Вы должны быть модератором, чтобы обновить ссылки в заголовке.",
"notexist_heading": "Эта гифа не существует",
"notexist_norights": "У вас нет прав для создания новых гиф. Вы можете:",
"notexist_login": "Войти в свою учётную запись, если она у вас есть",
"notexist_register": "Создать новую учётную запись",
"notexist_write": "Написать текст",
"notexist_write_tip1": "Напишите заметку, дневник, статью, рассказ или иной текст с помощью {{.myco}}. Сохраняется полная история правок документа.",
"notexist_write_myco": "микоразметки",
"notexist_write_tip2": "Не забывайте следовать правилам оформления этой вики, если они имеются.",
"notexist_write_button": "Создать",
"notexist_media": "Загрузить медиа",
"notexist_media_tip1": "Загрузите изображение, видео или аудио. Распространённые форматы можно просматривать из браузера, остальные просто скачать. Позже вы можете дописать пояснение к этому медиа.",
"media_download": "Скачать медиа",
"media_novideo": "Ваш браузер не поддерживает видео.",

View File

@ -1,51 +1,11 @@
{% import "path/filepath" %}
{% import "github.com/bouncepaw/mycorrhiza/cfg" %}
{% import "github.com/bouncepaw/mycorrhiza/hyphae" %}
{% import "github.com/bouncepaw/mycorrhiza/l18n" %}
{% import "github.com/bouncepaw/mycorrhiza/user" %}
{% import "github.com/bouncepaw/mycorrhiza/util" %}
{% func beautifulLink(hyphaName string) %}<a href="/hypha/{%s= hyphaName %}">{%s util.BeautifulName(hyphaName) %}</a>{% endfunc %}
{% func mycoLink(lc *l18n.Localizer) %}<a href="/help/en/mycomarkup" class="shy-link">{%s lc.Get("ui.notexist_write_myco") %}</a>{% endfunc %}
{% func nonExistentHyphaNotice(h hyphae.Hypha, u *user.User, lc *l18n.Localizer) %}
<section class="non-existent-hypha">
<h2 class="non-existent-hypha__title">{%s lc.Get("ui.notexist_heading") %}</h2>
{% if cfg.UseAuth && u.Group == "anon" %}
<p>{%s lc.Get("ui.notexist_norights") %}</p>
<ul>
<li><a href="/login">{%s lc.Get("ui.notexist_login") %}</a></li>
{% if cfg.AllowRegistration %}<li><a href="/register">{%s lc.Get("ui.notexist_register") %}</a></li>{% endif %}
</ul>
{% else %}
<div class="non-existent-hypha__ways">
<section class="non-existent-hypha__way">
<h3 class="non-existent-hypha__subtitle">📝 {%s lc.Get("ui.notexist_write") %}</h3>
<p>{%s= lc.Get("ui.notexist_write_tip1", &l18n.Replacements{"myco": mycoLink(lc)}) %}</p>
<p>{%s lc.Get("ui.notexist_write_tip2") %}</p>
<a class="btn btn_accent stick-to-bottom" href="/edit/{%s h.CanonicalName() %}">{%s lc.Get("ui.notexist_write_button") %}</a>
</section>
<section class="non-existent-hypha__way">
<h3 class="non-existent-hypha__subtitle">🖼 {%s lc.Get("ui.notexist_media") %}</h3>
<p>{%s lc.Get("ui.notexist_media_tip1") %}</p>
<form action="/upload-binary/{%s h.CanonicalName() %}"
method="post" enctype="multipart/form-data"
class="upload-binary">
<label for="upload-binary__input"></label>
<input type="file" id="upload-binary__input" name="binary">
<button type="submit" class="btn stick-to-bottom" value="Upload">{%s lc.Get("ui.media_upload")%}</button>
</form>
</section>
</div>
{% endif %}
</section>
{% endfunc %}
{% func MediaRaw(h *hyphae.MediaHypha) %}{%= Media(h, l18n.New("en", "en")) %}{% endfunc %}
{% func Media(h *hyphae.MediaHypha, lc *l18n.Localizer) %}

View File

@ -8,409 +8,227 @@ package views
import "path/filepath"
//line views/hypha.qtpl:3
import "github.com/bouncepaw/mycorrhiza/cfg"
//line views/hypha.qtpl:4
import "github.com/bouncepaw/mycorrhiza/hyphae"
//line views/hypha.qtpl:5
//line views/hypha.qtpl:4
import "github.com/bouncepaw/mycorrhiza/l18n"
//line views/hypha.qtpl:6
import "github.com/bouncepaw/mycorrhiza/user"
//line views/hypha.qtpl:7
//line views/hypha.qtpl:5
import "github.com/bouncepaw/mycorrhiza/util"
//line views/hypha.qtpl:9
//line views/hypha.qtpl:7
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
//line views/hypha.qtpl:9
//line views/hypha.qtpl:7
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
//line views/hypha.qtpl:9
//line views/hypha.qtpl:7
func streambeautifulLink(qw422016 *qt422016.Writer, hyphaName string) {
//line views/hypha.qtpl:9
//line views/hypha.qtpl:7
qw422016.N().S(`<a href="/hypha/`)
//line views/hypha.qtpl:9
//line views/hypha.qtpl:7
qw422016.N().S(hyphaName)
//line views/hypha.qtpl:9
//line views/hypha.qtpl:7
qw422016.N().S(`">`)
//line views/hypha.qtpl:9
//line views/hypha.qtpl:7
qw422016.E().S(util.BeautifulName(hyphaName))
//line views/hypha.qtpl:9
//line views/hypha.qtpl:7
qw422016.N().S(`</a>`)
//line views/hypha.qtpl:9
//line views/hypha.qtpl:7
}
//line views/hypha.qtpl:9
//line views/hypha.qtpl:7
func writebeautifulLink(qq422016 qtio422016.Writer, hyphaName string) {
//line views/hypha.qtpl:9
//line views/hypha.qtpl:7
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/hypha.qtpl:9
//line views/hypha.qtpl:7
streambeautifulLink(qw422016, hyphaName)
//line views/hypha.qtpl:9
//line views/hypha.qtpl:7
qt422016.ReleaseWriter(qw422016)
//line views/hypha.qtpl:9
//line views/hypha.qtpl:7
}
//line views/hypha.qtpl:9
//line views/hypha.qtpl:7
func beautifulLink(hyphaName string) string {
//line views/hypha.qtpl:9
//line views/hypha.qtpl:7
qb422016 := qt422016.AcquireByteBuffer()
//line views/hypha.qtpl:9
//line views/hypha.qtpl:7
writebeautifulLink(qb422016, hyphaName)
//line views/hypha.qtpl:9
//line views/hypha.qtpl:7
qs422016 := string(qb422016.B)
//line views/hypha.qtpl:9
//line views/hypha.qtpl:7
qt422016.ReleaseByteBuffer(qb422016)
//line views/hypha.qtpl:7
return qs422016
//line views/hypha.qtpl:7
}
//line views/hypha.qtpl:9
return qs422016
//line views/hypha.qtpl:9
}
//line views/hypha.qtpl:11
func streammycoLink(qw422016 *qt422016.Writer, lc *l18n.Localizer) {
//line views/hypha.qtpl:11
qw422016.N().S(`<a href="/help/en/mycomarkup" class="shy-link">`)
//line views/hypha.qtpl:11
qw422016.E().S(lc.Get("ui.notexist_write_myco"))
//line views/hypha.qtpl:11
qw422016.N().S(`</a>`)
//line views/hypha.qtpl:11
}
//line views/hypha.qtpl:11
func writemycoLink(qq422016 qtio422016.Writer, lc *l18n.Localizer) {
//line views/hypha.qtpl:11
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/hypha.qtpl:11
streammycoLink(qw422016, lc)
//line views/hypha.qtpl:11
qt422016.ReleaseWriter(qw422016)
//line views/hypha.qtpl:11
}
//line views/hypha.qtpl:11
func mycoLink(lc *l18n.Localizer) string {
//line views/hypha.qtpl:11
qb422016 := qt422016.AcquireByteBuffer()
//line views/hypha.qtpl:11
writemycoLink(qb422016, lc)
//line views/hypha.qtpl:11
qs422016 := string(qb422016.B)
//line views/hypha.qtpl:11
qt422016.ReleaseByteBuffer(qb422016)
//line views/hypha.qtpl:11
return qs422016
//line views/hypha.qtpl:11
}
//line views/hypha.qtpl:13
func streamnonExistentHyphaNotice(qw422016 *qt422016.Writer, h hyphae.Hypha, u *user.User, lc *l18n.Localizer) {
//line views/hypha.qtpl:13
qw422016.N().S(`
<section class="non-existent-hypha">
<h2 class="non-existent-hypha__title">`)
//line views/hypha.qtpl:15
qw422016.E().S(lc.Get("ui.notexist_heading"))
//line views/hypha.qtpl:15
qw422016.N().S(`</h2>
`)
//line views/hypha.qtpl:16
if cfg.UseAuth && u.Group == "anon" {
//line views/hypha.qtpl:16
qw422016.N().S(`
<p>`)
//line views/hypha.qtpl:17
qw422016.E().S(lc.Get("ui.notexist_norights"))
//line views/hypha.qtpl:17
qw422016.N().S(`</p>
<ul>
<li><a href="/login">`)
//line views/hypha.qtpl:19
qw422016.E().S(lc.Get("ui.notexist_login"))
//line views/hypha.qtpl:19
qw422016.N().S(`</a></li>
`)
//line views/hypha.qtpl:20
if cfg.AllowRegistration {
//line views/hypha.qtpl:20
qw422016.N().S(`<li><a href="/register">`)
//line views/hypha.qtpl:20
qw422016.E().S(lc.Get("ui.notexist_register"))
//line views/hypha.qtpl:20
qw422016.N().S(`</a></li>`)
//line views/hypha.qtpl:20
}
//line views/hypha.qtpl:20
qw422016.N().S(`
</ul>
`)
//line views/hypha.qtpl:22
} else {
//line views/hypha.qtpl:22
qw422016.N().S(`
<div class="non-existent-hypha__ways">
<section class="non-existent-hypha__way">
<h3 class="non-existent-hypha__subtitle">📝 `)
//line views/hypha.qtpl:26
qw422016.E().S(lc.Get("ui.notexist_write"))
//line views/hypha.qtpl:26
qw422016.N().S(`</h3>
<p>`)
//line views/hypha.qtpl:27
qw422016.N().S(lc.Get("ui.notexist_write_tip1", &l18n.Replacements{"myco": mycoLink(lc)}))
//line views/hypha.qtpl:27
qw422016.N().S(`</p>
<p>`)
//line views/hypha.qtpl:28
qw422016.E().S(lc.Get("ui.notexist_write_tip2"))
//line views/hypha.qtpl:28
qw422016.N().S(`</p>
<a class="btn btn_accent stick-to-bottom" href="/edit/`)
//line views/hypha.qtpl:29
qw422016.E().S(h.CanonicalName())
//line views/hypha.qtpl:29
qw422016.N().S(`">`)
//line views/hypha.qtpl:29
qw422016.E().S(lc.Get("ui.notexist_write_button"))
//line views/hypha.qtpl:29
qw422016.N().S(`</a>
</section>
<section class="non-existent-hypha__way">
<h3 class="non-existent-hypha__subtitle">🖼 `)
//line views/hypha.qtpl:33
qw422016.E().S(lc.Get("ui.notexist_media"))
//line views/hypha.qtpl:33
qw422016.N().S(`</h3>
<p>`)
//line views/hypha.qtpl:34
qw422016.E().S(lc.Get("ui.notexist_media_tip1"))
//line views/hypha.qtpl:34
qw422016.N().S(`</p>
<form action="/upload-binary/`)
//line views/hypha.qtpl:35
qw422016.E().S(h.CanonicalName())
//line views/hypha.qtpl:35
qw422016.N().S(`"
method="post" enctype="multipart/form-data"
class="upload-binary">
<label for="upload-binary__input"></label>
<input type="file" id="upload-binary__input" name="binary">
<button type="submit" class="btn stick-to-bottom" value="Upload">`)
//line views/hypha.qtpl:41
qw422016.E().S(lc.Get("ui.media_upload"))
//line views/hypha.qtpl:41
qw422016.N().S(`</button>
</form>
</section>
</div>
`)
//line views/hypha.qtpl:45
}
//line views/hypha.qtpl:45
qw422016.N().S(`
</section>
`)
//line views/hypha.qtpl:47
}
//line views/hypha.qtpl:47
func writenonExistentHyphaNotice(qq422016 qtio422016.Writer, h hyphae.Hypha, u *user.User, lc *l18n.Localizer) {
//line views/hypha.qtpl:47
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/hypha.qtpl:47
streamnonExistentHyphaNotice(qw422016, h, u, lc)
//line views/hypha.qtpl:47
qt422016.ReleaseWriter(qw422016)
//line views/hypha.qtpl:47
}
//line views/hypha.qtpl:47
func nonExistentHyphaNotice(h hyphae.Hypha, u *user.User, lc *l18n.Localizer) string {
//line views/hypha.qtpl:47
qb422016 := qt422016.AcquireByteBuffer()
//line views/hypha.qtpl:47
writenonExistentHyphaNotice(qb422016, h, u, lc)
//line views/hypha.qtpl:47
qs422016 := string(qb422016.B)
//line views/hypha.qtpl:47
qt422016.ReleaseByteBuffer(qb422016)
//line views/hypha.qtpl:47
return qs422016
//line views/hypha.qtpl:47
}
//line views/hypha.qtpl:49
func StreamMediaRaw(qw422016 *qt422016.Writer, h *hyphae.MediaHypha) {
//line views/hypha.qtpl:49
//line views/hypha.qtpl:9
StreamMedia(qw422016, h, l18n.New("en", "en"))
//line views/hypha.qtpl:49
//line views/hypha.qtpl:9
}
//line views/hypha.qtpl:49
//line views/hypha.qtpl:9
func WriteMediaRaw(qq422016 qtio422016.Writer, h *hyphae.MediaHypha) {
//line views/hypha.qtpl:49
//line views/hypha.qtpl:9
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/hypha.qtpl:49
//line views/hypha.qtpl:9
StreamMediaRaw(qw422016, h)
//line views/hypha.qtpl:49
//line views/hypha.qtpl:9
qt422016.ReleaseWriter(qw422016)
//line views/hypha.qtpl:49
//line views/hypha.qtpl:9
}
//line views/hypha.qtpl:49
//line views/hypha.qtpl:9
func MediaRaw(h *hyphae.MediaHypha) string {
//line views/hypha.qtpl:49
//line views/hypha.qtpl:9
qb422016 := qt422016.AcquireByteBuffer()
//line views/hypha.qtpl:49
//line views/hypha.qtpl:9
WriteMediaRaw(qb422016, h)
//line views/hypha.qtpl:49
//line views/hypha.qtpl:9
qs422016 := string(qb422016.B)
//line views/hypha.qtpl:49
//line views/hypha.qtpl:9
qt422016.ReleaseByteBuffer(qb422016)
//line views/hypha.qtpl:49
//line views/hypha.qtpl:9
return qs422016
//line views/hypha.qtpl:49
//line views/hypha.qtpl:9
}
//line views/hypha.qtpl:51
//line views/hypha.qtpl:11
func StreamMedia(qw422016 *qt422016.Writer, h *hyphae.MediaHypha, lc *l18n.Localizer) {
//line views/hypha.qtpl:51
//line views/hypha.qtpl:11
qw422016.N().S(`
`)
//line views/hypha.qtpl:52
//line views/hypha.qtpl:12
switch filepath.Ext(h.MediaFilePath()) {
//line views/hypha.qtpl:54
//line views/hypha.qtpl:14
case ".jpg", ".gif", ".png", ".webp", ".svg", ".ico":
//line views/hypha.qtpl:54
//line views/hypha.qtpl:14
qw422016.N().S(`
<div class="binary-container binary-container_with-img">
<a href="/binary/`)
//line views/hypha.qtpl:56
//line views/hypha.qtpl:16
qw422016.N().S(h.CanonicalName())
//line views/hypha.qtpl:56
//line views/hypha.qtpl:16
qw422016.N().S(`"><img src="/binary/`)
//line views/hypha.qtpl:56
//line views/hypha.qtpl:16
qw422016.N().S(h.CanonicalName())
//line views/hypha.qtpl:56
//line views/hypha.qtpl:16
qw422016.N().S(`"/></a>
</div>
`)
//line views/hypha.qtpl:59
//line views/hypha.qtpl:19
case ".ogg", ".webm", ".mp4":
//line views/hypha.qtpl:59
//line views/hypha.qtpl:19
qw422016.N().S(`
<div class="binary-container binary-container_with-video">
<video controls>
<source src="/binary/`)
//line views/hypha.qtpl:62
//line views/hypha.qtpl:22
qw422016.N().S(h.CanonicalName())
//line views/hypha.qtpl:62
//line views/hypha.qtpl:22
qw422016.N().S(`"/>
<p>`)
//line views/hypha.qtpl:63
//line views/hypha.qtpl:23
qw422016.E().S(lc.Get("ui.media_novideo"))
//line views/hypha.qtpl:63
//line views/hypha.qtpl:23
qw422016.N().S(` <a href="/binary/`)
//line views/hypha.qtpl:63
//line views/hypha.qtpl:23
qw422016.N().S(h.CanonicalName())
//line views/hypha.qtpl:63
//line views/hypha.qtpl:23
qw422016.N().S(`">`)
//line views/hypha.qtpl:63
//line views/hypha.qtpl:23
qw422016.E().S(lc.Get("ui.media_novideo_link"))
//line views/hypha.qtpl:63
//line views/hypha.qtpl:23
qw422016.N().S(`</a></p>
</video>
</div>
`)
//line views/hypha.qtpl:67
//line views/hypha.qtpl:27
case ".mp3":
//line views/hypha.qtpl:67
//line views/hypha.qtpl:27
qw422016.N().S(`
<div class="binary-container binary-container_with-audio">
<audio controls>
<source src="/binary/`)
//line views/hypha.qtpl:70
//line views/hypha.qtpl:30
qw422016.N().S(h.CanonicalName())
//line views/hypha.qtpl:70
//line views/hypha.qtpl:30
qw422016.N().S(`"/>
<p>`)
//line views/hypha.qtpl:71
//line views/hypha.qtpl:31
qw422016.E().S(lc.Get("ui.media_noaudio"))
//line views/hypha.qtpl:71
//line views/hypha.qtpl:31
qw422016.N().S(` <a href="/binary/`)
//line views/hypha.qtpl:71
//line views/hypha.qtpl:31
qw422016.N().S(h.CanonicalName())
//line views/hypha.qtpl:71
//line views/hypha.qtpl:31
qw422016.N().S(`">`)
//line views/hypha.qtpl:71
//line views/hypha.qtpl:31
qw422016.E().S(lc.Get("ui.media_noaudio_link"))
//line views/hypha.qtpl:71
//line views/hypha.qtpl:31
qw422016.N().S(`</a></p>
</audio>
</div>
`)
//line views/hypha.qtpl:75
//line views/hypha.qtpl:35
default:
//line views/hypha.qtpl:75
//line views/hypha.qtpl:35
qw422016.N().S(`
<div class="binary-container binary-container_with-nothing">
<p><a href="/binary/`)
//line views/hypha.qtpl:77
//line views/hypha.qtpl:37
qw422016.N().S(h.CanonicalName())
//line views/hypha.qtpl:77
//line views/hypha.qtpl:37
qw422016.N().S(`">`)
//line views/hypha.qtpl:77
//line views/hypha.qtpl:37
qw422016.E().S(lc.Get("ui.media_download"))
//line views/hypha.qtpl:77
//line views/hypha.qtpl:37
qw422016.N().S(`</a></p>
</div>
`)
//line views/hypha.qtpl:79
//line views/hypha.qtpl:39
}
//line views/hypha.qtpl:79
//line views/hypha.qtpl:39
qw422016.N().S(`
`)
//line views/hypha.qtpl:80
//line views/hypha.qtpl:40
}
//line views/hypha.qtpl:80
//line views/hypha.qtpl:40
func WriteMedia(qq422016 qtio422016.Writer, h *hyphae.MediaHypha, lc *l18n.Localizer) {
//line views/hypha.qtpl:80
//line views/hypha.qtpl:40
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/hypha.qtpl:80
//line views/hypha.qtpl:40
StreamMedia(qw422016, h, lc)
//line views/hypha.qtpl:80
//line views/hypha.qtpl:40
qt422016.ReleaseWriter(qw422016)
//line views/hypha.qtpl:80
//line views/hypha.qtpl:40
}
//line views/hypha.qtpl:80
//line views/hypha.qtpl:40
func Media(h *hyphae.MediaHypha, lc *l18n.Localizer) string {
//line views/hypha.qtpl:80
//line views/hypha.qtpl:40
qb422016 := qt422016.AcquireByteBuffer()
//line views/hypha.qtpl:80
//line views/hypha.qtpl:40
WriteMedia(qb422016, h, lc)
//line views/hypha.qtpl:80
//line views/hypha.qtpl:40
qs422016 := string(qb422016.B)
//line views/hypha.qtpl:80
//line views/hypha.qtpl:40
qt422016.ReleaseByteBuffer(qb422016)
//line views/hypha.qtpl:80
//line views/hypha.qtpl:40
return qs422016
//line views/hypha.qtpl:80
//line views/hypha.qtpl:40
}

View File

@ -1,7 +1,5 @@
{% import "strings" %}
{% import "github.com/bouncepaw/mycorrhiza/cfg" %}
{% import "github.com/bouncepaw/mycorrhiza/backlinks" %}
{% import "github.com/bouncepaw/mycorrhiza/l18n" %}
{% import "github.com/bouncepaw/mycorrhiza/user" %}
{% import "github.com/bouncepaw/mycorrhiza/hyphae" %}
{% import "github.com/bouncepaw/mycorrhiza/viewutil" %}
@ -32,28 +30,6 @@
</nav>
{% endfunc %}
{% func siblingHyphae(siblings string, lc *l18n.Localizer) %}
{% if cfg.UseSiblingHyphaeSidebar %}
<aside class="sibling-hyphae layout-card">
<h2 class="sibling-hyphae__title layout-card__title">{%s lc.Get("ui.sibling_hyphae") %}</h2>
{%s= siblings %}
</aside>
{% endif %}
{% endfunc %}
{% func Subhyphae(subhyphae string, lc *l18n.Localizer) %}
{% if strings.TrimSpace(subhyphae) != "" %}
<section class="subhyphae">
<h2 class="subhyphae__title">{%s lc.Get("ui.subhyphae") %}</h2>
<nav class="subhyphae__nav">
<ul class="subhyphae__list">
{%s= subhyphae %}
</ul>
</nav>
</section>
{% endif %}
{% endfunc %}
{% func commonScripts() %}
{% for _, scriptPath := range cfg.CommonScripts %}
<script src="{%s scriptPath %}"></script>

View File

@ -5,339 +5,217 @@
package views
//line views/nav.qtpl:1
import "strings"
//line views/nav.qtpl:2
import "github.com/bouncepaw/mycorrhiza/cfg"
//line views/nav.qtpl:3
//line views/nav.qtpl:2
import "github.com/bouncepaw/mycorrhiza/backlinks"
//line views/nav.qtpl:4
import "github.com/bouncepaw/mycorrhiza/l18n"
//line views/nav.qtpl:5
//line views/nav.qtpl:3
import "github.com/bouncepaw/mycorrhiza/user"
//line views/nav.qtpl:6
//line views/nav.qtpl:4
import "github.com/bouncepaw/mycorrhiza/hyphae"
//line views/nav.qtpl:7
//line views/nav.qtpl:5
import "github.com/bouncepaw/mycorrhiza/viewutil"
//line views/nav.qtpl:9
//line views/nav.qtpl:7
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
//line views/nav.qtpl:9
//line views/nav.qtpl:7
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
//line views/nav.qtpl:9
//line views/nav.qtpl:7
func streamhyphaInfoEntry(qw422016 *qt422016.Writer, h hyphae.Hypha, u *user.User, action, displayText string) {
//line views/nav.qtpl:9
//line views/nav.qtpl:7
qw422016.N().S(`
`)
//line views/nav.qtpl:10
//line views/nav.qtpl:8
if u.CanProceed(action) {
//line views/nav.qtpl:10
//line views/nav.qtpl:8
qw422016.N().S(`
<li class="hypha-info__entry hypha-info__entry_`)
//line views/nav.qtpl:11
//line views/nav.qtpl:9
qw422016.E().S(action)
//line views/nav.qtpl:11
//line views/nav.qtpl:9
qw422016.N().S(`">
<a class="hypha-info__link" href="/`)
//line views/nav.qtpl:12
//line views/nav.qtpl:10
qw422016.E().S(action)
//line views/nav.qtpl:12
//line views/nav.qtpl:10
qw422016.N().S(`/`)
//line views/nav.qtpl:12
//line views/nav.qtpl:10
qw422016.E().S(h.CanonicalName())
//line views/nav.qtpl:12
//line views/nav.qtpl:10
qw422016.N().S(`">`)
//line views/nav.qtpl:12
//line views/nav.qtpl:10
qw422016.E().S(displayText)
//line views/nav.qtpl:12
//line views/nav.qtpl:10
qw422016.N().S(`</a>
</li>
`)
//line views/nav.qtpl:14
//line views/nav.qtpl:12
}
//line views/nav.qtpl:14
//line views/nav.qtpl:12
qw422016.N().S(`
`)
//line views/nav.qtpl:15
//line views/nav.qtpl:13
}
//line views/nav.qtpl:15
//line views/nav.qtpl:13
func writehyphaInfoEntry(qq422016 qtio422016.Writer, h hyphae.Hypha, u *user.User, action, displayText string) {
//line views/nav.qtpl:15
//line views/nav.qtpl:13
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/nav.qtpl:15
//line views/nav.qtpl:13
streamhyphaInfoEntry(qw422016, h, u, action, displayText)
//line views/nav.qtpl:15
//line views/nav.qtpl:13
qt422016.ReleaseWriter(qw422016)
//line views/nav.qtpl:15
//line views/nav.qtpl:13
}
//line views/nav.qtpl:15
//line views/nav.qtpl:13
func hyphaInfoEntry(h hyphae.Hypha, u *user.User, action, displayText string) string {
//line views/nav.qtpl:15
//line views/nav.qtpl:13
qb422016 := qt422016.AcquireByteBuffer()
//line views/nav.qtpl:15
//line views/nav.qtpl:13
writehyphaInfoEntry(qb422016, h, u, action, displayText)
//line views/nav.qtpl:15
//line views/nav.qtpl:13
qs422016 := string(qb422016.B)
//line views/nav.qtpl:15
//line views/nav.qtpl:13
qt422016.ReleaseByteBuffer(qb422016)
//line views/nav.qtpl:15
//line views/nav.qtpl:13
return qs422016
//line views/nav.qtpl:15
//line views/nav.qtpl:13
}
//line views/nav.qtpl:17
//line views/nav.qtpl:15
func streamhyphaInfo(qw422016 *qt422016.Writer, meta viewutil.Meta, h hyphae.Hypha) {
//line views/nav.qtpl:17
//line views/nav.qtpl:15
qw422016.N().S(`
`)
//line views/nav.qtpl:19
//line views/nav.qtpl:17
u := meta.U
lc := meta.Lc
backs := backlinks.BacklinksCount(h)
//line views/nav.qtpl:22
//line views/nav.qtpl:20
qw422016.N().S(`
<nav class="hypha-info">
<ul class="hypha-info__list">
`)
//line views/nav.qtpl:25
//line views/nav.qtpl:23
streamhyphaInfoEntry(qw422016, h, u, "history", lc.Get("ui.history_link"))
//line views/nav.qtpl:23
qw422016.N().S(`
`)
//line views/nav.qtpl:24
streamhyphaInfoEntry(qw422016, h, u, "rename", lc.Get("ui.rename_link"))
//line views/nav.qtpl:24
qw422016.N().S(`
`)
//line views/nav.qtpl:25
streamhyphaInfoEntry(qw422016, h, u, "delete", lc.Get("ui.delete_link"))
//line views/nav.qtpl:25
qw422016.N().S(`
`)
//line views/nav.qtpl:26
streamhyphaInfoEntry(qw422016, h, u, "rename", lc.Get("ui.rename_link"))
streamhyphaInfoEntry(qw422016, h, u, "text", lc.Get("ui.text_link"))
//line views/nav.qtpl:26
qw422016.N().S(`
`)
//line views/nav.qtpl:27
streamhyphaInfoEntry(qw422016, h, u, "delete", lc.Get("ui.delete_link"))
streamhyphaInfoEntry(qw422016, h, u, "media", lc.Get("ui.media_link"))
//line views/nav.qtpl:27
qw422016.N().S(`
`)
//line views/nav.qtpl:28
streamhyphaInfoEntry(qw422016, h, u, "text", lc.Get("ui.text_link"))
//line views/nav.qtpl:28
qw422016.N().S(`
`)
//line views/nav.qtpl:29
streamhyphaInfoEntry(qw422016, h, u, "media", lc.Get("ui.media_link"))
//line views/nav.qtpl:29
qw422016.N().S(`
`)
//line views/nav.qtpl:30
streamhyphaInfoEntry(qw422016, h, u, "backlinks", lc.GetPlural("ui.backlinks_link", backs))
//line views/nav.qtpl:30
//line views/nav.qtpl:28
qw422016.N().S(`
</ul>
</nav>
`)
//line views/nav.qtpl:33
//line views/nav.qtpl:31
}
//line views/nav.qtpl:33
//line views/nav.qtpl:31
func writehyphaInfo(qq422016 qtio422016.Writer, meta viewutil.Meta, h hyphae.Hypha) {
//line views/nav.qtpl:33
//line views/nav.qtpl:31
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/nav.qtpl:33
//line views/nav.qtpl:31
streamhyphaInfo(qw422016, meta, h)
//line views/nav.qtpl:33
//line views/nav.qtpl:31
qt422016.ReleaseWriter(qw422016)
//line views/nav.qtpl:33
//line views/nav.qtpl:31
}
//line views/nav.qtpl:33
//line views/nav.qtpl:31
func hyphaInfo(meta viewutil.Meta, h hyphae.Hypha) string {
//line views/nav.qtpl:33
//line views/nav.qtpl:31
qb422016 := qt422016.AcquireByteBuffer()
//line views/nav.qtpl:33
//line views/nav.qtpl:31
writehyphaInfo(qb422016, meta, h)
//line views/nav.qtpl:33
//line views/nav.qtpl:31
qs422016 := string(qb422016.B)
//line views/nav.qtpl:33
//line views/nav.qtpl:31
qt422016.ReleaseByteBuffer(qb422016)
//line views/nav.qtpl:31
return qs422016
//line views/nav.qtpl:31
}
//line views/nav.qtpl:33
return qs422016
//line views/nav.qtpl:33
}
//line views/nav.qtpl:35
func streamsiblingHyphae(qw422016 *qt422016.Writer, siblings string, lc *l18n.Localizer) {
//line views/nav.qtpl:35
qw422016.N().S(`
`)
//line views/nav.qtpl:36
if cfg.UseSiblingHyphaeSidebar {
//line views/nav.qtpl:36
qw422016.N().S(`
<aside class="sibling-hyphae layout-card">
<h2 class="sibling-hyphae__title layout-card__title">`)
//line views/nav.qtpl:38
qw422016.E().S(lc.Get("ui.sibling_hyphae"))
//line views/nav.qtpl:38
qw422016.N().S(`</h2>
`)
//line views/nav.qtpl:39
qw422016.N().S(siblings)
//line views/nav.qtpl:39
qw422016.N().S(`
</aside>
`)
//line views/nav.qtpl:41
}
//line views/nav.qtpl:41
qw422016.N().S(`
`)
//line views/nav.qtpl:42
}
//line views/nav.qtpl:42
func writesiblingHyphae(qq422016 qtio422016.Writer, siblings string, lc *l18n.Localizer) {
//line views/nav.qtpl:42
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/nav.qtpl:42
streamsiblingHyphae(qw422016, siblings, lc)
//line views/nav.qtpl:42
qt422016.ReleaseWriter(qw422016)
//line views/nav.qtpl:42
}
//line views/nav.qtpl:42
func siblingHyphae(siblings string, lc *l18n.Localizer) string {
//line views/nav.qtpl:42
qb422016 := qt422016.AcquireByteBuffer()
//line views/nav.qtpl:42
writesiblingHyphae(qb422016, siblings, lc)
//line views/nav.qtpl:42
qs422016 := string(qb422016.B)
//line views/nav.qtpl:42
qt422016.ReleaseByteBuffer(qb422016)
//line views/nav.qtpl:42
return qs422016
//line views/nav.qtpl:42
}
//line views/nav.qtpl:44
func StreamSubhyphae(qw422016 *qt422016.Writer, subhyphae string, lc *l18n.Localizer) {
//line views/nav.qtpl:44
qw422016.N().S(`
`)
//line views/nav.qtpl:45
if strings.TrimSpace(subhyphae) != "" {
//line views/nav.qtpl:45
qw422016.N().S(`
<section class="subhyphae">
<h2 class="subhyphae__title">`)
//line views/nav.qtpl:47
qw422016.E().S(lc.Get("ui.subhyphae"))
//line views/nav.qtpl:47
qw422016.N().S(`</h2>
<nav class="subhyphae__nav">
<ul class="subhyphae__list">
`)
//line views/nav.qtpl:50
qw422016.N().S(subhyphae)
//line views/nav.qtpl:50
qw422016.N().S(`
</ul>
</nav>
</section>
`)
//line views/nav.qtpl:54
}
//line views/nav.qtpl:54
qw422016.N().S(`
`)
//line views/nav.qtpl:55
}
//line views/nav.qtpl:55
func WriteSubhyphae(qq422016 qtio422016.Writer, subhyphae string, lc *l18n.Localizer) {
//line views/nav.qtpl:55
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/nav.qtpl:55
StreamSubhyphae(qw422016, subhyphae, lc)
//line views/nav.qtpl:55
qt422016.ReleaseWriter(qw422016)
//line views/nav.qtpl:55
}
//line views/nav.qtpl:55
func Subhyphae(subhyphae string, lc *l18n.Localizer) string {
//line views/nav.qtpl:55
qb422016 := qt422016.AcquireByteBuffer()
//line views/nav.qtpl:55
WriteSubhyphae(qb422016, subhyphae, lc)
//line views/nav.qtpl:55
qs422016 := string(qb422016.B)
//line views/nav.qtpl:55
qt422016.ReleaseByteBuffer(qb422016)
//line views/nav.qtpl:55
return qs422016
//line views/nav.qtpl:55
}
//line views/nav.qtpl:57
func streamcommonScripts(qw422016 *qt422016.Writer) {
//line views/nav.qtpl:57
//line views/nav.qtpl:33
qw422016.N().S(`
`)
//line views/nav.qtpl:58
//line views/nav.qtpl:34
for _, scriptPath := range cfg.CommonScripts {
//line views/nav.qtpl:58
//line views/nav.qtpl:34
qw422016.N().S(`
<script src="`)
//line views/nav.qtpl:59
//line views/nav.qtpl:35
qw422016.E().S(scriptPath)
//line views/nav.qtpl:59
//line views/nav.qtpl:35
qw422016.N().S(`"></script>
`)
//line views/nav.qtpl:60
//line views/nav.qtpl:36
}
//line views/nav.qtpl:60
//line views/nav.qtpl:36
qw422016.N().S(`
`)
//line views/nav.qtpl:61
//line views/nav.qtpl:37
}
//line views/nav.qtpl:61
//line views/nav.qtpl:37
func writecommonScripts(qq422016 qtio422016.Writer) {
//line views/nav.qtpl:61
//line views/nav.qtpl:37
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/nav.qtpl:61
//line views/nav.qtpl:37
streamcommonScripts(qw422016)
//line views/nav.qtpl:61
//line views/nav.qtpl:37
qt422016.ReleaseWriter(qw422016)
//line views/nav.qtpl:61
//line views/nav.qtpl:37
}
//line views/nav.qtpl:61
//line views/nav.qtpl:37
func commonScripts() string {
//line views/nav.qtpl:61
//line views/nav.qtpl:37
qb422016 := qt422016.AcquireByteBuffer()
//line views/nav.qtpl:61
//line views/nav.qtpl:37
writecommonScripts(qb422016)
//line views/nav.qtpl:61
//line views/nav.qtpl:37
qs422016 := string(qb422016.B)
//line views/nav.qtpl:61
//line views/nav.qtpl:37
qt422016.ReleaseByteBuffer(qb422016)
//line views/nav.qtpl:61
//line views/nav.qtpl:37
return qs422016
//line views/nav.qtpl:61
//line views/nav.qtpl:37
}

View File

@ -113,7 +113,7 @@ If you rename .prevnext, change the docs too.
{%s= hypview.NaviTitle(meta, h.CanonicalName()) %}
{% switch h.(type) %}
{% case *hyphae.EmptyHypha %}
{%= nonExistentHyphaNotice(h, meta.U, meta.Lc) %}
{%s= hypview.EmptyHypha(meta, h.CanonicalName()) %}
{% default %}
{%s= contents %}
{% endswitch %}
@ -126,13 +126,27 @@ If you rename .prevnext, change the docs too.
<a class="prevnext__el prevnext__next" href="/hypha/{%s nextHyphaName %}" rel="next">{%s util.BeautifulName(path.Base(nextHyphaName)) %} →</a>
{% endif %}
</section>
{%= Subhyphae(subhyphae, meta.Lc) %}
{% if strings.TrimSpace(subhyphae) != "" %}
<section class="subhyphae">
<h2 class="subhyphae__title">{%s lc.Get("ui.subhyphae") %}</h2>
<nav class="subhyphae__nav">
<ul class="subhyphae__list">
{%s= subhyphae %}
</ul>
</nav>
</section>
{% endif %}
<section id="hypha-bottom">
{%= hyphaInfo(meta, h) %}
</section>
</main>
{%s= categories.CategoryCard(meta, h.CanonicalName()) %}
{%= siblingHyphae(siblings, meta.Lc) %}
{% if cfg.UseSiblingHyphaeSidebar %}
<aside class="sibling-hyphae layout-card">
<h2 class="sibling-hyphae__title layout-card__title">{%s lc.Get("ui.sibling_hyphae") %}</h2>
{%s= siblings %}
</aside>
{% endif %}
{%= viewScripts() %}
{% endfunc %}

View File

@ -401,7 +401,7 @@ func StreamHypha(qw422016 *qt422016.Writer, meta viewutil.Meta, h hyphae.Hypha,
qw422016.N().S(`
`)
//line views/readers.qtpl:116
streamnonExistentHyphaNotice(qw422016, h, meta.U, meta.Lc)
qw422016.N().S(hypview.EmptyHypha(meta, h.CanonicalName()))
//line views/readers.qtpl:116
qw422016.N().S(`
`)
@ -462,177 +462,215 @@ func StreamHypha(qw422016 *qt422016.Writer, meta viewutil.Meta, h hyphae.Hypha,
</section>
`)
//line views/readers.qtpl:129
StreamSubhyphae(qw422016, subhyphae, meta.Lc)
if strings.TrimSpace(subhyphae) != "" {
//line views/readers.qtpl:129
qw422016.N().S(`
<section class="subhyphae">
<h2 class="subhyphae__title">`)
//line views/readers.qtpl:131
qw422016.E().S(lc.Get("ui.subhyphae"))
//line views/readers.qtpl:131
qw422016.N().S(`</h2>
<nav class="subhyphae__nav">
<ul class="subhyphae__list">
`)
//line views/readers.qtpl:134
qw422016.N().S(subhyphae)
//line views/readers.qtpl:134
qw422016.N().S(`
</ul>
</nav>
</section>
`)
//line views/readers.qtpl:138
}
//line views/readers.qtpl:138
qw422016.N().S(`
<section id="hypha-bottom">
`)
//line views/readers.qtpl:131
//line views/readers.qtpl:140
streamhyphaInfo(qw422016, meta, h)
//line views/readers.qtpl:131
//line views/readers.qtpl:140
qw422016.N().S(`
</section>
</main>
`)
//line views/readers.qtpl:134
//line views/readers.qtpl:143
qw422016.N().S(categories.CategoryCard(meta, h.CanonicalName()))
//line views/readers.qtpl:134
//line views/readers.qtpl:143
qw422016.N().S(`
`)
//line views/readers.qtpl:135
streamsiblingHyphae(qw422016, siblings, meta.Lc)
//line views/readers.qtpl:135
//line views/readers.qtpl:144
if cfg.UseSiblingHyphaeSidebar {
//line views/readers.qtpl:144
qw422016.N().S(`
<aside class="sibling-hyphae layout-card">
<h2 class="sibling-hyphae__title layout-card__title">`)
//line views/readers.qtpl:146
qw422016.E().S(lc.Get("ui.sibling_hyphae"))
//line views/readers.qtpl:146
qw422016.N().S(`</h2>
`)
//line views/readers.qtpl:147
qw422016.N().S(siblings)
//line views/readers.qtpl:147
qw422016.N().S(`
</aside>
`)
//line views/readers.qtpl:149
}
//line views/readers.qtpl:149
qw422016.N().S(`
`)
//line views/readers.qtpl:136
//line views/readers.qtpl:150
streamviewScripts(qw422016)
//line views/readers.qtpl:136
//line views/readers.qtpl:150
qw422016.N().S(`
`)
//line views/readers.qtpl:137
//line views/readers.qtpl:151
}
//line views/readers.qtpl:137
//line views/readers.qtpl:151
func WriteHypha(qq422016 qtio422016.Writer, meta viewutil.Meta, h hyphae.Hypha, contents string) {
//line views/readers.qtpl:137
//line views/readers.qtpl:151
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/readers.qtpl:137
//line views/readers.qtpl:151
StreamHypha(qw422016, meta, h, contents)
//line views/readers.qtpl:137
//line views/readers.qtpl:151
qt422016.ReleaseWriter(qw422016)
//line views/readers.qtpl:137
//line views/readers.qtpl:151
}
//line views/readers.qtpl:137
//line views/readers.qtpl:151
func Hypha(meta viewutil.Meta, h hyphae.Hypha, contents string) string {
//line views/readers.qtpl:137
//line views/readers.qtpl:151
qb422016 := qt422016.AcquireByteBuffer()
//line views/readers.qtpl:137
//line views/readers.qtpl:151
WriteHypha(qb422016, meta, h, contents)
//line views/readers.qtpl:137
//line views/readers.qtpl:151
qs422016 := string(qb422016.B)
//line views/readers.qtpl:137
//line views/readers.qtpl:151
qt422016.ReleaseByteBuffer(qb422016)
//line views/readers.qtpl:137
//line views/readers.qtpl:151
return qs422016
//line views/readers.qtpl:137
//line views/readers.qtpl:151
}
//line views/readers.qtpl:139
//line views/readers.qtpl:153
func StreamRevision(qw422016 *qt422016.Writer, meta viewutil.Meta, h hyphae.Hypha, contents, revHash string) {
//line views/readers.qtpl:139
//line views/readers.qtpl:153
qw422016.N().S(`
<main class="main-width">
<section>
<p>`)
//line views/readers.qtpl:142
//line views/readers.qtpl:156
qw422016.E().S(meta.Lc.Get("ui.revision_warning"))
//line views/readers.qtpl:142
//line views/readers.qtpl:156
qw422016.N().S(` <a href="/rev-text/`)
//line views/readers.qtpl:142
//line views/readers.qtpl:156
qw422016.E().S(revHash)
//line views/readers.qtpl:142
//line views/readers.qtpl:156
qw422016.N().S(`/`)
//line views/readers.qtpl:142
//line views/readers.qtpl:156
qw422016.E().S(h.CanonicalName())
//line views/readers.qtpl:142
//line views/readers.qtpl:156
qw422016.N().S(`">`)
//line views/readers.qtpl:142
//line views/readers.qtpl:156
qw422016.E().S(meta.Lc.Get("ui.revision_link"))
//line views/readers.qtpl:142
//line views/readers.qtpl:156
qw422016.N().S(`</a></p>
`)
//line views/readers.qtpl:143
//line views/readers.qtpl:157
qw422016.N().S(hypview.NaviTitle(meta, h.CanonicalName()))
//line views/readers.qtpl:143
//line views/readers.qtpl:157
qw422016.N().S(`
`)
//line views/readers.qtpl:144
//line views/readers.qtpl:158
qw422016.N().S(contents)
//line views/readers.qtpl:144
//line views/readers.qtpl:158
qw422016.N().S(`
</section>
</main>
`)
//line views/readers.qtpl:147
//line views/readers.qtpl:161
streamviewScripts(qw422016)
//line views/readers.qtpl:147
//line views/readers.qtpl:161
qw422016.N().S(`
`)
//line views/readers.qtpl:148
//line views/readers.qtpl:162
}
//line views/readers.qtpl:148
//line views/readers.qtpl:162
func WriteRevision(qq422016 qtio422016.Writer, meta viewutil.Meta, h hyphae.Hypha, contents, revHash string) {
//line views/readers.qtpl:148
//line views/readers.qtpl:162
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/readers.qtpl:148
//line views/readers.qtpl:162
StreamRevision(qw422016, meta, h, contents, revHash)
//line views/readers.qtpl:148
//line views/readers.qtpl:162
qt422016.ReleaseWriter(qw422016)
//line views/readers.qtpl:148
//line views/readers.qtpl:162
}
//line views/readers.qtpl:148
//line views/readers.qtpl:162
func Revision(meta viewutil.Meta, h hyphae.Hypha, contents, revHash string) string {
//line views/readers.qtpl:148
//line views/readers.qtpl:162
qb422016 := qt422016.AcquireByteBuffer()
//line views/readers.qtpl:148
//line views/readers.qtpl:162
WriteRevision(qb422016, meta, h, contents, revHash)
//line views/readers.qtpl:148
//line views/readers.qtpl:162
qs422016 := string(qb422016.B)
//line views/readers.qtpl:148
//line views/readers.qtpl:162
qt422016.ReleaseByteBuffer(qb422016)
//line views/readers.qtpl:148
//line views/readers.qtpl:162
return qs422016
//line views/readers.qtpl:148
//line views/readers.qtpl:162
}
//line views/readers.qtpl:150
//line views/readers.qtpl:164
func streamviewScripts(qw422016 *qt422016.Writer) {
//line views/readers.qtpl:150
//line views/readers.qtpl:164
qw422016.N().S(`
`)
//line views/readers.qtpl:151
//line views/readers.qtpl:165
for _, scriptPath := range cfg.ViewScripts {
//line views/readers.qtpl:151
//line views/readers.qtpl:165
qw422016.N().S(`
<script src="`)
//line views/readers.qtpl:152
//line views/readers.qtpl:166
qw422016.E().S(scriptPath)
//line views/readers.qtpl:152
//line views/readers.qtpl:166
qw422016.N().S(`"></script>
`)
//line views/readers.qtpl:153
//line views/readers.qtpl:167
}
//line views/readers.qtpl:153
//line views/readers.qtpl:167
qw422016.N().S(`
`)
//line views/readers.qtpl:154
//line views/readers.qtpl:168
}
//line views/readers.qtpl:154
//line views/readers.qtpl:168
func writeviewScripts(qq422016 qtio422016.Writer) {
//line views/readers.qtpl:154
//line views/readers.qtpl:168
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/readers.qtpl:154
//line views/readers.qtpl:168
streamviewScripts(qw422016)
//line views/readers.qtpl:154
//line views/readers.qtpl:168
qt422016.ReleaseWriter(qw422016)
//line views/readers.qtpl:154
//line views/readers.qtpl:168
}
//line views/readers.qtpl:154
//line views/readers.qtpl:168
func viewScripts() string {
//line views/readers.qtpl:154
//line views/readers.qtpl:168
qb422016 := qt422016.AcquireByteBuffer()
//line views/readers.qtpl:154
//line views/readers.qtpl:168
writeviewScripts(qb422016)
//line views/readers.qtpl:154
//line views/readers.qtpl:168
qs422016 := string(qb422016.B)
//line views/readers.qtpl:154
//line views/readers.qtpl:168
qt422016.ReleaseByteBuffer(qb422016)
//line views/readers.qtpl:154
//line views/readers.qtpl:168
return qs422016
//line views/readers.qtpl:154
//line views/readers.qtpl:168
}