commit 976ccb693d1bc5f0f91152b31e2d92d6e9064581 from: Omar Polo date: Fri Dec 08 17:01:27 2023 UTC gotwebd: add foldable commit briefs with input/ok from jamsek, tracey and Kyle Ackerman, thanks! commit - 8c4bc8dfd8d198e34cdf205175fd7f22669184f2 commit + 976ccb693d1bc5f0f91152b31e2d92d6e9064581 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 - b1a49ca97e7c22bd8397d11f483959d0458f3ae4 blob + ae9add1ced0efa1b69df5c648929ad89710387a4 --- 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 }}