mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-19 17:01:12 +00:00
All instances should have a `data-modal-id` now. Throw a user-friendly error if this is not the case (custom templates, or missed cases). Checked via `rg -P -e '^(?=.*delete-button)' | grep -v "data-modal-id"` Removed two instances of delete modals and one case of simplified logic. ## Rationale I am currently surveying the existing modals in Forgejo in the context of eventually replacing the modals implementation with our own modal implementation. This refactor fixes one of the many inconsistencies that the current usage of modals has. It should explicitly specify which modal should be used to avoids any problems if new modals are introduced on the page (for example via https://codeberg.org/forgejo/forgejo/pulls/8662). Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8711 Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-committed-by: Gusted <postmaster@gusted.xyz>
129 lines
6.5 KiB
Go HTML Template
129 lines
6.5 KiB
Go HTML Template
{{template "base/head" .}}
|
|
<div role="main" aria-label="{{.Title}}" class="page-content repository releases">
|
|
{{template "repo/header" .}}
|
|
<div class="ui container">
|
|
{{template "base/alert" .}}
|
|
{{template "repo/release_tag_header" .}}
|
|
<ul id="release-list">
|
|
{{range $idx, $info := .Releases}}
|
|
{{$release := $info.Release}}
|
|
<li class="ui grid">
|
|
<div class="ui four wide column meta">
|
|
<a class="muted" href="{{if not (and $release.Sha1 ($.Permission.CanRead $.UnitTypeCode))}}#{{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 $.UnitTypeCode)}}
|
|
<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>
|
|
{{template "repo/branch_dropdown" dict "root" $ "release" $release}}
|
|
{{end}}
|
|
</div>
|
|
<div class="ui twelve wide column detail">
|
|
<div class="tw-flex tw-items-center tw-justify-between tw-flex-wrap tw-mb-2">
|
|
<h4 class="release-list-title tw-break-anywhere">
|
|
<a href="{{$.RepoLink}}/releases/tag/{{$release.TagName | PathEscapeSegments}}">{{$release.Title}}</a>
|
|
{{template "repo/commit_statuses" dict "Status" $info.CommitStatus "Statuses" $info.CommitStatuses "AdditionalClasses" "tw-flex"}}
|
|
{{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>
|
|
{{else if (not $release.IsTag)}}
|
|
<span class="ui green label">{{ctx.Locale.Tr "repo.release.stable"}}</span>
|
|
{{end}}
|
|
</h4>
|
|
<div>
|
|
{{if $.CanCreateRelease}}
|
|
<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>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
<p class="text grey">
|
|
<span class="author">
|
|
{{if $release.OriginalAuthor}}
|
|
{{svg (MigrationIcon $release.Repo.GetOriginalURLHostname) 20 "tw-mr-1"}}{{$release.OriginalAuthor}}
|
|
{{else if $release.Publisher}}
|
|
{{ctx.AvatarUtils.Avatar $release.Publisher 20 "tw-mr-1"}}
|
|
<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}}
|
|
<span class="time">{{DateUtils.TimeSince $release.CreatedUnix}}</span>
|
|
{{end}}
|
|
{{if and (not $release.IsDraft) ($.Permission.CanRead $.UnitTypeCode)}}
|
|
| <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>
|
|
{{end}}
|
|
</p>
|
|
{{template "repo/tag/verification_line" (dict "ctxData" $ "release" $release)}}
|
|
<div class="markup desc">
|
|
{{$release.RenderedNote}}
|
|
</div>
|
|
{{$hasReleaseAttachment := gt (len $release.Attachments) 0}}
|
|
{{$hasArchiveLinks := and (not $.DisableDownloadSourceArchives) (not $release.IsDraft) (not $release.HideArchiveLinks) ($.Permission.CanRead $.UnitTypeCode)}}
|
|
{{if or $hasArchiveLinks $hasReleaseAttachment}}
|
|
<div class="divider"></div>
|
|
<details class="download" {{if eq $idx 0}}open{{end}}>
|
|
<summary class="tw-my-4">
|
|
{{ctx.Locale.Tr "repo.release.downloads"}}
|
|
</summary>
|
|
<ul class="list">
|
|
{{if $hasArchiveLinks}}
|
|
<li>
|
|
<a class="archive-link tw-flex-1 flex-text-inline tw-font-bold" href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.zip" rel="nofollow" type="application/zip">
|
|
{{svg "octicon-file-zip" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.release.source_code"}} (ZIP)
|
|
</a>
|
|
<div class="tw-mr-1">
|
|
<span class="text grey">{{ctx.Locale.TrN .Release.ArchiveDownloadCount.Zip "repo.release.download_count_one" "repo.release.download_count_few" (ctx.Locale.PrettyNumber .Release.ArchiveDownloadCount.Zip)}}</span>
|
|
</div>
|
|
<span data-tooltip-content="{{ctx.Locale.Tr "repo.release.system_generated"}}">
|
|
{{svg "octicon-info"}}
|
|
</span>
|
|
</li>
|
|
<li class="{{if $hasReleaseAttachment}}start-gap{{end}}">
|
|
<a class="archive-link tw-flex-1 flex-text-inline tw-font-bold" href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow" type="application/gzip">
|
|
{{svg "octicon-file-zip" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.release.source_code"}} (TAR.GZ)
|
|
</a>
|
|
<div class="tw-mr-1">
|
|
<span class="text grey">{{ctx.Locale.TrN .Release.ArchiveDownloadCount.TarGz "repo.release.download_count_one" "repo.release.download_count_few" (ctx.Locale.PrettyNumber .Release.ArchiveDownloadCount.TarGz)}}</span>
|
|
</div>
|
|
<span data-tooltip-content="{{ctx.Locale.Tr "repo.release.system_generated"}}">
|
|
{{svg "octicon-info"}}
|
|
</span>
|
|
</li>
|
|
{{if $hasReleaseAttachment}}<hr>{{end}}
|
|
{{end}}
|
|
{{range $release.Attachments}}
|
|
{{if .ExternalURL}}
|
|
<li>
|
|
<a class="tw-flex-1 flex-text-inline tw-font-bold" target="_blank" rel="nofollow" href="{{.DownloadURL}}">
|
|
{{svg "octicon-link-external" 16 "tw-mr-1"}}{{.Name}}
|
|
</a>
|
|
</li>
|
|
{{else}}
|
|
<li>
|
|
<a class="tw-flex-1 flex-text-inline tw-font-bold" target="_blank" rel="nofollow" href="{{.DownloadURL}}" download>
|
|
{{svg "octicon-package" 16 "tw-mr-1"}}{{.Name}}
|
|
</a>
|
|
<div>
|
|
<span class="text grey">{{ctx.Locale.TrN .DownloadCount "repo.release.download_count_one" "repo.release.download_count_few" (ctx.Locale.PrettyNumber .DownloadCount)}} · {{.Size | ctx.Locale.TrSize}}</span>
|
|
</div>
|
|
</li>
|
|
{{end}}
|
|
{{end}}
|
|
</ul>
|
|
</details>
|
|
{{end}}
|
|
<div class="dot"></div>
|
|
</div>
|
|
</li>
|
|
{{end}}
|
|
</ul>
|
|
|
|
{{template "base/paginate" .}}
|
|
</div>
|
|
</div>
|
|
|
|
{{template "base/footer" .}}
|