diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-07-08 02:06:49 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-07 18:06:49 +0000 |
commit | 3780795b938c8915736d73c416e2a8198920c3de (patch) | |
tree | 3270e0fa3101fe9c4d6bac855ee8b7a706923623 /templates/package | |
parent | cb01b8691db6ff13db3331dbe90ea291e1d6eadd (diff) | |
download | gitea-3780795b938c8915736d73c416e2a8198920c3de.tar.gz gitea-3780795b938c8915736d73c416e2a8198920c3de.zip |
Reformat some templates (#25756)
Only: indent/dedent/newline
Diffstat (limited to 'templates/package')
-rw-r--r-- | templates/package/shared/list.tmpl | 98 | ||||
-rw-r--r-- | templates/package/shared/versionlist.tmpl | 70 |
2 files changed, 84 insertions, 84 deletions
diff --git a/templates/package/shared/list.tmpl b/templates/package/shared/list.tmpl index 1acafff41a..b2f339285f 100644 --- a/templates/package/shared/list.tmpl +++ b/templates/package/shared/list.tmpl @@ -1,53 +1,53 @@ - {{template "base/alert" .}} - <form class="ui form ignore-dirty"> - <div class="ui fluid action input"> - {{template "shared/searchinput" dict "locale" .locale "Value" .Query "AutoFocus" true}} - <select class="ui dropdown" name="type"> - <option value="">{{.locale.Tr "packages.filter.type"}}</option> - <option value="all">{{.locale.Tr "packages.filter.type.all"}}</option> - {{range $type := .AvailableTypes}} - <option{{if eq $.PackageType $type}} selected="selected"{{end}} value="{{$type}}">{{$type.Name}}</option> - {{end}} - </select> - <button class="ui primary button">{{.locale.Tr "explore.search"}}</button> - </div> - </form> - <div class="ui {{if .PackageDescriptors}}issue list{{end}}"> - {{range .PackageDescriptors}} - <li class="item gt-df gt-py-3"> - <div class="issue-item-main"> - <div class="issue-item-top-row"> - <a class="title" href="{{.FullWebLink}}">{{.Package.Name}}</a> - <span class="ui label">{{svg .Package.Type.SVGName 16}} {{.Package.Type.Name}}</span> - </div> - <div class="desc issue-item-bottom-row"> - {{$timeStr := TimeSinceUnix .Version.CreatedUnix $.locale}} - {{$hasRepositoryAccess := false}} - {{if .Repository}} - {{$hasRepositoryAccess = index $.RepositoryAccessMap .Repository.ID}} - {{end}} - {{if $hasRepositoryAccess}} - {{$.locale.Tr "packages.published_by_in" $timeStr .Creator.HomeLink (.Creator.GetDisplayName | Escape) .Repository.Link (.Repository.FullName | Escape) | Safe}} - {{else}} - {{$.locale.Tr "packages.published_by" $timeStr .Creator.HomeLink (.Creator.GetDisplayName | Escape) | Safe}} - {{end}} - </div> +{{template "base/alert" .}} +<form class="ui form ignore-dirty"> + <div class="ui fluid action input"> + {{template "shared/searchinput" dict "locale" .locale "Value" .Query "AutoFocus" true}} + <select class="ui dropdown" name="type"> + <option value="">{{.locale.Tr "packages.filter.type"}}</option> + <option value="all">{{.locale.Tr "packages.filter.type.all"}}</option> + {{range $type := .AvailableTypes}} + <option{{if eq $.PackageType $type}} selected="selected"{{end}} value="{{$type}}">{{$type.Name}}</option> + {{end}} + </select> + <button class="ui primary button">{{.locale.Tr "explore.search"}}</button> + </div> +</form> +<div class="ui {{if .PackageDescriptors}}issue list{{end}}"> + {{range .PackageDescriptors}} + <li class="item gt-df gt-py-3"> + <div class="issue-item-main"> + <div class="issue-item-top-row"> + <a class="title" href="{{.FullWebLink}}">{{.Package.Name}}</a> + <span class="ui label">{{svg .Package.Type.SVGName 16}} {{.Package.Type.Name}}</span> </div> - </li> - {{else}} - {{if not .HasPackages}} - <div class="gt-pt-5 empty center"> - {{svg "octicon-package" 48}} - <h2>{{.locale.Tr "packages.empty"}}</h2> - {{if and .Repository .CanWritePackages}} - {{$packagesUrl := URLJoin .Owner.HomeLink "-" "packages"}} - <p>{{.locale.Tr "packages.empty.repo" $packagesUrl | Safe}}</p> + <div class="desc issue-item-bottom-row"> + {{$timeStr := TimeSinceUnix .Version.CreatedUnix $.locale}} + {{$hasRepositoryAccess := false}} + {{if .Repository}} + {{$hasRepositoryAccess = index $.RepositoryAccessMap .Repository.ID}} + {{end}} + {{if $hasRepositoryAccess}} + {{$.locale.Tr "packages.published_by_in" $timeStr .Creator.HomeLink (.Creator.GetDisplayName | Escape) .Repository.Link (.Repository.FullName | Escape) | Safe}} + {{else}} + {{$.locale.Tr "packages.published_by" $timeStr .Creator.HomeLink (.Creator.GetDisplayName | Escape) | Safe}} {{end}} - <p>{{.locale.Tr "packages.empty.documentation" "https://docs.gitea.io/en-us/usage/packages/overview/" | Safe}}</p> </div> - {{else}} - <p>{{.locale.Tr "packages.filter.no_result"}}</p> - {{end}} + </div> + </li> + {{else}} + {{if not .HasPackages}} + <div class="gt-pt-5 empty center"> + {{svg "octicon-package" 48}} + <h2>{{.locale.Tr "packages.empty"}}</h2> + {{if and .Repository .CanWritePackages}} + {{$packagesUrl := URLJoin .Owner.HomeLink "-" "packages"}} + <p>{{.locale.Tr "packages.empty.repo" $packagesUrl | Safe}}</p> + {{end}} + <p>{{.locale.Tr "packages.empty.documentation" "https://docs.gitea.io/en-us/usage/packages/overview/" | Safe}}</p> + </div> + {{else}} + <p>{{.locale.Tr "packages.filter.no_result"}}</p> {{end}} - {{template "base/paginate" .}} - </div> + {{end}} + {{template "base/paginate" .}} +</div> diff --git a/templates/package/shared/versionlist.tmpl b/templates/package/shared/versionlist.tmpl index be5c2a16de..afd92efff9 100644 --- a/templates/package/shared/versionlist.tmpl +++ b/templates/package/shared/versionlist.tmpl @@ -1,37 +1,37 @@ - <p><a href="{{.PackageDescriptor.PackageWebLink}}">{{.PackageDescriptor.Package.Name}}</a> / <strong>{{.locale.Tr "packages.versions"}}</strong></p> - <form class="ui form ignore-dirty"> - <div class="ui fluid action input"> - {{template "shared/searchinput" dict "locale" .locale "Value" .Query "AutoFocus" true}} - <select class="ui dropdown" name="sort"> - <option value="version_asc"{{if eq .Sort "version_asc"}} selected="selected"{{end}}>{{.locale.Tr "filter.string.asc"}}</option> - <option value="version_desc"{{if eq .Sort "version_desc"}} selected="selected"{{end}}>{{.locale.Tr "filter.string.desc"}}</option> - <option value="created_asc"{{if eq .Sort "created_asc"}} selected="selected"{{end}}>{{.locale.Tr "repo.issues.filter_sort.oldest"}}</option> - <option value="created_desc"{{if or (eq .Sort "") (eq .Sort "created_desc")}} selected="selected"{{end}}>{{.locale.Tr "repo.issues.filter_sort.latest"}}</option> - </select> - {{if eq .PackageDescriptor.Package.Type "container"}} - <select class="ui dropdown" name="tagged"> - {{$isTagged := or (eq .Tagged "") (eq .Tagged "tagged")}} - <option value="tagged"{{if $isTagged}} selected="selected"{{end}}>{{.locale.Tr "packages.filter.container.tagged"}}</option> - <option value="untagged"{{if not $isTagged}} selected="selected"{{end}}>{{.locale.Tr "packages.filter.container.untagged"}}</option> - </select> - {{end}} - <button class="ui primary button">{{.locale.Tr "explore.search"}}</button> - </div> - </form> - <div class="ui {{if .PackageDescriptors}}issue list{{end}}"> - {{range .PackageDescriptors}} - <li class="item gt-df gt-py-3"> - <div class="issue-item-main"> - <div class="issue-item-top-row"> - <a class="title" href="{{.FullWebLink}}">{{.Version.LowerVersion}}</a> - </div> - <div class="desc issue-item-bottom-row"> - {{$.locale.Tr "packages.published_by" (TimeSinceUnix .Version.CreatedUnix $.locale) .Creator.HomeLink (.Creator.GetDisplayName | Escape) | Safe}} - </div> - </div> - </li> - {{else}} - <p>{{.locale.Tr "packages.filter.no_result"}}</p> +<p><a href="{{.PackageDescriptor.PackageWebLink}}">{{.PackageDescriptor.Package.Name}}</a> / <strong>{{.locale.Tr "packages.versions"}}</strong></p> +<form class="ui form ignore-dirty"> + <div class="ui fluid action input"> + {{template "shared/searchinput" dict "locale" .locale "Value" .Query "AutoFocus" true}} + <select class="ui dropdown" name="sort"> + <option value="version_asc"{{if eq .Sort "version_asc"}} selected="selected"{{end}}>{{.locale.Tr "filter.string.asc"}}</option> + <option value="version_desc"{{if eq .Sort "version_desc"}} selected="selected"{{end}}>{{.locale.Tr "filter.string.desc"}}</option> + <option value="created_asc"{{if eq .Sort "created_asc"}} selected="selected"{{end}}>{{.locale.Tr "repo.issues.filter_sort.oldest"}}</option> + <option value="created_desc"{{if or (eq .Sort "") (eq .Sort "created_desc")}} selected="selected"{{end}}>{{.locale.Tr "repo.issues.filter_sort.latest"}}</option> + </select> + {{if eq .PackageDescriptor.Package.Type "container"}} + <select class="ui dropdown" name="tagged"> + {{$isTagged := or (eq .Tagged "") (eq .Tagged "tagged")}} + <option value="tagged"{{if $isTagged}} selected="selected"{{end}}>{{.locale.Tr "packages.filter.container.tagged"}}</option> + <option value="untagged"{{if not $isTagged}} selected="selected"{{end}}>{{.locale.Tr "packages.filter.container.untagged"}}</option> + </select> {{end}} - {{template "base/paginate" .}} + <button class="ui primary button">{{.locale.Tr "explore.search"}}</button> </div> +</form> +<div class="ui {{if .PackageDescriptors}}issue list{{end}}"> + {{range .PackageDescriptors}} + <li class="item gt-df gt-py-3"> + <div class="issue-item-main"> + <div class="issue-item-top-row"> + <a class="title" href="{{.FullWebLink}}">{{.Version.LowerVersion}}</a> + </div> + <div class="desc issue-item-bottom-row"> + {{$.locale.Tr "packages.published_by" (TimeSinceUnix .Version.CreatedUnix $.locale) .Creator.HomeLink (.Creator.GetDisplayName | Escape) | Safe}} + </div> + </div> + </li> + {{else}} + <p>{{.locale.Tr "packages.filter.no_result"}}</p> + {{end}} + {{template "base/paginate" .}} +</div> |