diff options
| author | Akshay Nair <phenax5@gmail.com> | 2026-07-05 22:37:01 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2026-07-05 22:37:01 +0530 |
| commit | 4d5182ad994c3bee390f3c21af4c43fc24428eef (patch) | |
| tree | db4f6a71520c4b948c6a48a6d27d4a4dbe1afbaf /cgit | |
| parent | c20d74cb5793d5821eadb2f96ac2e8e336e9a94a (diff) | |
| download | bacchus-remote-4d5182ad994c3bee390f3c21af4c43fc24428eef.tar.gz bacchus-remote-4d5182ad994c3bee390f3c21af4c43fc24428eef.zip | |
Add category command and styles
Diffstat (limited to '')
| -rwxr-xr-x | cgit/ssh/git-shell-commands/list | 15 | ||||
| -rwxr-xr-x | cgit/ssh/git-shell-commands/set-category | 28 | ||||
| -rw-r--r-- | cgit/static/cgit.css | 17 |
3 files changed, 41 insertions, 19 deletions
diff --git a/cgit/ssh/git-shell-commands/list b/cgit/ssh/git-shell-commands/list index 804a488..8a924c9 100755 --- a/cgit/ssh/git-shell-commands/list +++ b/cgit/ssh/git-shell-commands/list @@ -1,13 +1,8 @@ #!/usr/bin/env sh -ls -1 /git | while IPS="" read name; do - echo "$name" - printf " description: " - if [ -f "/git/${name}/description" ]; then - cat "/git/${name}/description" - else - echo "<no description>" - fi - echo "" -done +git_dir=/git + +ls -1 "$git_dir" | while IPS="" read name; do + echo "$name||||$(cat "${git_dir}/${name}/description" 2>/dev/null)" +done | column -t -d -s "||||" diff --git a/cgit/ssh/git-shell-commands/set-category b/cgit/ssh/git-shell-commands/set-category new file mode 100755 index 0000000..7f74b94 --- /dev/null +++ b/cgit/ssh/git-shell-commands/set-category @@ -0,0 +1,28 @@ +#!/usr/bin/env sh + +set -eu + +if [ $# -lt 1 ]; then + echo "Usage: set-category <name> [category]" 1>&2 + exit 1 +fi + +repo_name="$1"; +[ -z "$repo_name" ] && echo "Error: empty repo name" 1>&2 && exit 1 +(echo "$repo_name" | grep -q "^[A-Za-z0-9_-]\+$" 2>/dev/null) || (echo "Error: invalid repo name" 1>&2 && exit 1) + +category="${2:-""}"; +repo_dir="/git/${repo_name}.git" + +if ! [ -d "$repo_dir" ]; then + echo "Error: $repo_name doesn't exist" 1>&2 + exit 1; +fi + +if [ -z "$category" ]; then + git -C "$repo_dir" config unset gitweb.category +else + git -C "$repo_dir" config set gitweb.category "$category" +fi + +echo "Done" diff --git a/cgit/static/cgit.css b/cgit/static/cgit.css index 4ee370d..2fa54e2 100644 --- a/cgit/static/cgit.css +++ b/cgit/static/cgit.css @@ -173,9 +173,11 @@ div#cgit table.list tr.logheader { } div#cgit table.list tr:nth-child(even) { - background: #161616; + background: #181818; +} +div#cgit table.list tr:nth-child(odd) { + background: #121212; } -div#cgit table.list tr:nth-child(odd) { } div#cgit table.list tr:hover { background: #333; @@ -189,12 +191,8 @@ div#cgit table.list tr.nohover:hover { background: #222; } -div#cgit table.list tr.nohover-highlight:hover:nth-child(even) { - background: #f7f7f7; -} - -div#cgit table.list tr.nohover-highlight:hover:nth-child(odd) { - background: black; +div#cgit table.list tr.nohover-highlight { + background: #000; } div#cgit table.list th { @@ -618,7 +616,8 @@ div#cgit .right { div#cgit table.list td.reposection { font-style: italic; - color: #888; + color: var(--color-accent-2); + font-weight: bold; } div#cgit a.button { |
