|
3 | 3 | <div class="flex-item-title"> |
4 | 4 | {{ctx.Locale.Tr "repo.repo_desc"}} |
5 | 5 | </div> |
6 | | - {{if and (not .HideRepoInfo) (not .IsBlame)}} |
| 6 | + {{if and (not .ctxData.HideRepoInfo) (not .ctxData.IsBlame)}} |
7 | 7 | <div class="flex-item-body repo-description tw-break-anywhere tw-gap-2 tw-mt-2"> |
8 | | - {{- $description := .Repository.DescriptionHTML ctx -}} |
| 8 | + {{- $description := .ctxData.Repository.DescriptionHTML ctx -}} |
9 | 9 | {{if $description}}{{$description | RenderCodeBlock}}{{else}}{{ctx.Locale.Tr "repo.repo_no_desc"}}{{end}} |
10 | | - {{if .Repository.Website}}{{svg "octicon-link"}}<a href="{{.Repository.Website}}">{{.Repository.Website}}</a>{{end}} |
| 10 | + {{if .ctxData.Repository.Website}}{{svg "octicon-link"}}<a href="{{.ctxData.Repository.Website}}">{{.ctxData.Repository.Website}}</a>{{end}} |
11 | 11 | </div> |
12 | | - <div class="tw-flex tw-items-center tw-flex-wrap tw-gap-2 tw-my-2" id="repo-topics"> |
| 12 | + <div class="tw-flex tw-items-center tw-flex-wrap tw-gap-2 tw-my-2" id="repo-topics-{{.viewType}}"> |
13 | 13 | {{/* it should match the code in issue-home.js */}} |
14 | | - {{range .Topics}}<a class="repo-topic ui large label gt-ellipsis" title={{.Name}} href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=1">{{.Name}}</a>{{end}} |
| 14 | + {{range .ctxData.Topics}}<a class="repo-topic ui large label gt-ellipsis" title={{.Name}} href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=1">{{.Name}}</a>{{end}} |
15 | 15 | </div> |
16 | | - {{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}} |
| 16 | + {{if and .ctxData.Permission.IsAdmin (not .ctxData.Repository.IsArchived)}}<button id="manage_topic_{{.viewType}}" class="btn interact-fg tw-text-12">{{ctx.Locale.Tr "repo.topic.manage_topics"}}</button>{{end}} |
17 | 17 | {{end}} |
18 | | - {{if and .Permission.IsAdmin (not .Repository.IsArchived)}} |
19 | | - <div class="ui form tw-hidden flex-item-body tw-gap-2 tw-my-2" id="topic_edit"> |
| 18 | + {{if and .ctxData.Permission.IsAdmin (not .ctxData.Repository.IsArchived)}} |
| 19 | + <div class="ui form tw-hidden flex-item-body tw-gap-2 tw-my-2" id="topic_edit_{{.viewType}}"> |
20 | 20 | <div class="ui fluid multiple search selection dropdown tw-flex-wrap tw-flex-1"> |
21 | | - <input type="hidden" name="topics" value="{{range $i, $v := .Topics}}{{.Name}}{{if Eval $i "+" 1 "<" (len $.Topics)}},{{end}}{{end}}"> |
22 | | - {{range .Topics}} |
| 21 | + <input type="hidden" name="topics" value="{{range $i, $v := .ctxData.Topics}}{{.Name}}{{if Eval $i "+" 1 "<" (len $.ctxData.Topics)}},{{end}}{{end}}"> |
| 22 | + {{range .ctxData.Topics}} |
23 | 23 | {{/* keep the same layout as Fomantic UI generated labels */}} |
24 | 24 | <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> |
25 | 25 | {{end}} |
26 | 26 | <div class="text"></div> |
27 | 27 | </div> |
28 | 28 | <div> |
29 | | - <button class="ui primary button" id="save_topic" data-link="{{.RepoLink}}/topics">{{ctx.Locale.Tr "save"}}</button> |
30 | | - <button class="ui basic button" id="cancel_topic_edit">{{ctx.Locale.Tr "cancel"}}</button> |
| 29 | + <button class="ui primary button" id="save_topic_{{.viewType}}" data-link="{{.ctxData.RepoLink}}/topics">{{ctx.Locale.Tr "save"}}</button> |
| 30 | + <button class="ui basic button" id="cancel_topic_edit_{{.viewType}}">{{ctx.Locale.Tr "cancel"}}</button> |
31 | 31 | </div> |
32 | 32 | </div> |
33 | 33 | {{end}} |
34 | | - {{if .ReadmeExist}} |
| 34 | + {{if .ctxData.ReadmeExist}} |
35 | 35 | <div class="flex-item-body tw-mt-2"> |
36 | | - <a class="tw-flex tw-items-center tw-gap-2 muted" href="{{.TreeLink}}/{{.FileName}}"> |
| 36 | + <a class="tw-flex tw-items-center tw-gap-2 muted" href="{{.ctxData.TreeLink}}/{{.ctxData.FileName}}"> |
37 | 37 | {{svg "octicon-book"}}{{ctx.Locale.Tr "readme"}} |
38 | 38 | </a> |
39 | 39 | </div> |
40 | 40 | {{end}} |
41 | | - {{if .DetectedRepoLicenses}} |
| 41 | + {{if .ctxData.DetectedRepoLicenses}} |
42 | 42 | <div class="flex-item-body"> |
43 | | - <a class="tw-flex tw-items-center tw-gap-2 muted" href="{{.RepoLink}}/src/{{.Repository.DefaultBranch}}/{{PathEscapeSegments .LicenseFileName}}" data-tooltip-placement="top" data-tooltip-content="{{StringUtils.Join .DetectedRepoLicenses ", "}}"> |
44 | | - {{svg "octicon-law"}}{{if eq (len .DetectedRepoLicenses) 1}}{{index .DetectedRepoLicenses 0}}{{else}}{{ctx.Locale.Tr "repo.multiple_licenses"}}{{end}} |
| 43 | + <a class="tw-flex tw-items-center tw-gap-2 muted" href="{{.ctxData.RepoLink}}/src/{{.ctxData.Repository.DefaultBranch}}/{{PathEscapeSegments .ctxData.LicenseFileName}}" data-tooltip-placement="top" data-tooltip-content="{{StringUtils.Join .ctxData.DetectedRepoLicenses ", "}}"> |
| 44 | + {{svg "octicon-law"}}{{if eq (len .ctxData.DetectedRepoLicenses) 1}}{{index .ctxData.DetectedRepoLicenses 0}}{{else}}{{ctx.Locale.Tr "repo.multiple_licenses"}}{{end}} |
45 | 45 | </a> |
46 | 46 | </div> |
47 | 47 | {{end}} |
48 | | - {{if .CitiationExist}} |
| 48 | + {{if .ctxData.CitiationExist}} |
49 | 49 | <div class="flex-item-body"> |
50 | | - <a class="tw-flex tw-items-center tw-gap-2 muted" id="cite-repo-button"> |
| 50 | + <a class="tw-flex tw-items-center tw-gap-2 muted" id="cite-repo-button-{{.viewType}}"> |
51 | 51 | {{svg "octicon-cross-reference"}}{{ctx.Locale.Tr "repo.cite_this_repo"}} |
52 | 52 | </a> |
53 | 53 | </div> |
|
0 commit comments