handle commit briefs branch display in gw_briefs instead of gw_summary
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
diff --git a/gotweb/files/htdocs/gotweb/gotweb.css b/gotweb/files/htdocs/gotweb/gotweb.css
index 33a8c27..bc35b62 100644
--- a/gotweb/files/htdocs/gotweb/gotweb.css
+++ b/gotweb/files/htdocs/gotweb/gotweb.css
@@ -57,6 +57,11 @@ body {
background-color: #d8f3ef;
}
+#refs_str {
+ background-color: #243647;
+ color: #ffffff;
+ font-style: italic;
+}
#dotted_line {
clear: left;
float: left;
diff --git a/gotweb/gotweb.c b/gotweb/gotweb.c
index 8bd2989..90aca11 100644
--- a/gotweb/gotweb.c
+++ b/gotweb/gotweb.c
@@ -1143,7 +1143,34 @@ gw_briefs(struct gw_trans *gw_trans)
kerr = khtml_puts(gw_trans->gw_html_req, n_header->commit_msg);
if (kerr != KCGI_OK)
goto done;
- kerr = khtml_closeelem(gw_trans->gw_html_req, 2);
+ kerr = khtml_closeelem(gw_trans->gw_html_req, 1);
+ if (kerr != KCGI_OK)
+ goto done;
+
+ if (n_header->refs_str) {
+ kerr = khtml_puts(gw_trans->gw_html_req, " ");
+ if (kerr != KCGI_OK)
+ goto done;
+ kerr = khtml_attr(gw_trans->gw_html_req, KELEM_SPAN,
+ KATTR_ID, "refs_str", KATTR__MAX);
+ if (kerr != KCGI_OK)
+ goto done;
+ kerr = khtml_puts(gw_trans->gw_html_req, "(");
+ if (kerr != KCGI_OK)
+ goto done;
+ kerr = khtml_puts(gw_trans->gw_html_req,
+ n_header->refs_str);
+ if (kerr != KCGI_OK)
+ goto done;
+ kerr = khtml_puts(gw_trans->gw_html_req, ")");
+ if (kerr != KCGI_OK)
+ goto done;
+ kerr = khtml_closeelem(gw_trans->gw_html_req, 1);
+ if (kerr != KCGI_OK)
+ goto done;
+ }
+
+ kerr = khtml_closeelem(gw_trans->gw_html_req, 1);
if (kerr != KCGI_OK)
goto done;
@@ -1353,17 +1380,6 @@ gw_summary(struct gw_trans *gw_trans)
kerr = khtml_puts(gw_trans->gw_html_req, "Commit Briefs");
if (kerr != KCGI_OK)
goto done;
- if (gw_trans->headref) {
- kerr = khtml_puts(gw_trans->gw_html_req, " (");
- if (kerr != KCGI_OK)
- goto done;
- kerr = khtml_puts(gw_trans->gw_html_req, gw_trans->headref);
- if (kerr != KCGI_OK)
- goto done;
- kerr = khtml_puts(gw_trans->gw_html_req, ")");
- if (kerr != KCGI_OK)
- goto done;
- }
kerr = khtml_closeelem(gw_trans->gw_html_req, 2);
if (kerr != KCGI_OK)
goto done;
@@ -2065,6 +2081,10 @@ gw_gen_commit_header(struct gw_trans *gw_trans, char *str1, char *str2)
if (kerr != KCGI_OK)
goto done;
if (str2 != NULL) {
+ kerr = khtml_attr(gw_trans->gw_html_req, KELEM_SPAN,
+ KATTR_ID, "refs_str", KATTR__MAX);
+ if (kerr != KCGI_OK)
+ goto done;
kerr = khtml_puts(gw_trans->gw_html_req, "(");
if (kerr != KCGI_OK)
goto done;
@@ -2074,6 +2094,9 @@ gw_gen_commit_header(struct gw_trans *gw_trans, char *str1, char *str2)
kerr = khtml_puts(gw_trans->gw_html_req, ")");
if (kerr != KCGI_OK)
goto done;
+ kerr = khtml_closeelem(gw_trans->gw_html_req, 1);
+ if (kerr != KCGI_OK)
+ goto done;
}
kerr = khtml_closeelem(gw_trans->gw_html_req, 1);
done:
@@ -3033,6 +3056,11 @@ gw_get_commits(struct gw_trans * gw_trans, struct gw_header *header,
error = got_error_from_errno("malloc");
goto done;
}
+ error = got_ref_list(&n_header->refs, gw_trans->repo,
+ NULL, got_ref_cmp_by_name, NULL);
+ if (error)
+ goto done;
+
error = gw_get_commit(gw_trans, n_header, commit, id);
if (error)
goto done;