WIP: kommode/gitea: display license in repo list
Some checks failed
Eval nix flake / evals (push) Has been cancelled

This commit is contained in:
Oystein Kristoffer Tveit 2025-03-17 20:37:30 +01:00
parent decd69d9ae
commit 11855f4c5f
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
2 changed files with 10 additions and 0 deletions

View File

@ -38,6 +38,10 @@ in
# Bigger icons
install -Dm444 "${cfg.package.src}/templates/repo/icon.tmpl" "$out/repo/icon.tmpl"
sed -i -e 's/24/48/g' "$out/repo/icon.tmpl"
# Show license in list view
patch -i ${./licenses-in-repo-list.diff} "${cfg.package.src}/templates/explore/repo_list.tmpl" -o repo_list.tmpl
install -Dm444 repo_list.tmpl "$out/explore/repo_list.tmpl"
'';
in ''
install -Dm444 ${logo-svg} ${cfg.customDir}/public/assets/img/logo.svg

View File

@ -0,0 +1,6 @@
33a34,38
> {{if .DetectedRepoLicenses}}
> <a class="flex-text-inline" href="{{.RepoLink}}/src/{{.Repository.DefaultBranch}}/{{PathEscapeSegments .LicenseFileName}}" title="{{StringUtils.Join .DetectedRepoLicenses ", "}}">
> {{svg "octicon-law"}} {{if eq (len .DetectedRepoLicenses) 1}}{{index .DetectedRepoLicenses 0}}{{else}}{{ctx.Locale.Tr "repo.multiple_licenses"}}{{end}}
> </a>
> {{end}}