commit d0b9836b2ff0ddbe37b3dea6be10afdb14b65175 from: Omar Polo date: Sun Dec 03 18:16:50 2023 UTC gotwebd: use breadcumbs in more actions Breadcumbs are useful not only in the TREE and BLOB action, but also in COMMITS/BRIEFS and BLOB. prodded by stsp@ commit - d0bb0ed648b2dd60e628937450cbaf9200beb9a6 commit + d0b9836b2ff0ddbe37b3dea6be10afdb14b65175 blob - 9e76331c9d3706b7909ec6ab013b194bc66801cc blob + bbcaa81e086ae388fea68770a80f18d48f3b28df --- gotwebd/pages.tmpl +++ gotwebd/pages.tmpl @@ -106,6 +106,7 @@ nextsep(char *s, char **t) struct querystring *qs = c->t->qs; struct gotweb_url url; const char *folder = qs->folder; + const char *action = "tree"; char *t, *s = NULL, *dir = NULL; char ch; @@ -116,6 +117,11 @@ nextsep(char *s, char **t) url.path = qs->path; url.commit = qs->commit; + if (qs->action != TREE && qs->action != BLOB) { + action = gotweb_action_name(qs->action); + url.action = qs->action; + } + if (folder && *folder != '\0') { while (*folder == '/') folder++; @@ -126,7 +132,7 @@ nextsep(char *s, char **t) } !} {{ " / " }} - tree + {{ action }} {{ " / " }} {{ if dir }} {{ while (s = nextsep(s, &t)) != NULL }} @@ -203,10 +209,11 @@ nextsep(char *s, char **t) {{ qs->path }} {{ end }} - {{ if qs->action == TREE || qs->action == BLOB }} - {{ render breadcumbs(tp) }} - {{ else if qs->action != INDEX }} + {{ if qs->action == SUMMARY || qs->action == DIFF || + qs->action == TAG || qs->action == TAGS }} {{ " / " }}{{ gotweb_action_name(qs->action) }} + {{ else if qs->action != INDEX}} + {{ render breadcumbs(tp) }} {{ end }}