2021-12-30 20:16:09 +00:00
|
|
|
{% import "fmt" %}
|
|
|
|
|
2021-05-09 09:36:39 +00:00
|
|
|
{% import "github.com/bouncepaw/mycorrhiza/cfg" %}
|
2021-02-22 18:37:23 +00:00
|
|
|
{% import "github.com/bouncepaw/mycorrhiza/util" %}
|
2021-09-06 17:46:34 +00:00
|
|
|
{% import "github.com/bouncepaw/mycorrhiza/l18n" %}
|
2021-01-23 13:45:17 +00:00
|
|
|
|
2022-03-20 21:24:40 +00:00
|
|
|
{% func TitleSearch(query string, generator func(string) <-chan string, lc *l18n.Localizer) %}
|
2021-07-12 13:25:57 +00:00
|
|
|
<div class="layout">
|
2021-07-12 17:05:50 +00:00
|
|
|
<main class="main-width title-search">
|
2021-09-06 17:46:34 +00:00
|
|
|
<h1>{%s lc.Get("ui.search_results_query", &l18n.Replacements{"query": query})%}</h1>
|
|
|
|
<p>{%s lc.Get("ui.search_results_desc")%}</p>
|
2021-07-12 17:05:50 +00:00
|
|
|
<ul class="title-search__results">
|
2021-07-12 13:25:57 +00:00
|
|
|
{% for hyphaName := range generator(query) %}
|
2021-07-12 17:05:50 +00:00
|
|
|
<li class="title-search__entry">
|
|
|
|
<a class="title-search__link wikilink" href="/hypha/{%s hyphaName %}">{%s util.BeautifulName(hyphaName) %}</a>
|
2021-07-12 13:25:57 +00:00
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</main>
|
|
|
|
</div>
|
|
|
|
{% endfunc %}
|
|
|
|
|
2022-03-20 21:24:40 +00:00
|
|
|
{% func Backlinks(hyphaName string, generator func(string) <-chan string, lc *l18n.Localizer) %}
|
2021-08-31 17:27:52 +00:00
|
|
|
<div class="layout">
|
|
|
|
<main class="main-width backlinks">
|
2021-12-30 20:16:09 +00:00
|
|
|
<h1>{%s= lc.Get(
|
|
|
|
"ui.backlinks_heading",
|
|
|
|
&l18n.Replacements{
|
|
|
|
"hypha_link": fmt.Sprintf(
|
|
|
|
`<a href="/hypha/%s">%s</a>`,
|
|
|
|
hyphaName,
|
|
|
|
util.BeautifulName(hyphaName),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
)%}</h1>
|
2021-09-06 17:46:34 +00:00
|
|
|
<p>{%s lc.Get("ui.backlinks_desc")%}</p>
|
2021-08-31 17:27:52 +00:00
|
|
|
<ul class="backlinks__list">
|
2021-12-30 19:59:28 +00:00
|
|
|
{% for hyphaName := range generator(hyphaName) %}
|
2021-08-31 17:27:52 +00:00
|
|
|
<li class="backlinks__entry">
|
|
|
|
<a class="backlinks__link wikilink" href="/hypha/{%s hyphaName %}">{%s util.BeautifulName(hyphaName) %}</a>
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
2021-12-30 19:59:28 +00:00
|
|
|
</ul>
|
2021-08-31 17:27:52 +00:00
|
|
|
</main>
|
|
|
|
</div>
|
|
|
|
{% endfunc %}
|
|
|
|
|
2022-03-20 21:24:40 +00:00
|
|
|
{% func Help(content, lang string, lc *l18n.Localizer) %}
|
2021-07-12 09:58:20 +00:00
|
|
|
<div class="layout">
|
|
|
|
<main class="main-width help">
|
|
|
|
<article>
|
|
|
|
{%s= content %}
|
|
|
|
</article>
|
|
|
|
</main>
|
2022-03-20 21:24:40 +00:00
|
|
|
{%s= helpTopics(lang, lc) %}
|
2021-07-12 09:58:20 +00:00
|
|
|
</div>
|
|
|
|
{% endfunc %}
|
|
|
|
|
2022-03-20 21:24:40 +00:00
|
|
|
{% func HelpEmptyError(lc *l18n.Localizer) %}
|
2021-09-06 17:46:34 +00:00
|
|
|
<h1>{%s lc.Get("help.empty_error_title") %}</h1>
|
|
|
|
<p>{%s lc.Get("help.empty_error_line_1") %}</p>
|
|
|
|
<p>{%s lc.Get("help.empty_error_line_2a") %} <a class="wikilink wikilink_external wikilink_https" href="https://github.com/bouncepaw/mycorrhiza">{%s lc.Get("help.empty_error_link") %}</a> {%s lc.Get("help.empty_error_line_2b") %}</p>
|
2021-07-12 09:58:20 +00:00
|
|
|
{% endfunc %}
|
|
|
|
|
2022-03-22 13:40:40 +00:00
|
|
|
{% func commonScripts() %}
|
2021-07-01 09:45:29 +00:00
|
|
|
{% for _, scriptPath := range cfg.CommonScripts %}
|
2021-05-22 18:05:14 +00:00
|
|
|
<script src="{%s scriptPath %}"></script>
|
|
|
|
{% endfor %}
|
2021-06-29 10:34:36 +00:00
|
|
|
{% endfunc %}
|