diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Give an empty repository's clone table its hooks
It was a bare table.list with no name, section or label, the one
listing that broke what the README promises a theme.
| -rw-r--r-- | README.txt | 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rw-r--r-- | source/ui-empty.c | 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rwxr-xr-x | tests/t0005-markup.sh | 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3 files changed, 21 insertions, 10 deletions
@@ -80,10 +80,11 @@ script added through the css and js options has stable hooks to work with. carries an aria-label, and the active tab and the current pager link carry aria-current. * Every listing is a table.list with a second class naming it, repolist, - summary, refs, log or tree. Each section of a listing is a tbody named - repos, branches, tags, log, clone or tree, and each row carries its kind, - repo, branch, tag, commit, dir, blob, link or mod. A file row's link also - carries ext- followed by the file extension. + summary, refs, log, tree or clone, the last holding the clone urls of an + empty repository. Each section of a listing is a tbody named repos, + branches, tags, log, clone or tree, and each row carries its kind, repo, + branch, tag, commit, dir, blob, link or mod. A file row's link also carries + ext- followed by the file extension. * The commit and tag pages use table.commit-info, the trailer table is table.commit-trailers, the diffstat is table.diffstat and each file of a diff is div.file, or tbody.file in the side by side view, with the path in diff --git a/source/ui-empty.c b/source/ui-empty.c index 30887c5..deefc21 100644 --- a/source/ui-empty.c +++ b/source/ui-empty.c @@ -29,8 +29,8 @@ void cgit_print_empty_repo(void) if (!ctx.repo->clone_url && !ctx.cfg.clone_prefix) return; - html("<table class='list'>\n"); - html("<tr class='nohover'><th class='left'>Clone</th></tr>\n"); + html("<table class='list clone' aria-label='Clone urls'>\n<tbody class='clone'>\n"); + html("<tr class='nohover'><th class='left' scope='col'>Clone</th></tr>\n"); cgit_add_clone_urls(print_clone_url); - html("</table>\n"); + html("</tbody>\n</table>\n"); } diff --git a/tests/t0005-markup.sh b/tests/t0005-markup.sh index bbf78b1..e3cb08d 100755 --- a/tests/t0005-markup.sh +++ b/tests/t0005-markup.sh @@ -97,8 +97,9 @@ test_expect_success 'the stylesheet and the script name only the current hooks' ' # The rest of the hooks need a tag, a symlink, a submodule, a trailer, clone -# urls and a second page of repositories, so they get a commit and a config -# of their own after the checks above have read the first ones. +# urls, an empty repository and a second page of repositories, so they get a +# commit and a config of their own after the checks above have read the first +# ones. test_expect_success 'set up the remaining kinds of entry' ' ( cd repos/hooks && @@ -107,6 +108,7 @@ test_expect_success 'set up the remaining kinds of entry' ' git update-index --add --cacheinfo "160000,$(git rev-parse HEAD),sub" && git commit -m "more kinds of entry" -m "Fixes: $(git rev-parse --short HEAD)" ) && + git init -q --bare repos/empty.git && { echo "virtual-root=/" && echo "cache-size=0" && @@ -116,7 +118,9 @@ test_expect_success 'set up the remaining kinds of entry' ' echo "repo.url=hooks" && echo "repo.path=$PWD/repos/hooks/.git" && echo "repo.url=again" && - echo "repo.path=$PWD/repos/hooks/.git" + echo "repo.path=$PWD/repos/hooks/.git" && + echo "repo.url=empty" && + echo "repo.path=$PWD/repos/empty.git" } >morerc ' @@ -160,6 +164,12 @@ test_expect_success 'a date shown in full is a plain time element' ' ! grep "data-ut=" tmp ' +test_expect_success 'an empty repository lists its clone urls as a clone table' ' + more "empty/" >tmp && + grep "<table class=.list clone. aria-label=.Clone urls.>" tmp && + grep "<tbody class=.clone.>" tmp +' + test_expect_success 'embedded mode marks the root' ' { echo "embedded=1" && |
