forgejo/templates/repo/description.tmpl
Minecon724 5178d2dfd2
feat(ui): Repository description improvements
commit 15b62e9aac
Author: Minecon724 <minecon724@noreply.git.m724.eu>
Date:   Sat Sep 13 10:00:57 2025 +0000

    Show repo description if empty

commit c23300fadb
Author: Minecon724 <minecon724@noreply.git.m724.eu>
Date:   Sat Sep 13 09:57:22 2025 +0000

    Add an icon to repository link

commit 7aef45e8dd
Author: Minecon724 <minecon724@noreply.git.m724.eu>
Date:   Sat Sep 13 09:56:49 2025 +0000

    Darken No description placeholder
2025-09-13 10:02:04 +00:00

36 lines
2 KiB
Go HTML Template

<div class="tw-mb-4"> {{/* Magic number warning */}}
<div class="repo-description">
<div id="repo-desc" class="tw-break-anywhere tw-text-16">
{{$description := .Repository.DescriptionHTML $.Context}}
{{if $description}}<span class="description">{{$description | RenderCodeBlock}}</span>{{else}}<span class="no-description text-italic">{{ctx.Locale.Tr "repo.no_desc"}}</span>{{end}}
{{if .Repository.Website}}
<a class="link tw-mt-1 tw-flex tw-items-center tw-gap-1" href="{{.Repository.Website}}">{{svg "octicon-globe"}} {{.Repository.Website}}</a>
{{end}}
</div>
</div>
<div class="tw-flex tw-items-center tw-flex-wrap tw-gap-2 tw-my-2" id="repo-topics">
{{/* it should match the code in issue-home.js */}}
{{range .Topics}}
<a class="repo-topic ui large label" href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=1">{{.Name}}</a>
{{end}}
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}<button id="manage_topic" class="btn interact-fg tw-text-12">{{ctx.Locale.Tr "repo.topic.manage_topics"}}</button>{{end}}
</div>
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}
<div class="ui form tw-hidden tw-flex tw-gap-2 tw-my-3" id="topic_edit">
<div class="ui fluid multiple search selection dropdown tw-flex-wrap tw-flex-1">
<input type="hidden" name="topics" value="{{range $i, $v := .Topics}}{{.Name}}{{if Eval $i "+" 1 "<" (len $.Topics)}},{{end}}{{end}}">
{{range .Topics}}
{{/* keep the same layout as Fomantic UI generated labels */}}
<a class="ui label transition visible tw-cursor-default tw-inline-block" data-value="{{.Name}}">{{.Name}}{{svg "octicon-x" 16 "delete icon"}}</a>
{{end}}
<div class="text"></div>
</div>
<div>
<button class="ui basic button" id="cancel_topic_edit">{{ctx.Locale.Tr "cancel"}}</button>
<button class="ui primary button" id="save_topic" data-link="{{.RepoLink}}/topics">{{ctx.Locale.Tr "save"}}</button>
</div>
</div>
{{end}}
</div>