diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Add stable markup hooks for site themes
Diffstat (limited to '')
-rw-r--r--source/ui-refs.c29
1 file changed, 17 insertions, 12 deletions
diff --git a/source/ui-refs.c b/source/ui-refs.c
index d89e3ea..e4a0dd0 100644
--- a/source/ui-refs.c
+++ b/source/ui-refs.c
@@ -79,10 +79,11 @@ static void collect_branches(struct reflist *list)
static void print_branch_header(void)
{
html(
- "<tr class='nohover'><th class='left'>Branch</th>"
- "<th class='left'>Commit message</th>"
- "<th class='left col-author'>Author</th>"
- "<th colspan='2' class='left'>Age</th></tr>\n"
+ "<tbody class='branches'>\n"
+ "<tr class='nohover'><th class='left' scope='col'>Branch</th>"
+ "<th class='left' scope='col'>Commit message</th>"
+ "<th class='left col-author' scope='col'>Author</th>"
+ "<th colspan='2' class='left' scope='col'>Age</th></tr>\n"
);
}
@@ -93,7 +94,7 @@ static int print_branch(struct refinfo *ref)
if (!info)
return 1;
- html("<tr><td>");
+ html("<tr class='branch'><td>");
cgit_log_link(name, NULL, NULL, name, NULL, NULL, 0, NULL, NULL, ctx.qry.showmsg, 0);
html("</td><td>");
@@ -128,10 +129,11 @@ static void collect_tags(struct reflist *list)
static void print_tag_header(void)
{
html(
- "<tr class='nohover'><th class='left'>Tag</th>"
- "<th class='left'>Download</th>"
- "<th class='left col-author'>Author</th>"
- "<th colspan='2' class='left'>Age</th></tr>\n"
+ "<tbody class='tags'>\n"
+ "<tr class='nohover'><th class='left' scope='col'>Tag</th>"
+ "<th class='left' scope='col'>Download</th>"
+ "<th class='left col-author' scope='col'>Author</th>"
+ "<th colspan='2' class='left' scope='col'>Age</th></tr>\n"
);
}
@@ -152,7 +154,7 @@ static int print_tag(struct refinfo *ref)
return 1;
}
- html("<tr><td>");
+ html("<tr class='tag'><td>");
cgit_tag_link(name, NULL, NULL, name);
html("</td><td>");
if (ctx.repo->snapshots && (obj->type == OBJ_COMMIT))
@@ -255,6 +257,7 @@ static void print_branches_page(int pagesize)
if (page.size < list.count)
print_ref_pager(page.start, page.size, list.count, "heads");
+ html("</tbody>\n");
cgit_free_reflist_inner(&list);
}
@@ -278,6 +281,7 @@ static void print_tags_page(int pagesize)
if (page.size < list.count)
print_ref_pager(page.start, page.size, list.count, "tags");
+ html("</tbody>\n");
cgit_free_reflist_inner(&list);
}
@@ -305,6 +309,7 @@ void cgit_print_branches(int maxcount)
if (maxcount < list.count)
print_refs_link("heads");
+ html("</tbody>\n");
cgit_free_reflist_inner(&list);
}
@@ -328,6 +333,7 @@ void cgit_print_tags(int maxcount)
if (maxcount < list.count)
print_refs_link("tags");
+ html("</tbody>\n");
cgit_free_reflist_inner(&list);
}
@@ -335,7 +341,7 @@ void cgit_print_tags(int maxcount)
void cgit_print_refs(void)
{
cgit_print_layout_start();
- html("<table class='list'>\n");
+ html("<table class='list refs' aria-label='Branches and tags'>\n");
if (ctx.qry.path && starts_with(ctx.qry.path, "heads")) {
print_branches_page(ctx.cfg.max_ref_count);
@@ -343,7 +349,6 @@ void cgit_print_refs(void)
print_tags_page(ctx.cfg.max_ref_count);
} else {
cgit_print_branches(ctx.cfg.max_ref_count);
- html("<tr class='nohover'><td colspan='5'></td></tr>\n");
cgit_print_tags(ctx.cfg.max_ref_count);
}
html("</table>\n");