Skip to content

Commit 932d9f5

Browse files
committed
fix layout
1 parent b4ea7b5 commit 932d9f5

File tree

1 file changed

+34
-36
lines changed

1 file changed

+34
-36
lines changed

templates/repo/home_sidebar_top.tmpl

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,44 +8,42 @@
88
<div class="flex-list">
99
<div class="flex-item">
1010
<div class="flex-item-main">
11-
<div class="flex-item-title">
12-
{{ctx.Locale.Tr "repo.repo_desc"}}
13-
</div>
14-
{{if and (not .HideRepoInfo) (not .IsBlame)}}
15-
<div class="flex-item-body repo-description tw-break-anywhere tw-gap-2 tw-my-2">
16-
{{- $description := .Repository.DescriptionHTML ctx -}}
17-
{{if $description}}{{$description | RenderCodeBlock}}{{else}}{{ctx.Locale.Tr "repo.repo_no_desc"}}{{end}}
18-
</div>
19-
{{if .Repository.Website}}
20-
<a class="flex-text-block muted" href="{{.Repository.Website}}">
21-
{{svg "octicon-link"}} <span class="tw-text-primary">{{.Repository.Website}}</span>
22-
</a>
23-
{{end}}
24-
<div class="tw-flex tw-items-center tw-flex-wrap tw-gap-2 tw-my-2" id="repo-topics">
25-
{{/* !!!! it SHOULD and MUST match the code in issue-home.js */}}
26-
{{range .Topics}}<a class="repo-topic ui large label gt-ellipsis" title={{.Name}} href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=1">{{.Name}}</a>{{end}}
27-
</div>
28-
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}
29-
<button id="manage_topic" class="btn interact-fg tw-text-12">{{ctx.Locale.Tr "repo.topic.manage_topics"}}</button>
30-
{{end}}
31-
{{end}}
32-
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}
33-
<div class="ui form tw-hidden flex-item-body tw-gap-2 tw-my-2" id="topic_edit">
34-
<div class="ui fluid multiple search selection dropdown tw-flex-wrap tw-flex-1">
35-
<input type="hidden" name="topics" value="{{range $i, $v := .Topics}}{{.Name}}{{if Eval $i "+" 1 "<" (len $.Topics)}},{{end}}{{end}}">
36-
{{range .Topics}}
37-
{{/* keep the same layout as Fomantic UI generated labels */}}
38-
<a class="ui label transition visible tw-cursor-default tw-inline-block repo-topic" data-value="{{.Name}}">{{.Name}}{{svg "octicon-x" 16 "delete icon"}}</a>
39-
{{end}}
40-
<div class="text"></div>
11+
<div class="flex-item-title">{{ctx.Locale.Tr "repo.repo_desc"}}</div>
12+
<div class="flex-item-body">
13+
{{if and (not .HideRepoInfo) (not .IsBlame)}}
14+
<div class="repo-description tw-break-anywhere tw-gap-2 tw-my-2">
15+
{{- $description := .Repository.DescriptionHTML ctx -}}
16+
{{if $description}}{{$description | RenderCodeBlock}}{{else}}{{ctx.Locale.Tr "repo.repo_no_desc"}}{{end}}
4117
</div>
42-
<div>
43-
<button class="ui primary button" id="save_topic" data-link="{{.RepoLink}}/topics">{{ctx.Locale.Tr "save"}}</button>
44-
<button class="ui basic button" id="cancel_topic_edit">{{ctx.Locale.Tr "cancel"}}</button>
18+
{{if .Repository.Website}}
19+
<a class="flex-text-block muted" href="{{.Repository.Website}}">
20+
{{svg "octicon-link"}} <span class="tw-text-primary">{{.Repository.Website}}</span>
21+
</a>
22+
{{end}}
23+
<div id="repo-topics" class="flex-text-block tw-flex-wrap tw-gap-1 tw-my-2" >
24+
{{/* !!!! it SHOULD and MUST match the code in repo-home.ts */}}
25+
{{range .Topics}}<a class="repo-topic ui large label gt-ellipsis" title={{.Name}} href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=1">{{.Name}}</a>{{end}}
4526
</div>
46-
</div>
47-
{{end}}
48-
<div class="flex-item-body tw-flex tw-flex-col tw-gap-1 tw-mt-2 tw-items-start">
27+
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}
28+
<button id="manage_topic" class="btn interact-fg tw-text-12">{{ctx.Locale.Tr "repo.topic.manage_topics"}}</button>
29+
<div class="ui form tw-hidden tw-my-2" id="topic_edit">
30+
<div class="ui fluid multiple search selection dropdown tw-flex-wrap tw-flex-1">
31+
<input type="hidden" name="topics" value="{{range $i, $v := .Topics}}{{.Name}}{{if Eval $i "+" 1 "<" (len $.Topics)}},{{end}}{{end}}">
32+
{{range .Topics}}
33+
{{/* keep the same layout as Fomantic UI generated labels */}}
34+
<a class="ui label transition visible tw-cursor-default tw-inline-block repo-topic" data-value="{{.Name}}">{{.Name}}{{svg "octicon-x" 16 "delete icon"}}</a>
35+
{{end}}
36+
<div class="text"></div>
37+
</div>
38+
<div class="tw-my-2">
39+
<button class="ui primary button" id="save_topic" data-link="{{.RepoLink}}/topics">{{ctx.Locale.Tr "save"}}</button>
40+
<button class="ui basic button" id="cancel_topic_edit">{{ctx.Locale.Tr "cancel"}}</button>
41+
</div>
42+
</div>
43+
{{end}}
44+
{{end}}
45+
</div>
46+
<div class="flex-item-body tw-flex-col tw-gap-1 tw-mt-2 tw-items-start">
4947
{{if .ReadmeExist}}
5048
<a class="flex-text-block muted" href="{{.TreeLink}}/{{.FileName}}">
5149
{{svg "octicon-book"}} {{ctx.Locale.Tr "readme"}}

0 commit comments

Comments
 (0)