mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-03 19:43:25 +09:00
fix: correct repo/attatchment absolute url and release layout (#39178)
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
{{$attachments := index $.Page.issuesAttachmentMap .ID}}
|
||||
{{if $attachments}}
|
||||
<div class="card-attachment-images">
|
||||
{{range $attachments}}
|
||||
<img loading="lazy" src="{{.DownloadURL}}" alt="{{.Name}}" />
|
||||
{{range $att := $attachments}}
|
||||
<img loading="lazy" src="{{$att.DownloadURL ctx}}" alt="{{$att.Name}}" />
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
@@ -3,23 +3,23 @@
|
||||
<div class="divider"></div>
|
||||
{{end}}
|
||||
{{$hasThumbnails := false}}
|
||||
{{- range .Attachments -}}
|
||||
{{- range $att := .Attachments -}}
|
||||
<div class="tw-flex">
|
||||
<div class="tw-flex-1 tw-p-2">
|
||||
<a target="_blank" href="{{.DownloadURL}}" title="{{ctx.Locale.Tr "repo.issues.attachment.open_tab" .Name}}">
|
||||
{{if FilenameIsImage .Name}}
|
||||
{{if not (StringUtils.Contains (StringUtils.ToString $.RenderedContent) .UUID)}}
|
||||
<a target="_blank" href="{{$att.DownloadURL ctx}}" title="{{ctx.Locale.Tr "repo.issues.attachment.open_tab" $att.Name}}">
|
||||
{{if FilenameIsImage $att.Name}}
|
||||
{{if not (StringUtils.Contains (StringUtils.ToString $.RenderedContent) $att.UUID)}}
|
||||
{{$hasThumbnails = true}}
|
||||
{{end}}
|
||||
{{svg "octicon-file"}}
|
||||
{{else}}
|
||||
{{svg "octicon-desktop-download"}}
|
||||
{{end}}
|
||||
<span><strong>{{.Name}}</strong></span>
|
||||
<span><strong>{{$att.Name}}</strong></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="flex-text-block tw-p-2">
|
||||
<span class="ui tw-text-text-light">{{.Size | FormatByteSize}}</span>
|
||||
<span class="ui tw-text-text-light">{{$att.Size | FormatByteSize}}</span>
|
||||
</div>
|
||||
</div>
|
||||
{{end -}}
|
||||
@@ -30,8 +30,8 @@
|
||||
{{- range .Attachments -}}
|
||||
{{if FilenameIsImage .Name}}
|
||||
{{if not (StringUtils.Contains (StringUtils.ToString $.RenderedContent) .UUID)}}
|
||||
<a target="_blank" href="{{.DownloadURL}}">
|
||||
<img loading="lazy" alt="{{.Name}}" src="{{.DownloadURL}}" title="{{ctx.Locale.Tr "repo.issues.attachment.open_tab" .Name}}">
|
||||
<a target="_blank" href="{{.DownloadURL ctx}}">
|
||||
<img loading="lazy" alt="{{.Name}}" src="{{.DownloadURL ctx}}" title="{{ctx.Locale.Tr "repo.issues.attachment.open_tab" .Name}}">
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
<ul class="ui divided list attachment-list">
|
||||
{{range $att := $release.Attachments}}
|
||||
<li class="item">
|
||||
<a target="_blank" class="tw-flex-1 gt-ellipsis" rel="nofollow" download href="{{$att.DownloadURL}}">
|
||||
<a target="_blank" class="tw-flex-1 gt-ellipsis" rel="nofollow" download href="{{$att.DownloadURL ctx}}">
|
||||
<strong class="flex-text-inline">{{svg "octicon-package" 16 "download-icon"}}<span class="gt-ellipsis">{{$att.Name}}</span></strong>
|
||||
</a>
|
||||
<div class="attachment-right-info flex-text-inline">
|
||||
|
||||
@@ -2,15 +2,14 @@
|
||||
{{$canReadCode := $.Permission.CanRead ctx.Consts.RepoUnitTypeCode}}
|
||||
|
||||
{{if $canReadReleases}}
|
||||
<div class="flex-text-block">
|
||||
<div class="tw-flex-1 tw-flex tw-items-center">
|
||||
<h2 class="ui compact small menu small-menu-items">
|
||||
<a class="{{if and .PageIsReleaseList (not .PageIsSingleTag)}}active {{end}}item" href="{{.RepoLink}}/releases">{{ctx.Locale.PrettyNumber .NumReleases}} {{ctx.Locale.TrN .NumReleases "repo.release" "repo.releases"}}</a>
|
||||
{{if $canReadCode}}
|
||||
<a class="{{if or .PageIsTagList .PageIsSingleTag}}active {{end}}item" href="{{.RepoLink}}/tags">{{ctx.Locale.PrettyNumber .NumTags}} {{ctx.Locale.TrN .NumTags "repo.tag" "repo.tags"}}</a>
|
||||
{{end}}
|
||||
</h2>
|
||||
</div>
|
||||
<div class="flex-left-right">
|
||||
<h2 class="ui compact small menu small-menu-items">
|
||||
<a class="{{if and .PageIsReleaseList (not .PageIsSingleTag)}}active {{end}}item" href="{{.RepoLink}}/releases">{{ctx.Locale.PrettyNumber .NumReleases}} {{ctx.Locale.TrN .NumReleases "repo.release" "repo.releases"}}</a>
|
||||
{{if $canReadCode}}
|
||||
<a class="{{if or .PageIsTagList .PageIsSingleTag}}active {{end}}item" href="{{.RepoLink}}/tags">{{ctx.Locale.PrettyNumber .NumTags}} {{ctx.Locale.TrN .NumTags "repo.tag" "repo.tags"}}</a>
|
||||
{{end}}
|
||||
</h2>
|
||||
<div class="flex-text-block">
|
||||
{{if .EnableFeed}}
|
||||
<a class="ui small button" href="{{.RepoLink}}/{{if .PageIsTagList}}tags{{else}}releases{{end}}.rss">
|
||||
{{svg "octicon-rss" 16}} {{ctx.Locale.Tr "rss_feed"}}
|
||||
@@ -21,6 +20,7 @@
|
||||
{{ctx.Locale.Tr "repo.release.new_release"}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
{{else if $canReadCode}}
|
||||
|
||||
Reference in New Issue
Block a user