commit - 8c4bc8dfd8d198e34cdf205175fd7f22669184f2
commit + 976ccb693d1bc5f0f91152b31e2d92d6e9064581
blob - 31f9fb498960381656d206eae6f5fc756707fbbf
blob + 295f7f577ee4a54a06a43cad1b73e9ef6c0fdf53
--- gotwebd/files/htdocs/gotwebd/gotweb.css
+++ gotwebd/files/htdocs/gotwebd/gotweb.css
.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
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,
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++;
+ }
!}
<div class='brief'>
<p class='brief_meta'>
{{ rc->committer }}
</span>
</p>
- <p class="briefs_log">
- <a href="{{ render gotweb_render_url(tp->tp_arg, &diff_url) }}">
- {{ rc->commit_msg }}
- </a>
- {{ if rc->refs_str }}
- {{ " " }} <span class="refs_str">({{ rc->refs_str }})</span>
- {{ end }}
- </a>
- </p>
+ {{ if body && *body != '\0' }}
+ <details class="briefs_log">
+ <summary>
+ <a href="{{ render gotweb_render_url(tp->tp_arg, &diff_url) }}">
+ {{ rc->commit_msg }}
+ </a>
+ {{ if rc->refs_str }}
+ {{ " " }} <span class="refs_str">({{ rc->refs_str }})</span>
+ {{ end }}
+ {{ " " }}
+ <span class="briefs_toggle" aria-hidden="true">
+ {{ " ⋅⋅⋅ " }}
+ </span>
+ </summary>
+ {{ "\n" }}
+ <p>{{ body }}</p>
+ </details>
+ {{ else }}
+ <p class="briefs_log">
+ <a href="{{ render gotweb_render_url(tp->tp_arg, &diff_url) }}">
+ {{ rc->commit_msg }}
+ </a>
+ {{ if rc->refs_str }}
+ {{ " " }} <span class="refs_str">({{ rc->refs_str }})</span>
+ {{ end }}
+ </p>
+ {{ end }}
</div>
<div class="navs_wrapper">
<div class="navs">