mirror of https://github.com/go-gitea/gitea.git
Backport #23465 Close #23427 Co-Author: @wxiaoguang If a repo's release setting is enabled, the logic has't changed. Clicking the "Tags" button will jump to `/{user}/{repo}/tags` and `templates/repo/release/list.tmpl` template will be used. <img src="https://user-images.githubusercontent.com/15528715/224939362-bd8974fd-08b0-4f79-a114-3389d15847ca.png" width="600px" /> If the release setting is disabled, clicking the "Tags" button will still jump to `/{user}/{repo}/tags` but a new template `templates/repo/tag/list.tmpl` will be used. <img src="https://user-images.githubusercontent.com/15528715/233834564-74741e49-f4e9-47c8-ac12-e306642798dc.png" width="600px" /> Since both templates above need to render the tags list, I moved the tags list to a shared template located in `templates/repo/tag/table.tmpl`.pull/24387/head
parent
d2efd2bf73
commit
e301e26d7a
@ -0,0 +1,17 @@
|
||||
{{$canReadReleases := $.Permission.CanRead $.UnitTypeReleases}}
|
||||
{{$canReadCode := $.Permission.CanRead $.UnitTypeCode}}
|
||||
|
||||
{{if $canReadReleases}}
|
||||
<h2 class="ui compact small menu header">
|
||||
<a class="{{if .PageIsReleaseList}}active {{end}}item" href="{{.RepoLink}}/releases">{{.locale.Tr "repo.release.releases"}}</a>
|
||||
{{if $canReadCode}}
|
||||
<a class="{{if .PageIsTagList}}active {{end}}item" href="{{.RepoLink}}/tags">{{.locale.Tr "repo.release.tags"}}</a>
|
||||
{{end}}
|
||||
</h2>
|
||||
|
||||
{{if .EnableFeed}}
|
||||
<a href="{{.RepoLink}}/{{if .PageIsTagList}}tags{{else}}releases{{end}}.rss"><i class="ui grey icon gt-ml-3" data-tooltip-content="{{.locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</i></a>
|
||||
{{end}}
|
||||
{{else if $canReadCode}}
|
||||
{{template "repo/sub_menu" .}}
|
||||
{{end}}
|
@ -0,0 +1,85 @@
|
||||
{{template "base/head" .}}
|
||||
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository tags">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
{{template "base/alert" .}}
|
||||
{{template "repo/sub_menu_release_tag" .}}
|
||||
|
||||
<div class="ui divider"></div>
|
||||
|
||||
<h4 class="ui top attached header">
|
||||
<div class="five wide column gt-df gt-ac">
|
||||
{{svg "octicon-tag" 16 "gt-mr-2"}}{{.locale.Tr "repo.release.tags"}}
|
||||
</div>
|
||||
</h4>
|
||||
|
||||
{{$canReadReleases := $.Permission.CanRead $.UnitTypeReleases}}
|
||||
|
||||
<div class="ui attached table segment">
|
||||
<table class="ui very basic striped fixed table single line" id="tags-table">
|
||||
<tbody class="tag-list">
|
||||
{{range $idx, $release := .Releases}}
|
||||
<tr>
|
||||
<td class="tag">
|
||||
<h3 class="release-tag-name gt-mb-3">
|
||||
{{if $canReadReleases}}
|
||||
<a class="gt-df gt-ac" href="{{$.RepoLink}}/releases/tag/{{.TagName | PathEscapeSegments}}" rel="nofollow">{{.TagName}}</a>
|
||||
{{else}}
|
||||
<a class="gt-df gt-ac" href="{{$.RepoLink}}/src/tag/{{.TagName | PathEscapeSegments}}" rel="nofollow">{{.TagName}}</a>
|
||||
{{end}}
|
||||
</h3>
|
||||
<div class="download gt-df gt-ac">
|
||||
{{if $.Permission.CanRead $.UnitTypeCode}}
|
||||
{{if .CreatedUnix}}
|
||||
<span class="gt-mr-3">{{svg "octicon-clock" 16 "gt-mr-2"}}{{TimeSinceUnix .CreatedUnix $.locale}}</span>
|
||||
{{end}}
|
||||
|
||||
<a class="gt-mr-3 gt-mono muted" href="{{$.RepoLink}}/src/commit/{{.Sha1}}" rel="nofollow">{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .Sha1}}</a>
|
||||
|
||||
{{if not $.DisableDownloadSourceArchives}}
|
||||
<a class="archive-link gt-mr-3 muted" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "gt-mr-2"}}ZIP</a>
|
||||
<a class="archive-link gt-mr-3 muted" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip" 16 "gt-mr-2"}}TAR.GZ</a>
|
||||
{{end}}
|
||||
|
||||
{{if (and $canReadReleases $.CanCreateRelease $release.IsTag)}}
|
||||
<a class="gt-mr-3 muted" href="{{$.RepoLink}}/releases/new?tag={{.TagName}}">{{svg "octicon-tag" 16 "gt-mr-2"}}{{$.locale.Tr "repo.release.new_release"}}</a>
|
||||
{{end}}
|
||||
|
||||
{{if (and ($.Permission.CanWrite $.UnitTypeCode) $release.IsTag)}}
|
||||
<a class="ui delete-button gt-mr-3 muted" data-url="{{$.RepoLink}}/tags/delete" data-id="{{.ID}}">
|
||||
{{svg "octicon-trash" 16 "gt-mr-2"}}{{$.locale.Tr "repo.release.delete_tag"}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
{{if and $canReadReleases (not $release.IsTag)}}
|
||||
<a class="gt-mr-3 muted" href="{{$.RepoLink}}/releases/tag/{{.TagName | PathEscapeSegments}}">{{svg "octicon-tag" 16 "gt-mr-2"}}{{$.locale.Tr "repo.release.detail"}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{template "base/paginate" .}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if $.Permission.CanWrite $.UnitTypeCode}}
|
||||
<div class="ui small basic delete modal">
|
||||
<div class="ui header">
|
||||
{{svg "octicon-trash" 16 "gt-mr-2"}}
|
||||
{{.locale.Tr "repo.release.delete_tag"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{.locale.Tr "repo.release.deletion_tag_desc"}}</p>
|
||||
</div>
|
||||
{{template "base/delete_modal_actions" .}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
|
||||
{{template "base/footer" .}}
|
@ -0,0 +1,151 @@
|
||||
.repository.releases #release-list {
|
||||
border-top: 1px solid var(--color-secondary);
|
||||
margin-top: 20px;
|
||||
padding-top: 15px;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.repository.releases #release-list .release-list-title {
|
||||
font-size: 2rem;
|
||||
font-weight: normal;
|
||||
margin-top: -4px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.repository.releases #release-list > li {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.repository.releases #release-list > li .meta,
|
||||
.repository.releases #release-list > li .detail {
|
||||
padding-top: 30px;
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.repository.releases #release-list > li .meta {
|
||||
text-align: right;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.repository.releases #release-list > li .meta .label {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.repository.releases #release-list > li .meta .commit {
|
||||
display: block;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.repository.releases #release-list > li .meta .choose {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.repository.releases #release-list > li .meta .choose .button {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.repository.releases #release-list > li .detail {
|
||||
border-left: 2px solid var(--color-secondary);
|
||||
}
|
||||
|
||||
.repository.releases #release-list > li .detail .author img {
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.repository.releases #release-list > li .detail .download > a .svg {
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.repository.releases #release-list > li .detail .download .list {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.repository.releases #release-list > li .detail .download .list li {
|
||||
list-style: none;
|
||||
display: block;
|
||||
padding: 8px;
|
||||
border: 1px solid var(--color-secondary);
|
||||
background: var(--color-light);
|
||||
}
|
||||
|
||||
.repository.releases #release-list > li .detail .download .list li a > .text.right {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.repository.releases #release-list > li .detail .download .list li + li {
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
.repository.releases #release-list > li .detail .download .list li:first-of-type {
|
||||
border-radius: var(--border-radius) 0 0 var(--border-radius);
|
||||
}
|
||||
|
||||
.repository.releases #release-list > li .detail .download .list li:last-of-type {
|
||||
border-radius: 0 var(--border-radius) var(--border-radius) 0;
|
||||
}
|
||||
|
||||
.repository.releases #release-list > li .detail .dot {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background-color: var(--color-secondary-dark-3);
|
||||
z-index: 9;
|
||||
position: absolute;
|
||||
display: block;
|
||||
left: -6px;
|
||||
top: 40px;
|
||||
border-radius: 100%;
|
||||
border: 2.5px solid var(--color-body);
|
||||
}
|
||||
|
||||
.repository.tags #tags-table .tag {
|
||||
padding: 8px 12px;
|
||||
}
|
||||
|
||||
.repository.tags #tags-table .release-tag-name {
|
||||
font-size: 18px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.repository.new.release .target {
|
||||
min-width: 500px;
|
||||
}
|
||||
|
||||
.repository.new.release .target #tag-name {
|
||||
margin-top: -4px;
|
||||
}
|
||||
|
||||
.repository.new.release .target .at {
|
||||
margin-left: -5px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.repository.new.release .target .selection.dropdown {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.repository.new.release .prerelease.field {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 438px) {
|
||||
.repository.new.release .field button,
|
||||
.repository.new.release .field input {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.repository.new.release .field button {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
.repository.new.release .field .wrap_remove {
|
||||
height: 38px;
|
||||
}
|
||||
|
||||
.repository.new.release .field .attachment_edit {
|
||||
width: 450px !important;
|
||||
}
|
Loading…
Reference in New Issue