diff --git a/views/layout/Nav.html b/views/layout/Nav.html index dfa64c53..3ba91d8a 100644 --- a/views/layout/Nav.html +++ b/views/layout/Nav.html @@ -1,5 +1,6 @@ {% import ( "fmt" + "net/http" "github.com/kyleu/rituals/app" "github.com/kyleu/rituals/app/controller/cutil" @@ -31,14 +32,17 @@ {% endfunc %} {% func NavItem(link string, title string, icon string, description string, last bool, ps *cutil.PageState) %}{% stripspace %} - {% if link != "" || last %} - {%- code extra := util.Choose(description == "", "", fmt.Sprintf(" title=%q", description)) -%} - + {% code shouldLink := link != "" || (last && ps.Method == http.MethodGet) %} + {% if shouldLink %} + {%- code extra := util.Choose(description == "", "", fmt.Sprintf(" title=%q", description)) -%} + {% endif %} + {%= components.SVGBreadcrumb(icon, ps) %} - {% if link != "" || last %} - + + {% if shouldLink %} + {% endif %} {% endstripspace %}{% endfunc %} diff --git a/views/layout/Nav.html.go b/views/layout/Nav.html.go index 04173637..77d7cf26 100644 --- a/views/layout/Nav.html.go +++ b/views/layout/Nav.html.go @@ -7,6 +7,7 @@ package layout //line views/layout/Nav.html:1 import ( "fmt" + "net/http" "github.com/kyleu/rituals/app" "github.com/kyleu/rituals/app/controller/cutil" @@ -15,324 +16,327 @@ import ( "github.com/kyleu/rituals/views/components" ) -//line views/layout/Nav.html:11 +//line views/layout/Nav.html:12 import ( qtio422016 "io" qt422016 "github.com/valyala/quicktemplate" ) -//line views/layout/Nav.html:11 +//line views/layout/Nav.html:12 var ( _ = qtio422016.Copy _ = qt422016.AcquireByteBuffer ) -//line views/layout/Nav.html:11 +//line views/layout/Nav.html:12 func StreamNav(qw422016 *qt422016.Writer, as *app.State, ps *cutil.PageState) { -//line views/layout/Nav.html:11 +//line views/layout/Nav.html:12 qw422016.N().S(` `) //line views/layout/Nav.html:31 + qw422016.N().S(``) +//line views/layout/Nav.html:32 } -//line views/layout/Nav.html:31 +//line views/layout/Nav.html:32 func WriteNav(qq422016 qtio422016.Writer, as *app.State, ps *cutil.PageState) { -//line views/layout/Nav.html:31 +//line views/layout/Nav.html:32 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/layout/Nav.html:31 +//line views/layout/Nav.html:32 StreamNav(qw422016, as, ps) -//line views/layout/Nav.html:31 +//line views/layout/Nav.html:32 qt422016.ReleaseWriter(qw422016) -//line views/layout/Nav.html:31 +//line views/layout/Nav.html:32 } -//line views/layout/Nav.html:31 +//line views/layout/Nav.html:32 func Nav(as *app.State, ps *cutil.PageState) string { -//line views/layout/Nav.html:31 +//line views/layout/Nav.html:32 qb422016 := qt422016.AcquireByteBuffer() -//line views/layout/Nav.html:31 +//line views/layout/Nav.html:32 WriteNav(qb422016, as, ps) -//line views/layout/Nav.html:31 +//line views/layout/Nav.html:32 qs422016 := string(qb422016.B) -//line views/layout/Nav.html:31 +//line views/layout/Nav.html:32 qt422016.ReleaseByteBuffer(qb422016) -//line views/layout/Nav.html:31 +//line views/layout/Nav.html:32 return qs422016 -//line views/layout/Nav.html:31 +//line views/layout/Nav.html:32 } -//line views/layout/Nav.html:33 -func StreamNavItem(qw422016 *qt422016.Writer, link string, title string, icon string, description string, last bool, ps *cutil.PageState) { //line views/layout/Nav.html:34 - if link != "" || last { +func StreamNavItem(qw422016 *qt422016.Writer, link string, title string, icon string, description string, last bool, ps *cutil.PageState) { //line views/layout/Nav.html:35 + shouldLink := link != "" || (last && ps.Method == http.MethodGet) + +//line views/layout/Nav.html:36 + if shouldLink { +//line views/layout/Nav.html:37 extra := util.Choose(description == "", "", fmt.Sprintf(" title=%q", description)) -//line views/layout/Nav.html:35 +//line views/layout/Nav.html:37 qw422016.N().S(``) -//line views/layout/Nav.html:37 +//line views/layout/Nav.html:39 } -//line views/layout/Nav.html:37 +//line views/layout/Nav.html:39 qw422016.N().S(``) -//line views/layout/Nav.html:38 +//line views/layout/Nav.html:41 components.StreamSVGBreadcrumb(qw422016, icon, ps) -//line views/layout/Nav.html:38 +//line views/layout/Nav.html:41 qw422016.N().S(` `) -//line views/layout/Nav.html:40 - if link != "" || last { -//line views/layout/Nav.html:40 +//line views/layout/Nav.html:44 + if shouldLink { +//line views/layout/Nav.html:44 qw422016.N().S(``) -//line views/layout/Nav.html:42 +//line views/layout/Nav.html:46 } -//line views/layout/Nav.html:43 +//line views/layout/Nav.html:47 } -//line views/layout/Nav.html:43 +//line views/layout/Nav.html:47 func WriteNavItem(qq422016 qtio422016.Writer, link string, title string, icon string, description string, last bool, ps *cutil.PageState) { -//line views/layout/Nav.html:43 +//line views/layout/Nav.html:47 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/layout/Nav.html:43 +//line views/layout/Nav.html:47 StreamNavItem(qw422016, link, title, icon, description, last, ps) -//line views/layout/Nav.html:43 +//line views/layout/Nav.html:47 qt422016.ReleaseWriter(qw422016) -//line views/layout/Nav.html:43 +//line views/layout/Nav.html:47 } -//line views/layout/Nav.html:43 +//line views/layout/Nav.html:47 func NavItem(link string, title string, icon string, description string, last bool, ps *cutil.PageState) string { -//line views/layout/Nav.html:43 +//line views/layout/Nav.html:47 qb422016 := qt422016.AcquireByteBuffer() -//line views/layout/Nav.html:43 +//line views/layout/Nav.html:47 WriteNavItem(qb422016, link, title, icon, description, last, ps) -//line views/layout/Nav.html:43 +//line views/layout/Nav.html:47 qs422016 := string(qb422016.B) -//line views/layout/Nav.html:43 +//line views/layout/Nav.html:47 qt422016.ReleaseByteBuffer(qb422016) -//line views/layout/Nav.html:43 +//line views/layout/Nav.html:47 return qs422016 -//line views/layout/Nav.html:43 +//line views/layout/Nav.html:47 } -//line views/layout/Nav.html:45 +//line views/layout/Nav.html:49 func StreamNavItems(qw422016 *qt422016.Writer, ps *cutil.PageState) { -//line views/layout/Nav.html:46 +//line views/layout/Nav.html:50 for idx, bc := range ps.Breadcrumbs { -//line views/layout/Nav.html:48 +//line views/layout/Nav.html:52 i := ps.Menu.GetByPath(ps.Breadcrumbs[:idx+1]) if i == nil { i = menu.ItemFromString(bc, ps.DefaultNavIcon) } -//line views/layout/Nav.html:53 +//line views/layout/Nav.html:57 components.StreamIndent(qw422016, true, 2) -//line views/layout/Nav.html:53 +//line views/layout/Nav.html:57 qw422016.N().S(`/`) -//line views/layout/Nav.html:55 +//line views/layout/Nav.html:59 components.StreamIndent(qw422016, true, 2) -//line views/layout/Nav.html:56 +//line views/layout/Nav.html:60 StreamNavItem(qw422016, i.Route, i.Title, i.Icon, i.Description, idx == len(ps.Breadcrumbs)-1, ps) -//line views/layout/Nav.html:57 +//line views/layout/Nav.html:61 } -//line views/layout/Nav.html:58 +//line views/layout/Nav.html:62 } -//line views/layout/Nav.html:58 +//line views/layout/Nav.html:62 func WriteNavItems(qq422016 qtio422016.Writer, ps *cutil.PageState) { -//line views/layout/Nav.html:58 +//line views/layout/Nav.html:62 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/layout/Nav.html:58 +//line views/layout/Nav.html:62 StreamNavItems(qw422016, ps) -//line views/layout/Nav.html:58 +//line views/layout/Nav.html:62 qt422016.ReleaseWriter(qw422016) -//line views/layout/Nav.html:58 +//line views/layout/Nav.html:62 } -//line views/layout/Nav.html:58 +//line views/layout/Nav.html:62 func NavItems(ps *cutil.PageState) string { -//line views/layout/Nav.html:58 +//line views/layout/Nav.html:62 qb422016 := qt422016.AcquireByteBuffer() -//line views/layout/Nav.html:58 +//line views/layout/Nav.html:62 WriteNavItems(qb422016, ps) -//line views/layout/Nav.html:58 +//line views/layout/Nav.html:62 qs422016 := string(qb422016.B) -//line views/layout/Nav.html:58 +//line views/layout/Nav.html:62 qt422016.ReleaseByteBuffer(qb422016) -//line views/layout/Nav.html:58 +//line views/layout/Nav.html:62 return qs422016 -//line views/layout/Nav.html:58 +//line views/layout/Nav.html:62 } -//line views/layout/Nav.html:60 +//line views/layout/Nav.html:64 func StreamProfileLink(qw422016 *qt422016.Writer, as *app.State, ps *cutil.PageState) { -//line views/layout/Nav.html:60 +//line views/layout/Nav.html:64 qw422016.N().S(``) -//line views/layout/Nav.html:62 +//line views/layout/Nav.html:66 if i := ps.Accounts.Image(); i != "" { -//line views/layout/Nav.html:62 +//line views/layout/Nav.html:66 qw422016.N().S(``) -//line views/layout/Nav.html:64 +//line views/layout/Nav.html:68 } else { -//line views/layout/Nav.html:65 +//line views/layout/Nav.html:69 components.StreamSVGSimple(qw422016, `profile`, 24, ps) -//line views/layout/Nav.html:66 +//line views/layout/Nav.html:70 } -//line views/layout/Nav.html:66 +//line views/layout/Nav.html:70 qw422016.N().S(``) -//line views/layout/Nav.html:68 +//line views/layout/Nav.html:72 } -//line views/layout/Nav.html:68 +//line views/layout/Nav.html:72 func WriteProfileLink(qq422016 qtio422016.Writer, as *app.State, ps *cutil.PageState) { -//line views/layout/Nav.html:68 +//line views/layout/Nav.html:72 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/layout/Nav.html:68 +//line views/layout/Nav.html:72 StreamProfileLink(qw422016, as, ps) -//line views/layout/Nav.html:68 +//line views/layout/Nav.html:72 qt422016.ReleaseWriter(qw422016) -//line views/layout/Nav.html:68 +//line views/layout/Nav.html:72 } -//line views/layout/Nav.html:68 +//line views/layout/Nav.html:72 func ProfileLink(as *app.State, ps *cutil.PageState) string { -//line views/layout/Nav.html:68 +//line views/layout/Nav.html:72 qb422016 := qt422016.AcquireByteBuffer() -//line views/layout/Nav.html:68 +//line views/layout/Nav.html:72 WriteProfileLink(qb422016, as, ps) -//line views/layout/Nav.html:68 +//line views/layout/Nav.html:72 qs422016 := string(qb422016.B) -//line views/layout/Nav.html:68 +//line views/layout/Nav.html:72 qt422016.ReleaseByteBuffer(qb422016) -//line views/layout/Nav.html:68 +//line views/layout/Nav.html:72 return qs422016 -//line views/layout/Nav.html:68 +//line views/layout/Nav.html:72 } diff --git a/views/vadmin/Settings.html b/views/vadmin/Settings.html index 4ae530cc..8a120f33 100644 --- a/views/vadmin/Settings.html +++ b/views/vadmin/Settings.html @@ -69,7 +69,7 @@