1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-01-21 07:46:52 +00:00

Rename primitive search to title search

Makes more sense, actually
This commit is contained in:
Timur Ismagilov 2021-07-12 22:05:50 +05:00
parent ba0b12a803
commit 6a26c08d02
4 changed files with 24 additions and 24 deletions

View File

@ -11,10 +11,10 @@
.modal__title_small { font-size: 1.5rem; }
.modal__confirmation-msg { margin: 0 0 .5rem 0; }
.hypha-list, .primitive-search__results { padding-left: 0; }
.hypha-list__entry, .primitive-search__entry { list-style-type: none; }
.hypha-list__link, .primitive-search__link { text-decoration: none; display: inline-block; padding: .25rem; }
.hypha-list__link:hover, .primitive-search__link:hover { text-decoration: underline; }
.hypha-list, .title-search__results { padding-left: 0; }
.hypha-list__entry, .title-search__entry { list-style-type: none; }
.hypha-list__link, .title-search__link { text-decoration: none; display: inline-block; padding: .25rem; }
.hypha-list__link:hover, .title-search__link:hover { text-decoration: underline; }
.hypha-list__amnt-type { font-size: smaller; color: #999; }
/* General element positions, from small to big */

View File

@ -23,7 +23,7 @@
{%- for _, link := range cfg.HeaderLinks -%}
<li class="header-links__entry"><a class="header-links__link" href="{%s link.Href %}">{%s link.Display %}</a></li>
{%- endfor -%}
<form class="header-links__entry header-links__search" method="GET" action="/primitive-search">
<form class="header-links__entry header-links__search" method="GET" action="/title-search">
<input type="text" name="q" placeholder="Title search" class="header-links__search-bar">
</form>
{%s= UserMenuHTML(u) %}
@ -47,15 +47,15 @@
</html>
{% endfunc %}
{% func PrimitiveSearchHTML(query string, generator func(string) <-chan string) %}
{% func TitleSearchHTML(query string, generator func(string) <-chan string) %}
<div class="layout">
<main class="main-width primitive-search">
<main class="main-width title-search">
<h1>Search results for {%s query %}</h1>
<p>Every hypha name has been compared with the query. Hyphae that have matched the query are listed below.</p>
<ul class="primitive-search__results">
<ul class="title-search__results">
{% for hyphaName := range generator(query) %}
<li class="primitive-search__entry">
<a class="primitive-search__link wikilink" href="/hypha/{%s hyphaName %}">{%s util.BeautifulName(hyphaName) %}</a>
<li class="title-search__entry">
<a class="title-search__link wikilink" href="/hypha/{%s hyphaName %}">{%s util.BeautifulName(hyphaName) %}</a>
</li>
{% endfor %}
</main>

View File

@ -80,8 +80,8 @@ func StreamBaseHTML(qw422016 *qt422016.Writer, title, body string, u *user.User,
//line views/stuff.qtpl:25
}
//line views/stuff.qtpl:25
qw422016.N().S(` <form class="header-links__entry header-links__search" method="GET" action="/primitive-search">
<input type="text" name="q" placeholder="Title search">
qw422016.N().S(` <form class="header-links__entry header-links__search" method="GET" action="/title-search">
<input type="text" name="q" placeholder="Title search" class="header-links__search-bar">
</form>
`)
//line views/stuff.qtpl:29
@ -145,25 +145,25 @@ func BaseHTML(title, body string, u *user.User, headElements ...string) string {
}
//line views/stuff.qtpl:50
func StreamPrimitiveSearchHTML(qw422016 *qt422016.Writer, query string, generator func(string) <-chan string) {
func StreamTitleSearchHTML(qw422016 *qt422016.Writer, query string, generator func(string) <-chan string) {
//line views/stuff.qtpl:50
qw422016.N().S(`
<div class="layout">
<main class="main-width primitive-search">
<main class="main-width title-search">
<h1>Search results for `)
//line views/stuff.qtpl:53
qw422016.E().S(query)
//line views/stuff.qtpl:53
qw422016.N().S(`</h1>
<p>Every hypha name has been compared with the query. Hyphae that have matched the query are listed below.</p>
<ul class="primitive-search__results">
<ul class="title-search__results">
`)
//line views/stuff.qtpl:56
for hyphaName := range generator(query) {
//line views/stuff.qtpl:56
qw422016.N().S(`
<li class="primitive-search__entry">
<a class="primitive-search__link wikilink" href="/hypha/`)
<li class="title-search__entry">
<a class="title-search__link wikilink" href="/hypha/`)
//line views/stuff.qtpl:58
qw422016.E().S(hyphaName)
//line views/stuff.qtpl:58
@ -185,22 +185,22 @@ func StreamPrimitiveSearchHTML(qw422016 *qt422016.Writer, query string, generato
}
//line views/stuff.qtpl:63
func WritePrimitiveSearchHTML(qq422016 qtio422016.Writer, query string, generator func(string) <-chan string) {
func WriteTitleSearchHTML(qq422016 qtio422016.Writer, query string, generator func(string) <-chan string) {
//line views/stuff.qtpl:63
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/stuff.qtpl:63
StreamPrimitiveSearchHTML(qw422016, query, generator)
StreamTitleSearchHTML(qw422016, query, generator)
//line views/stuff.qtpl:63
qt422016.ReleaseWriter(qw422016)
//line views/stuff.qtpl:63
}
//line views/stuff.qtpl:63
func PrimitiveSearchHTML(query string, generator func(string) <-chan string) string {
func TitleSearchHTML(query string, generator func(string) <-chan string) string {
//line views/stuff.qtpl:63
qb422016 := qt422016.AcquireByteBuffer()
//line views/stuff.qtpl:63
WritePrimitiveSearchHTML(qb422016, query, generator)
WriteTitleSearchHTML(qb422016, query, generator)
//line views/stuff.qtpl:63
qs422016 := string(qb422016.B)
//line views/stuff.qtpl:63

View File

@ -11,10 +11,10 @@ import (
)
func initSearch() {
http.HandleFunc("/primitive-search/", handlerPrimitiveSearch)
http.HandleFunc("/title-search/", handlerTitleSearch)
}
func handlerPrimitiveSearch(w http.ResponseWriter, rq *http.Request) {
func handlerTitleSearch(w http.ResponseWriter, rq *http.Request) {
util.PrepareRq(rq)
_ = rq.ParseForm()
var (
@ -25,7 +25,7 @@ func handlerPrimitiveSearch(w http.ResponseWriter, rq *http.Request) {
w,
views.BaseHTML(
"Search: "+query,
views.PrimitiveSearchHTML(query, shroom.YieldHyphaNamesContainingString),
views.TitleSearchHTML(query, shroom.YieldHyphaNamesContainingString),
u,
),
)