2015-11-16 04:52:46 +00:00
|
|
|
{{template "base/head" .}}
|
2023-04-25 16:29:00 +00:00
|
|
|
<div role="main" aria-label="{{.Title}}" class="page-content repository releases">
|
2015-12-07 22:30:52 +00:00
|
|
|
{{template "repo/header" .}}
|
|
|
|
<div class="ui container">
|
|
|
|
{{template "base/alert" .}}
|
2023-05-10 22:27:02 +00:00
|
|
|
{{template "repo/release_tag_header" .}}
|
2015-12-07 22:30:52 +00:00
|
|
|
<ul id="release-list">
|
2024-02-19 10:27:05 +00:00
|
|
|
{{range $idx, $info := .Releases}}
|
|
|
|
{{$release := $info.Release}}
|
2024-05-13 21:33:51 +00:00
|
|
|
<li class="release-entry">
|
|
|
|
<div class="meta">
|
2024-04-17 08:31:37 +00:00
|
|
|
<a class="muted" href="{{if not (and $release.Sha1 ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode))}}#{{else}}{{$.RepoLink}}/src/tag/{{$release.TagName | PathEscapeSegments}}{{end}}" rel="nofollow">{{svg "octicon-tag" 16 "tw-mr-1"}}{{$release.TagName}}</a>
|
|
|
|
{{if and $release.Sha1 ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}}
|
2024-03-28 08:31:07 +00:00
|
|
|
<a class="muted tw-font-mono" href="{{$.RepoLink}}/src/commit/{{$release.Sha1}}" rel="nofollow">{{svg "octicon-git-commit" 16 "tw-mr-1"}}{{ShortSha $release.Sha1}}</a>
|
2024-12-02 01:41:32 +00:00
|
|
|
{{$compareTarget := ""}}
|
|
|
|
{{if $release.IsDraft}}
|
|
|
|
{{$compareTarget = $release.Target}}
|
|
|
|
{{else if $release.TagName}}
|
|
|
|
{{$compareTarget = $release.TagName}}
|
|
|
|
{{else}}
|
|
|
|
{{$compareTarget = $release.Sha1}}
|
|
|
|
{{end}}
|
|
|
|
{{template "repo/branch_dropdown" dict
|
|
|
|
"Repository" $.Repository
|
|
|
|
"ShowTabTags" true
|
|
|
|
"DropdownFixedText" (ctx.Locale.Tr "repo.release.compare")
|
|
|
|
"RefLinkTemplate" (print "{RepoLink}/compare/{RefShortName}..." (PathEscapeSegments $compareTarget))
|
|
|
|
}}
|
2024-02-19 10:27:05 +00:00
|
|
|
{{end}}
|
2015-12-07 22:30:52 +00:00
|
|
|
</div>
|
2024-05-13 21:33:51 +00:00
|
|
|
<div class="ui segment detail">
|
Migrate margin and padding helpers to tailwind (#30043)
This will conclude the refactor of 1:1 class replacements to tailwind,
except `gt-hidden`. Commands ran:
```bash
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-0#tw-$1$2-0#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-1#tw-$1$2-0.5#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-2#tw-$1$2-1#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-3#tw-$1$2-2#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-4#tw-$1$2-4#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-5#tw-$1$2-8#g' {web_src/js,templates,routers,services}/**/*
```
2024-03-24 16:42:49 +00:00
|
|
|
<div class="tw-flex tw-items-center tw-justify-between tw-flex-wrap tw-mb-2">
|
2024-06-04 13:57:11 +00:00
|
|
|
<h4 class="release-list-title tw-break-anywhere">
|
2024-05-13 21:33:51 +00:00
|
|
|
{{if $.PageIsSingleTag}}{{$release.Title}}{{else}}<a class="muted" href="{{$.RepoLink}}/releases/tag/{{$release.TagName | PathEscapeSegments}}">{{$release.Title}}</a>{{end}}
|
2024-03-22 13:45:10 +00:00
|
|
|
{{template "repo/commit_statuses" dict "Status" $info.CommitStatus "Statuses" $info.CommitStatuses "AdditionalClasses" "tw-flex"}}
|
2024-02-19 10:27:05 +00:00
|
|
|
{{if $release.IsDraft}}
|
|
|
|
<span class="ui yellow label">{{ctx.Locale.Tr "repo.release.draft"}}</span>
|
|
|
|
{{else if $release.IsPrerelease}}
|
|
|
|
<span class="ui orange label">{{ctx.Locale.Tr "repo.release.prerelease"}}</span>
|
Fix a bug returning 404 when display a single tag with no release (#29466)
Partially caused by #29149
When use
```go
releases, err := getReleaseInfos(ctx, &repo_model.FindReleasesOptions{
ListOptions: db.ListOptions{Page: 1, PageSize: 1},
RepoID: ctx.Repo.Repository.ID,
TagNames: []string{ctx.Params("*")},
// only show draft releases for users who can write, read-only users shouldn't see draft releases.
IncludeDrafts: writeAccess,
})
```
replace
```go
release, err := repo_model.GetRelease(ctx, ctx.Repo.Repository.ID, ctx.Params("*"))
```
It missed `IncludeTags: true,`. That means this bug will be occupied only when the release is a tag.
This PR will fix
- Get the right tag record when it's not a release
- Display correct tag tab but not release tag when it's a tag.
- The button will bring the tag name to the new page when it's a single tag page
- the new page will automatically hide the release target inputbox when the tag name is pre filled. This should be backport to v1.21.
2024-03-02 14:03:39 +00:00
|
|
|
{{else if (not $release.IsTag)}}
|
2024-02-19 10:27:05 +00:00
|
|
|
<span class="ui green label">{{ctx.Locale.Tr "repo.release.stable"}}</span>
|
2019-10-05 11:09:27 +00:00
|
|
|
{{end}}
|
2024-02-19 10:27:05 +00:00
|
|
|
</h4>
|
|
|
|
<div>
|
Fix a bug returning 404 when display a single tag with no release (#29466)
Partially caused by #29149
When use
```go
releases, err := getReleaseInfos(ctx, &repo_model.FindReleasesOptions{
ListOptions: db.ListOptions{Page: 1, PageSize: 1},
RepoID: ctx.Repo.Repository.ID,
TagNames: []string{ctx.Params("*")},
// only show draft releases for users who can write, read-only users shouldn't see draft releases.
IncludeDrafts: writeAccess,
})
```
replace
```go
release, err := repo_model.GetRelease(ctx, ctx.Repo.Repository.ID, ctx.Params("*"))
```
It missed `IncludeTags: true,`. That means this bug will be occupied only when the release is a tag.
This PR will fix
- Get the right tag record when it's not a release
- Display correct tag tab but not release tag when it's a tag.
- The button will bring the tag name to the new page when it's a single tag page
- the new page will automatically hide the release target inputbox when the tag name is pre filled. This should be backport to v1.21.
2024-03-02 14:03:39 +00:00
|
|
|
{{if and $.CanCreateRelease (not $.PageIsSingleTag)}}
|
2024-02-19 10:27:05 +00:00
|
|
|
<a class="muted" data-tooltip-content="{{ctx.Locale.Tr "repo.release.edit"}}" href="{{$.RepoLink}}/releases/edit/{{$release.TagName | PathEscapeSegments}}" rel="nofollow">
|
|
|
|
{{svg "octicon-pencil"}}
|
|
|
|
</a>
|
2021-05-06 03:12:50 +00:00
|
|
|
{{end}}
|
2015-12-07 22:30:52 +00:00
|
|
|
</div>
|
2024-02-19 10:27:05 +00:00
|
|
|
</div>
|
|
|
|
<p class="text grey">
|
|
|
|
<span class="author">
|
|
|
|
{{if $release.OriginalAuthor}}
|
Migrate margin and padding helpers to tailwind (#30043)
This will conclude the refactor of 1:1 class replacements to tailwind,
except `gt-hidden`. Commands ran:
```bash
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-0#tw-$1$2-0#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-1#tw-$1$2-0.5#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-2#tw-$1$2-1#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-3#tw-$1$2-2#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-4#tw-$1$2-4#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-5#tw-$1$2-8#g' {web_src/js,templates,routers,services}/**/*
```
2024-03-24 16:42:49 +00:00
|
|
|
{{svg (MigrationIcon $release.Repo.GetOriginalURLHostname) 20 "tw-mr-1"}}{{$release.OriginalAuthor}}
|
2024-02-19 10:27:05 +00:00
|
|
|
{{else if $release.Publisher}}
|
Migrate margin and padding helpers to tailwind (#30043)
This will conclude the refactor of 1:1 class replacements to tailwind,
except `gt-hidden`. Commands ran:
```bash
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-0#tw-$1$2-0#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-1#tw-$1$2-0.5#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-2#tw-$1$2-1#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-3#tw-$1$2-2#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-4#tw-$1$2-4#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-5#tw-$1$2-8#g' {web_src/js,templates,routers,services}/**/*
```
2024-03-24 16:42:49 +00:00
|
|
|
{{ctx.AvatarUtils.Avatar $release.Publisher 20 "tw-mr-1"}}
|
2024-02-19 10:27:05 +00:00
|
|
|
<a href="{{$release.Publisher.HomeLink}}">{{$release.Publisher.GetDisplayName}}</a>
|
|
|
|
{{else}}
|
|
|
|
Ghost
|
|
|
|
{{end}}
|
|
|
|
</span>
|
|
|
|
<span class="released">
|
|
|
|
{{ctx.Locale.Tr "repo.released_this"}}
|
|
|
|
</span>
|
|
|
|
{{if $release.CreatedUnix}}
|
2024-11-04 11:30:00 +00:00
|
|
|
<span class="time">{{DateUtils.TimeSince $release.CreatedUnix}}</span>
|
2024-02-19 10:27:05 +00:00
|
|
|
{{end}}
|
2024-04-17 08:31:37 +00:00
|
|
|
{{if and (not $release.IsDraft) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}}
|
2024-02-22 18:05:47 +00:00
|
|
|
| <span class="ahead"><a href="{{$.RepoLink}}/compare/{{$release.TagName | PathEscapeSegments}}...{{$release.TargetBehind | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.release.ahead.commits" $release.NumCommitsBehind}}</a> {{ctx.Locale.Tr "repo.release.ahead.target" $release.TargetBehind}}</span>
|
2024-02-19 10:27:05 +00:00
|
|
|
{{end}}
|
|
|
|
</p>
|
|
|
|
<div class="markup desc">
|
2024-03-01 07:11:51 +00:00
|
|
|
{{$release.RenderedNote}}
|
2024-02-19 10:27:05 +00:00
|
|
|
</div>
|
|
|
|
<div class="divider"></div>
|
|
|
|
<details class="download" {{if eq $idx 0}}open{{end}}>
|
2024-05-13 21:33:51 +00:00
|
|
|
<summary>
|
2024-02-19 10:27:05 +00:00
|
|
|
{{ctx.Locale.Tr "repo.release.downloads"}}
|
|
|
|
</summary>
|
|
|
|
<ul class="list">
|
2024-04-17 08:31:37 +00:00
|
|
|
{{if and (not $.DisableDownloadSourceArchives) (not $release.IsDraft) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}}
|
2024-02-19 10:27:05 +00:00
|
|
|
<li>
|
2024-05-13 21:33:51 +00:00
|
|
|
<a class="archive-link" href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.zip" rel="nofollow"><strong>{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (ZIP)</strong></a>
|
2024-02-19 10:27:05 +00:00
|
|
|
</li>
|
|
|
|
<li>
|
2024-05-13 21:33:51 +00:00
|
|
|
<a class="archive-link" href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow"><strong>{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (TAR.GZ)</strong></a>
|
2024-02-19 10:27:05 +00:00
|
|
|
</li>
|
|
|
|
{{end}}
|
|
|
|
{{range $release.Attachments}}
|
|
|
|
<li>
|
|
|
|
<a target="_blank" rel="nofollow" href="{{.DownloadURL}}" download>
|
2024-05-13 21:33:51 +00:00
|
|
|
<strong>{{svg "octicon-package" 16 "download-icon"}}{{.Name}}</strong>
|
2024-02-19 10:27:05 +00:00
|
|
|
</a>
|
|
|
|
<div>
|
|
|
|
<span class="text grey">{{.Size | FileSize}}</span>
|
|
|
|
<span data-tooltip-content="{{ctx.Locale.Tr "repo.release.download_count" (ctx.Locale.PrettyNumber .DownloadCount)}}">
|
|
|
|
{{svg "octicon-info"}}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
{{end}}
|
|
|
|
</ul>
|
|
|
|
</details>
|
2015-12-07 22:30:52 +00:00
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
{{end}}
|
|
|
|
</ul>
|
2023-04-25 16:29:00 +00:00
|
|
|
|
2016-11-10 10:53:29 +00:00
|
|
|
{{template "base/paginate" .}}
|
2015-12-07 22:30:52 +00:00
|
|
|
</div>
|
2014-04-02 16:43:31 +00:00
|
|
|
</div>
|
2020-11-02 23:10:22 +00:00
|
|
|
|
2024-04-17 08:31:37 +00:00
|
|
|
{{if (and ($.Permission.CanWrite ctx.Consts.RepoUnitTypeCode) .PageIsTagList)}}
|
2023-04-24 11:08:59 +00:00
|
|
|
<div class="ui g-modal-confirm delete modal">
|
2023-04-23 09:24:19 +00:00
|
|
|
<div class="header">
|
|
|
|
{{svg "octicon-trash"}}
|
2023-09-25 08:56:50 +00:00
|
|
|
{{ctx.Locale.Tr "repo.release.delete_tag"}}
|
2020-11-02 23:10:22 +00:00
|
|
|
</div>
|
|
|
|
<div class="content">
|
2023-09-25 08:56:50 +00:00
|
|
|
<p>{{ctx.Locale.Tr "repo.release.deletion_tag_desc"}}</p>
|
2020-11-02 23:10:22 +00:00
|
|
|
</div>
|
2023-04-23 09:24:19 +00:00
|
|
|
{{template "base/modal_actions_confirm" .}}
|
2020-11-02 23:10:22 +00:00
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
|
2015-12-07 22:30:52 +00:00
|
|
|
{{template "base/footer" .}}
|