commit e375b61e75f835108ca5b2c25273dae050dadb81 from: Omar Polo date: Fri Dec 01 16:51:47 2023 UTC use a detail for to show/hide the briefs' body commit - f4a88ae38cdb0a86fde9a8f465af19e7d333431e commit + e375b61e75f835108ca5b2c25273dae050dadb81 blob - c6f473ced0d7b7454f210dfaa119b63cd96d2ba4 blob + a88f4ca7b5fbc190888c0373f0b3f2c88956191d --- 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 { + display: inline; + cursor: pointer; +} + +.briefs_toggle { + display: inline-block; + padding: 3px 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 - 339562fbdadf6ba8a7901a6da2647f58c213a0bb blob + ca9d83b7efea61fee6727326f0ff8f14326ef366 --- gotwebd/pages.tmpl +++ gotwebd/pages.tmpl @@ -347,7 +347,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, @@ -385,9 +385,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++; + } !}

@@ -399,15 +402,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 }}