aboutsummaryrefslogtreecommitdiff
path: root/ui-diff.c
diff refs
from:
to:
flip
diff options
context:
space:
mode:
authorGravatar Saya Andy <saya.andy@posteo.com> 2026-09-07 14:07:24 +0700
committerGravatar Saya Andy <saya.andy@posteo.com> 2026-09-07 14:35:13 +0700
commit8f95dce3ece6eccf240ed0b994fb267bf390bf30 (patch)
tree35aeb1ecc32023777252954f7a984bce7bf47a40 /ui-diff.c
parent61aa4378441859ed2851db01d5d1b01ed1aa2458 (diff)
downloadcgitext-8f95dce3ece6eccf240ed0b994fb267bf390bf30.tar.gz
cgitext-8f95dce3ece6eccf240ed0b994fb267bf390bf30.zip
diff: split refs and other options into separate panelsv1.3.1+14
The diff controls panel mixed the from/to ref pickers with the rendering options (context, space, mode). Split it into two panels, stacked vertically: one for the refs and one for the other options, so each groups related controls.
Diffstat (limited to 'ui-diff.c')
-rw-r--r--ui-diff.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/ui-diff.c b/ui-diff.c
index ae4c9de..5ee3830 100644
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -370,12 +370,11 @@ void cgit_print_diff_ctrls(void)
{
int i, curr;
- html("<div class='cgit-panel'>");
- html("<b>diff options</b>");
- html("<form method='get'>");
+ html("<form class='diff-ctrls' method='get'>");
/*
* Emit the same hidden fields as cgit_add_hidden_formfields(), except
- * id/id2, which are carried by the ref-picker selects below.
+ * id/id2, which are carried by the ref-picker selects below. One
+ * form wraps both panels so any submission carries all controls.
*/
if (!ctx.cfg.virtual_root) {
struct strbuf url = STRBUF_INIT;
@@ -391,6 +390,8 @@ void cgit_print_diff_ctrls(void)
if (ctx.qry.showmsg)
html_hidden("showmsg", "1");
+ html("<div class='cgit-panel'>");
+ html("<b>diff refs</b>");
html("<table>");
html("<tr><td colspan='2'/></tr>");
@@ -409,6 +410,13 @@ void cgit_print_diff_ctrls(void)
cgit_print_ref_select("id", new_ref);
html("</td></tr>");
}
+ html("</table>");
+ html("</div>");
+
+ html("<div class='cgit-panel'>");
+ html("<b>diff options</b>");
+ html("<table>");
+ html("<tr><td colspan='2'/></tr>");
html("<tr>");
html("<td class='label'>context:</td>");
@@ -443,8 +451,8 @@ void cgit_print_diff_ctrls(void)
html("<tr><td/><td class='ctrl'>");
html("<noscript><input type='submit' value='reload'/></noscript>");
html("</td></tr></table>");
- html("</form>");
html("</div>");
+ html("</form>");
}
void cgit_print_diff(const char *new_rev, const char *old_rev,