1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-01-05 17:40:26 +00:00

Relative hyphae→sister hyphae, where it makes sense

CSS class has changed, please update your custom styles
This commit is contained in:
Timur Ismagilov 2021-07-06 23:09:45 +05:00
parent e321c113b2
commit a4c8741f7f
8 changed files with 41 additions and 41 deletions

View File

@ -74,7 +74,7 @@ header { width: 100%; margin-bottom: 1rem; }
.layout { display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; margin: 0 1rem; row-gap: 1rem; }
.main-width { margin: 0; }
main { grid-column: 1 / span 1; grid-row: 1 / span 2; }
.relative-hyphae, .edit-toolbar { grid-column: 2 / span 1; grid-row: 1 / span 1; }
.sister-hyphae, .edit-toolbar { grid-column: 2 / span 1; grid-row: 1 / span 1; }
.layout-card { width: 100%; }
.edit-toolbar__buttons {display: grid; }
}
@ -89,7 +89,7 @@ header { width: 100%; margin-bottom: 1rem; }
.main-width { margin: 0 auto; }
.backlinks { grid-column: 1 / span 1; margin-right: 0; }
main { grid-column: 2 / span 1; }
.relative-hyphae, .edit-toolbar { grid-column: 3 / span 1; margin-left: 0; }
.sister-hyphae, .edit-toolbar { grid-column: 3 / span 1; margin-left: 0; }
.edit-toolbar__buttons { grid-template-columns: 1fr; }
.backlinks__title { text-align: right; }
@ -192,11 +192,11 @@ caption { caption-side: top; font-size: small; }
.subhyphae__link { display: block; padding: .25rem; text-decoration: none; }
.subhyphae__link:hover { background: #eee; }
.relative-hyphae__list { padding: 0; margin: 0; }
.relative-hyphae__entry { clear: both; }
.relative-hyphae__count { display: inline-block; float: right; }
.relative-hyphae__entry_this { padding: .25rem .5rem; font-weight: bold; }
.relative-hyphae__link { text-decoration: none; display: block; padding: .25rem .5rem; }
.sister-hyphae__list { padding: 0; margin: 0; }
.sister-hyphae__entry { clear: both; }
.sister-hyphae__count { display: inline-block; float: right; }
.sister-hyphae__entry_this { padding: .25rem .5rem; font-weight: bold; }
.sister-hyphae__link { text-decoration: none; display: block; padding: .25rem .5rem; }
/* Color stuff */
/* Lighter stuff #eee */
@ -254,7 +254,7 @@ blockquote { border-left: 2px #999 solid; }
.upload-amnt { border: #eee 1px solid; }
td { border: #ddd 1px solid; }
.relative-hyphae__link:hover, .backlinks__link:hover { background-color: #eee; }
.sister-hyphae__link:hover, .backlinks__link:hover { background-color: #eee; }
/* Dark theme! */
@media (prefers-color-scheme: dark) {
@ -264,7 +264,7 @@ main, article, .hypha-tabs__tab, header, .layout-card { background-color: #3434
a, .wikilink_external { color: #f1fa8c; }
a:visited, .wikilink_external:visited { color: #ffb86c; }
.wikilink_new, .wikilink_new:visited { color: #dd4444; }
.subhyphae__link:hover, .relative-hyphae__link:hover, .backlinks__link:hover { background-color: #444; }
.subhyphae__link:hover, .sister-hyphae__link:hover, .backlinks__link:hover { background-color: #444; }
.header-links__link, .header-links__link:visited,
.prevnext__el, .prevnext__el:visited { color: #ddd; }

View File

@ -87,7 +87,7 @@ func Tree(hyphaName string) (siblingsHTML, childrenHTML, prev, next string) {
for i, s := range siblings {
if s.name == hyphaName {
I = i
siblingsHTML += fmt.Sprintf(`<li class="relative-hyphae__entry relative-hyphae__entry_this"><span>%s</span></li>`, util.BeautifulName(path.Base(hyphaName)))
siblingsHTML += fmt.Sprintf(`<li class="sister-hyphae__entry sister-hyphae__entry_this"><span>%s</span></li>`, util.BeautifulName(path.Base(hyphaName)))
} else {
siblingsHTML += siblingHTML(s)
}
@ -98,7 +98,7 @@ func Tree(hyphaName string) (siblingsHTML, childrenHTML, prev, next string) {
if I != len(siblings)-1 && len(siblings) > 1 {
next = siblings[I+1].name
}
return fmt.Sprintf(`<ul class="relative-hyphae__list">%s</ul>`, siblingsHTML), subhyphaeMatrix(children), prev, next
return fmt.Sprintf(`<ul class="sister-hyphae__list">%s</ul>`, siblingsHTML), subhyphaeMatrix(children), prev, next
}
type child struct {

View File

@ -35,17 +35,17 @@ pseudographics:
{% func siblingHTML(s *sibling) %}
<li class="relative-hyphae__entry">
<a class="relative-hyphae__link" href="/hypha/{%s s.name %}">
<li class="sister-hyphae__entry">
<a class="sister-hyphae__link" href="/hypha/{%s s.name %}">
{%s util.BeautifulName(path.Base(s.name)) %}
<span class="relative-hyphae__count">
<span class="sister-hyphae__count">
{% if s.directSubhyphaeCount > 0 %}
<span class="relative-hyphae__direct-count">
<span class="sister-hyphae__direct-count">
{%d s.directSubhyphaeCount %}
</span>
{% endif %}
{% if s.indirectSubhyphaeCount > 0 %}
<span class="relative-hyphae__indirect-count">
<span class="sister-hyphae__indirect-count">
({%d s.indirectSubhyphaeCount %})
</span>
{% endif %}

View File

@ -155,8 +155,8 @@ func childHTML(c *child) string {
func streamsiblingHTML(qw422016 *qt422016.Writer, s *sibling) {
//line tree/view.qtpl:37
qw422016.N().S(`
<li class="relative-hyphae__entry">
<a class="relative-hyphae__link" href="/hypha/`)
<li class="sister-hyphae__entry">
<a class="sister-hyphae__link" href="/hypha/`)
//line tree/view.qtpl:39
qw422016.E().S(s.name)
//line tree/view.qtpl:39
@ -166,13 +166,13 @@ func streamsiblingHTML(qw422016 *qt422016.Writer, s *sibling) {
qw422016.E().S(util.BeautifulName(path.Base(s.name)))
//line tree/view.qtpl:40
qw422016.N().S(`
<span class="relative-hyphae__count">
<span class="sister-hyphae__count">
`)
//line tree/view.qtpl:42
if s.directSubhyphaeCount > 0 {
//line tree/view.qtpl:42
qw422016.N().S(`
<span class="relative-hyphae__direct-count">
<span class="sister-hyphae__direct-count">
`)
//line tree/view.qtpl:44
qw422016.N().D(s.directSubhyphaeCount)
@ -189,7 +189,7 @@ func streamsiblingHTML(qw422016 *qt422016.Writer, s *sibling) {
if s.indirectSubhyphaeCount > 0 {
//line tree/view.qtpl:47
qw422016.N().S(`
<span class="relative-hyphae__indirect-count">
<span class="sister-hyphae__indirect-count">
(`)
//line tree/view.qtpl:49
qw422016.N().D(s.indirectSubhyphaeCount)

View File

@ -64,10 +64,10 @@ var navEntries = []navEntry{
{% endif %}
{% endfunc %}
{% func RelativeHyphaeHTML(relatives string) %}
<aside class="relative-hyphae layout-card">
<h2 class="relative-hyphae__title layout-card__title">Relative hyphae</h2>
{%s= relatives %}
{% func sisterHyphaeHTML(sisters string) %}
<aside class="sister-hyphae layout-card">
<h2 class="sister-hyphae__title layout-card__title">Sister hyphae</h2>
{%s= sisters %}
</aside>
{% endfunc %}

View File

@ -233,14 +233,14 @@ func UserMenuHTML(u *user.User) string {
}
//line views/nav.qtpl:67
func StreamRelativeHyphaeHTML(qw422016 *qt422016.Writer, relatives string) {
func streamsisterHyphaeHTML(qw422016 *qt422016.Writer, sisters string) {
//line views/nav.qtpl:67
qw422016.N().S(`
<aside class="relative-hyphae layout-card">
<h2 class="relative-hyphae__title layout-card__title">Relative hyphae</h2>
<aside class="sister-hyphae layout-card">
<h2 class="sister-hyphae__title layout-card__title">Sister hyphae</h2>
`)
//line views/nav.qtpl:70
qw422016.N().S(relatives)
qw422016.N().S(sisters)
//line views/nav.qtpl:70
qw422016.N().S(`
</aside>
@ -249,22 +249,22 @@ func StreamRelativeHyphaeHTML(qw422016 *qt422016.Writer, relatives string) {
}
//line views/nav.qtpl:72
func WriteRelativeHyphaeHTML(qq422016 qtio422016.Writer, relatives string) {
func writesisterHyphaeHTML(qq422016 qtio422016.Writer, sisters string) {
//line views/nav.qtpl:72
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/nav.qtpl:72
StreamRelativeHyphaeHTML(qw422016, relatives)
streamsisterHyphaeHTML(qw422016, sisters)
//line views/nav.qtpl:72
qt422016.ReleaseWriter(qw422016)
//line views/nav.qtpl:72
}
//line views/nav.qtpl:72
func RelativeHyphaeHTML(relatives string) string {
func sisterHyphaeHTML(sisters string) string {
//line views/nav.qtpl:72
qb422016 := qt422016.AcquireByteBuffer()
//line views/nav.qtpl:72
WriteRelativeHyphaeHTML(qb422016, relatives)
writesisterHyphaeHTML(qb422016, sisters)
//line views/nav.qtpl:72
qs422016 := string(qb422016.B)
//line views/nav.qtpl:72

View File

@ -77,7 +77,7 @@
If `contents` == "", a helpful message is shown instead.
{% func HyphaHTML(rq *http.Request, h *hyphae.Hypha, contents string) %}
{% code
relatives, subhyphae, prevHyphaName, nextHyphaName := tree.Tree(h.Name)
sisters, subhyphae, prevHyphaName, nextHyphaName := tree.Tree(h.Name)
u := user.FromRequest(rq)
%}
{%= NavHTML(rq, h.Name, "hypha") %}
@ -101,14 +101,14 @@ If `contents` == "", a helpful message is shown instead.
</section>
{%= SubhyphaeHTML(subhyphae) %}
</main>
{%= RelativeHyphaeHTML(relatives) %}
{%= sisterHyphaeHTML(sisters) %}
</div>
{%= viewScripts() %}
{% endfunc %}
{% func RevisionHTML(rq *http.Request, h *hyphae.Hypha, contents, revHash string) %}
{% code
relatives, subhyphae, _, _ := tree.Tree(h.Name)
sisters, subhyphae, _, _ := tree.Tree(h.Name)
%}
{%= NavHTML(rq, h.Name, "revision", revHash) %}
<div class="layout">
@ -120,7 +120,7 @@ If `contents` == "", a helpful message is shown instead.
</article>
{%= SubhyphaeHTML(subhyphae) %}
</main>
{%= RelativeHyphaeHTML(relatives) %}
{%= sisterHyphaeHTML(sisters) %}
</div>
{%= viewScripts() %}
{% endfunc %}

View File

@ -234,7 +234,7 @@ func StreamHyphaHTML(qw422016 *qt422016.Writer, rq *http.Request, h *hyphae.Hyph
qw422016.N().S(`
`)
//line views/readers.qtpl:80
relatives, subhyphae, prevHyphaName, nextHyphaName := tree.Tree(h.Name)
sisters, subhyphae, prevHyphaName, nextHyphaName := tree.Tree(h.Name)
u := user.FromRequest(rq)
//line views/readers.qtpl:82
@ -326,7 +326,7 @@ func StreamHyphaHTML(qw422016 *qt422016.Writer, rq *http.Request, h *hyphae.Hyph
</main>
`)
//line views/readers.qtpl:104
StreamRelativeHyphaeHTML(qw422016, relatives)
streamsisterHyphaeHTML(qw422016, sisters)
//line views/readers.qtpl:104
qw422016.N().S(`
</div>
@ -371,7 +371,7 @@ func StreamRevisionHTML(qw422016 *qt422016.Writer, rq *http.Request, h *hyphae.H
qw422016.N().S(`
`)
//line views/readers.qtpl:111
relatives, subhyphae, _, _ := tree.Tree(h.Name)
sisters, subhyphae, _, _ := tree.Tree(h.Name)
//line views/readers.qtpl:112
qw422016.N().S(`
@ -403,7 +403,7 @@ func StreamRevisionHTML(qw422016 *qt422016.Writer, rq *http.Request, h *hyphae.H
</main>
`)
//line views/readers.qtpl:123
StreamRelativeHyphaeHTML(qw422016, relatives)
streamsisterHyphaeHTML(qw422016, sisters)
//line views/readers.qtpl:123
qw422016.N().S(`
</div>