commit 1154d0c0f452240fdb333aa24b55166fc6bbed16 from: Omar Polo via: Thomas Adam date: Sat Dec 09 13:03:00 2023 UTC gotwebd: add foldable commit briefs with input/ok from jamsek, tracey and Kyle Ackerman, thanks! commit - d3b1ab82b4b7356f06f46106aff4fb3d570e39b4 commit + 1154d0c0f452240fdb333aa24b55166fc6bbed16 blob - 31f9fb498960381656d206eae6f5fc756707fbbf blob + 295f7f577ee4a54a06a43cad1b73e9ef6c0fdf53 --- gotwebd/files/htdocs/gotwebd/gotweb.css +++ gotwebd/files/htdocs/gotwebd/gotweb.css @@ -211,6 +211,24 @@ header.subtitle h2 { .briefs_log { width: auto; } +} + +.briefs_log summary { + cursor: pointer; +} + +.briefs_toggle { + display: inline-block; + padding: 3px 4px; + padding: 0px 4px; + border: 1px solid #222; + border-radius: 3px; + user-select: none; +} + +/* work around .commits being unusable here */ +.briefs_log > p { + white-space: pre-wrap; } .tag_age, .tag_name, .tag_log { blob - 163adf4f079d9ab05eb872f6ff25606766c646d7 blob + a55f8da771b11abd364a24ae8e9f6fc22975d62c --- gotwebd/pages.tmpl +++ gotwebd/pages.tmpl @@ -355,7 +355,7 @@ nextsep(char *s, char **t) struct repo_commit *rc; struct repo_dir *repo_dir = t->repo_dir; struct gotweb_url diff_url, patch_url, tree_url; - char *tmp; + char *tmp, *body; diff_url = (struct gotweb_url){ .action = DIFF, @@ -393,9 +393,12 @@ nextsep(char *s, char **t) if (tmp) *tmp = '\0'; - tmp = strchr(rc->commit_msg, '\n'); - if (tmp) - *tmp = '\0'; + body = strchr(rc->commit_msg, '\n'); + if (body) { + *body++ = '\0'; + while (*body == '\n') + body++; + } !}

@@ -407,15 +410,33 @@ nextsep(char *s, char **t) {{ rc->committer }}

-

- - {{ rc->commit_msg }} - - {{ if rc->refs_str }} - {{ " " }} ({{ rc->refs_str }}) - {{ end }} - -

+ {{ if body && *body != '\0' }} +
+ + + {{ rc->commit_msg }} + + {{ if rc->refs_str }} + {{ " " }} ({{ rc->refs_str }}) + {{ end }} + {{ " " }} + + + {{ "\n" }} +

{{ body }}

+
+ {{ else }} +

+ + {{ rc->commit_msg }} + + {{ if rc->refs_str }} + {{ " " }} ({{ rc->refs_str }}) + {{ end }} +

+ {{ end }}