diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-10-28 13:04:08 +0100 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-10-28 13:05:00 +0100 |
commit | 6a3a7a85ef2f63e88a8c96aa3ab525ce843024f9 (patch) | |
tree | 5494c2c44c0ff9bf37d0360c9081a6a92eb93e8e | |
parent | 5ce7d18d415c6911740ba15e3b4e6a1b94562019 (diff) | |
download | cerrado-6a3a7a85ef2f63e88a8c96aa3ab525ce843024f9.tar.gz cerrado-6a3a7a85ef2f63e88a8c96aa3ab525ce843024f9.tar.bz2 cerrado-6a3a7a85ef2f63e88a8c96aa3ab525ce843024f9.zip |
feat: Add login link to the header
-rw-r--r-- | scss/main.scss | 7 | ||||
-rw-r--r-- | templates/base.qtpl | 2 | ||||
-rw-r--r-- | templates/navbar.qtpl | 4 | ||||
-rw-r--r-- | templates/navbar.qtpl.go | 172 |
4 files changed, 102 insertions, 83 deletions
diff --git a/scss/main.scss b/scss/main.scss index 0766f82..b76423f 100644 --- a/scss/main.scss +++ b/scss/main.scss @@ -74,6 +74,13 @@ $utilities: ( class: me, values: map-merge($spacers, (auto: auto)) ), + "margin-start": ( + responsive: true, + property: margin-left, + class: ms, + values: map-merge($spacers, (auto: auto)) + ), + ); @import "bootstrap/scss/utilities/_api.scss"; diff --git a/templates/base.qtpl b/templates/base.qtpl index 7063829..566308f 100644 --- a/templates/base.qtpl +++ b/templates/base.qtpl @@ -43,7 +43,7 @@ Page prints a page implementing Page interface. <meta charset="utf-8"> <link rel="icon" href="data:,"> <title>{%= p.Title() %}</title> - <link rel="stylesheet" href="/static/main{%s Slug%}.css"> + <link rel="stylesheet" href="/static/main{%s Slug %}.css"> <meta content="text/html;charset=utf-8" http-equiv="Content-Type"> <meta name="viewport" content="width=device-width, initial-scale=1" /> </head> diff --git a/templates/navbar.qtpl b/templates/navbar.qtpl index 8614181..8f5f9e1 100644 --- a/templates/navbar.qtpl +++ b/templates/navbar.qtpl @@ -16,6 +16,7 @@ const ( Summary Refs Tree + Login ) %} @@ -25,6 +26,9 @@ const ( <nav class="container navbar navbar-expand"> <div class="navbar-nav"> <a class="nav-link{%= insertIfEqual(s, Git) %}" href="/">git</a> + </div> + <div class="navbar-nav ms-auto"> + <a class="nav-link{%= insertIfEqual(s, Login) %}" href="/login">login</a> {% comment %} Add this back once needed <a class="nav-link{%= insertIfEqual(s, List) %}" href="/list/">list</a> diff --git a/templates/navbar.qtpl.go b/templates/navbar.qtpl.go index ca3a320..e6ca0aa 100644 --- a/templates/navbar.qtpl.go +++ b/templates/navbar.qtpl.go @@ -36,208 +36,216 @@ const ( Summary Refs Tree + Login ) -//line templates/navbar.qtpl:22 +//line templates/navbar.qtpl:23 func streaminsertIfEqual(qw422016 *qt422016.Writer, s, d any) { -//line templates/navbar.qtpl:22 +//line templates/navbar.qtpl:23 if s == d { -//line templates/navbar.qtpl:22 +//line templates/navbar.qtpl:23 qw422016.N().S(` selected`) -//line templates/navbar.qtpl:22 +//line templates/navbar.qtpl:23 } -//line templates/navbar.qtpl:22 +//line templates/navbar.qtpl:23 } -//line templates/navbar.qtpl:22 +//line templates/navbar.qtpl:23 func writeinsertIfEqual(qq422016 qtio422016.Writer, s, d any) { -//line templates/navbar.qtpl:22 +//line templates/navbar.qtpl:23 qw422016 := qt422016.AcquireWriter(qq422016) -//line templates/navbar.qtpl:22 +//line templates/navbar.qtpl:23 streaminsertIfEqual(qw422016, s, d) -//line templates/navbar.qtpl:22 +//line templates/navbar.qtpl:23 qt422016.ReleaseWriter(qw422016) -//line templates/navbar.qtpl:22 +//line templates/navbar.qtpl:23 } -//line templates/navbar.qtpl:22 +//line templates/navbar.qtpl:23 func insertIfEqual(s, d any) string { -//line templates/navbar.qtpl:22 +//line templates/navbar.qtpl:23 qb422016 := qt422016.AcquireByteBuffer() -//line templates/navbar.qtpl:22 +//line templates/navbar.qtpl:23 writeinsertIfEqual(qb422016, s, d) -//line templates/navbar.qtpl:22 +//line templates/navbar.qtpl:23 qs422016 := string(qb422016.B) -//line templates/navbar.qtpl:22 +//line templates/navbar.qtpl:23 qt422016.ReleaseByteBuffer(qb422016) -//line templates/navbar.qtpl:22 +//line templates/navbar.qtpl:23 return qs422016 -//line templates/navbar.qtpl:22 +//line templates/navbar.qtpl:23 } -//line templates/navbar.qtpl:24 +//line templates/navbar.qtpl:25 func StreamNavbar(qw422016 *qt422016.Writer, s Selection) { -//line templates/navbar.qtpl:24 +//line templates/navbar.qtpl:25 qw422016.N().S(` <nav class="container navbar navbar-expand"> <div class="navbar-nav"> <a class="nav-link`) -//line templates/navbar.qtpl:27 +//line templates/navbar.qtpl:28 streaminsertIfEqual(qw422016, s, Git) -//line templates/navbar.qtpl:27 +//line templates/navbar.qtpl:28 qw422016.N().S(`" href="/">git</a> -`) + </div> + <div class="navbar-nav ms-auto"> + <a class="nav-link`) //line templates/navbar.qtpl:31 - qw422016.N().S(` + streaminsertIfEqual(qw422016, s, Login) +//line templates/navbar.qtpl:31 + qw422016.N().S(`" href="/">login</a> `) //line templates/navbar.qtpl:35 qw422016.N().S(` +`) +//line templates/navbar.qtpl:39 + qw422016.N().S(` </div> </nav> `) -//line templates/navbar.qtpl:38 +//line templates/navbar.qtpl:42 } -//line templates/navbar.qtpl:38 +//line templates/navbar.qtpl:42 func WriteNavbar(qq422016 qtio422016.Writer, s Selection) { -//line templates/navbar.qtpl:38 +//line templates/navbar.qtpl:42 qw422016 := qt422016.AcquireWriter(qq422016) -//line templates/navbar.qtpl:38 +//line templates/navbar.qtpl:42 StreamNavbar(qw422016, s) -//line templates/navbar.qtpl:38 +//line templates/navbar.qtpl:42 qt422016.ReleaseWriter(qw422016) -//line templates/navbar.qtpl:38 +//line templates/navbar.qtpl:42 } -//line templates/navbar.qtpl:38 +//line templates/navbar.qtpl:42 func Navbar(s Selection) string { -//line templates/navbar.qtpl:38 +//line templates/navbar.qtpl:42 qb422016 := qt422016.AcquireByteBuffer() -//line templates/navbar.qtpl:38 +//line templates/navbar.qtpl:42 WriteNavbar(qb422016, s) -//line templates/navbar.qtpl:38 +//line templates/navbar.qtpl:42 qs422016 := string(qb422016.B) -//line templates/navbar.qtpl:38 +//line templates/navbar.qtpl:42 qt422016.ReleaseByteBuffer(qb422016) -//line templates/navbar.qtpl:38 +//line templates/navbar.qtpl:42 return qs422016 -//line templates/navbar.qtpl:38 +//line templates/navbar.qtpl:42 } -//line templates/navbar.qtpl:40 +//line templates/navbar.qtpl:44 func StreamGitItemNav(qw422016 *qt422016.Writer, name, ref string, s GitSelection) { -//line templates/navbar.qtpl:40 +//line templates/navbar.qtpl:44 qw422016.N().S(` <div class="row"> <h3 id="name">`) -//line templates/navbar.qtpl:42 +//line templates/navbar.qtpl:46 qw422016.E().S(name) -//line templates/navbar.qtpl:42 +//line templates/navbar.qtpl:46 qw422016.N().S(` `) -//line templates/navbar.qtpl:42 +//line templates/navbar.qtpl:46 if ref != "" && (s == Log || s == Tree) { -//line templates/navbar.qtpl:42 +//line templates/navbar.qtpl:46 qw422016.N().S(`@ `) -//line templates/navbar.qtpl:42 +//line templates/navbar.qtpl:46 qw422016.E().S(ref) -//line templates/navbar.qtpl:42 +//line templates/navbar.qtpl:46 } -//line templates/navbar.qtpl:42 +//line templates/navbar.qtpl:46 qw422016.N().S(`</h3> </div> <div class="row"> <ul class="nav"> <li class="nav-item"> <a class="nav-link`) -//line templates/navbar.qtpl:47 +//line templates/navbar.qtpl:51 streaminsertIfEqual(qw422016, s, Readme) -//line templates/navbar.qtpl:47 +//line templates/navbar.qtpl:51 qw422016.N().S(`" aria-current="page" href="/`) -//line templates/navbar.qtpl:47 +//line templates/navbar.qtpl:51 qw422016.E().S(name) -//line templates/navbar.qtpl:47 +//line templates/navbar.qtpl:51 qw422016.N().S(`/about/">about</a> </li> <li class="nav-item"> <a class="nav-link`) -//line templates/navbar.qtpl:50 +//line templates/navbar.qtpl:54 streaminsertIfEqual(qw422016, s, Summary) -//line templates/navbar.qtpl:50 +//line templates/navbar.qtpl:54 qw422016.N().S(`" aria-current="page" href="/`) -//line templates/navbar.qtpl:50 +//line templates/navbar.qtpl:54 qw422016.E().S(name) -//line templates/navbar.qtpl:50 +//line templates/navbar.qtpl:54 qw422016.N().S(`/">summary</a> </li> <li class="nav-item"> <a class="nav-link`) -//line templates/navbar.qtpl:53 +//line templates/navbar.qtpl:57 streaminsertIfEqual(qw422016, s, Refs) -//line templates/navbar.qtpl:53 +//line templates/navbar.qtpl:57 qw422016.N().S(`" aria-current="page" href="/`) -//line templates/navbar.qtpl:53 +//line templates/navbar.qtpl:57 qw422016.E().S(name) -//line templates/navbar.qtpl:53 +//line templates/navbar.qtpl:57 qw422016.N().S(`/refs">refs</a> </li> <li class="nav-item"> <a class="nav-link`) -//line templates/navbar.qtpl:56 +//line templates/navbar.qtpl:60 streaminsertIfEqual(qw422016, s, Log) -//line templates/navbar.qtpl:56 +//line templates/navbar.qtpl:60 qw422016.N().S(`" aria-current="page" href="/`) -//line templates/navbar.qtpl:56 +//line templates/navbar.qtpl:60 qw422016.E().S(name) -//line templates/navbar.qtpl:56 +//line templates/navbar.qtpl:60 qw422016.N().S(`/log/`) -//line templates/navbar.qtpl:56 +//line templates/navbar.qtpl:60 qw422016.E().S(ref) -//line templates/navbar.qtpl:56 +//line templates/navbar.qtpl:60 qw422016.N().S(`/">log</a> </li> <li class="nav-item"> <a class="nav-link`) -//line templates/navbar.qtpl:59 +//line templates/navbar.qtpl:63 streaminsertIfEqual(qw422016, s, Tree) -//line templates/navbar.qtpl:59 +//line templates/navbar.qtpl:63 qw422016.N().S(`" aria-current="page" href="/`) -//line templates/navbar.qtpl:59 +//line templates/navbar.qtpl:63 qw422016.E().S(name) -//line templates/navbar.qtpl:59 +//line templates/navbar.qtpl:63 qw422016.N().S(`/tree/`) -//line templates/navbar.qtpl:59 +//line templates/navbar.qtpl:63 qw422016.E().S(ref) -//line templates/navbar.qtpl:59 +//line templates/navbar.qtpl:63 qw422016.N().S(`/">tree</a> </li> </ul> </div> `) -//line templates/navbar.qtpl:63 +//line templates/navbar.qtpl:67 } -//line templates/navbar.qtpl:63 +//line templates/navbar.qtpl:67 func WriteGitItemNav(qq422016 qtio422016.Writer, name, ref string, s GitSelection) { -//line templates/navbar.qtpl:63 +//line templates/navbar.qtpl:67 qw422016 := qt422016.AcquireWriter(qq422016) -//line templates/navbar.qtpl:63 +//line templates/navbar.qtpl:67 StreamGitItemNav(qw422016, name, ref, s) -//line templates/navbar.qtpl:63 +//line templates/navbar.qtpl:67 qt422016.ReleaseWriter(qw422016) -//line templates/navbar.qtpl:63 +//line templates/navbar.qtpl:67 } -//line templates/navbar.qtpl:63 +//line templates/navbar.qtpl:67 func GitItemNav(name, ref string, s GitSelection) string { -//line templates/navbar.qtpl:63 +//line templates/navbar.qtpl:67 qb422016 := qt422016.AcquireByteBuffer() -//line templates/navbar.qtpl:63 +//line templates/navbar.qtpl:67 WriteGitItemNav(qb422016, name, ref, s) -//line templates/navbar.qtpl:63 +//line templates/navbar.qtpl:67 qs422016 := string(qb422016.B) -//line templates/navbar.qtpl:63 +//line templates/navbar.qtpl:67 qt422016.ReleaseByteBuffer(qb422016) -//line templates/navbar.qtpl:63 +//line templates/navbar.qtpl:67 return qs422016 -//line templates/navbar.qtpl:63 +//line templates/navbar.qtpl:67 } |