commit df7661fbe80cd534a2bddad93e4d4279dd51558e from: Omar Polo via: Thomas Adam date: Sun Dec 03 21:51:13 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 - 575ccdcfa027a0819df9f362eaf787142709ce2e commit + df7661fbe80cd534a2bddad93e4d4279dd51558e blob - 8becda7103c167cf7ff999d841b159142d15372c blob + 1cff3e763111d70c8c50d451db284e850f8bd147 --- 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 }}