aboutsummaryrefslogtreecommitdiffstats
path: root/templates/admin
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-04-26 03:48:30 +0800
committerGitHub <noreply@github.com>2023-04-25 15:48:30 -0400
commit0e8045d8ea51b1bf856cfd9c57cabd8187a3a2ab (patch)
tree90294cc32a89f4354ed3ad76d328dd2973b50fbf /templates/admin
parent9219534447411f6ffe507fee64f89c619c29d501 (diff)
downloadgitea-0e8045d8ea51b1bf856cfd9c57cabd8187a3a2ab.tar.gz
gitea-0e8045d8ea51b1bf856cfd9c57cabd8187a3a2ab.zip
Fix template function DateTime (#24317)
Before, 500 error ![image](https://user-images.githubusercontent.com/2114189/234170176-403ffd1b-ec27-42be-bff9-86184dc8d74d.png)
Diffstat (limited to 'templates/admin')
-rw-r--r--templates/admin/auth/list.tmpl4
-rw-r--r--templates/admin/cron.tmpl4
-rw-r--r--templates/admin/notice.tmpl2
-rw-r--r--templates/admin/org/list.tmpl2
-rw-r--r--templates/admin/packages/list.tmpl2
-rw-r--r--templates/admin/queue.tmpl4
-rw-r--r--templates/admin/repo/list.tmpl2
-rw-r--r--templates/admin/user/list.tmpl4
8 files changed, 12 insertions, 12 deletions
diff --git a/templates/admin/auth/list.tmpl b/templates/admin/auth/list.tmpl
index f8e15eddef..c9f7c0d516 100644
--- a/templates/admin/auth/list.tmpl
+++ b/templates/admin/auth/list.tmpl
@@ -26,8 +26,8 @@
<td><a href="{{AppSubUrl}}/admin/auths/{{.ID}}">{{.Name}}</a></td>
<td>{{.TypeName}}</td>
<td>{{if .IsActive}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</td>
- <td>{{DateTime "short" .UpdatedUnix.FormatLong .UpdatedUnix.FormatShort}}</td>
- <td>{{DateTime "short" .CreatedUnix.FormatLong .CreatedUnix.FormatShort}}</td>
+ <td>{{DateTime "short" .UpdatedUnix}}</td>
+ <td>{{DateTime "short" .CreatedUnix}}</td>
<td><a href="{{AppSubUrl}}/admin/auths/{{.ID}}">{{svg "octicon-pencil"}}</a></td>
</tr>
{{end}}
diff --git a/templates/admin/cron.tmpl b/templates/admin/cron.tmpl
index 5dd6314944..267da00759 100644
--- a/templates/admin/cron.tmpl
+++ b/templates/admin/cron.tmpl
@@ -21,8 +21,8 @@
<td><button type="submit" class="ui green button" name="op" value="{{.Name}}" title="{{$.locale.Tr "admin.dashboard.operation_run"}}">{{svg "octicon-triangle-right"}}</button></td>
<td>{{$.locale.Tr (printf "admin.dashboard.%s" .Name)}}</td>
<td>{{.Spec}}</td>
- <td>{{DateTime "full" (DateFmtLong .Next) (DateFmtLong .Next)}}</td>
- <td>{{if gt .Prev.Year 1}}{{DateTime "full" (DateFmtLong .Prev) (DateFmtLong .Prev)}}{{else}}N/A{{end}}</td>
+ <td>{{DateTime "full" (DateFmtLong .Next)}}</td>
+ <td>{{if gt .Prev.Year 1}}{{DateTime "full" .Prev}}{{else}}N/A{{end}}</td>
<td>{{.ExecTimes}}</td>
<td {{if ne .Status ""}}data-tooltip-content="{{.FormatLastMessage $.locale}}"{{end}} >{{if eq .Status ""}}—{{else if eq .Status "finished"}}{{svg "octicon-check" 16}}{{else}}{{svg "octicon-x" 16}}{{end}}</td>
</tr>
diff --git a/templates/admin/notice.tmpl b/templates/admin/notice.tmpl
index 51b0c6850a..bd6b74dd2b 100644
--- a/templates/admin/notice.tmpl
+++ b/templates/admin/notice.tmpl
@@ -26,7 +26,7 @@
<td>{{.ID}}</td>
<td>{{$.locale.Tr .TrStr}}</td>
<td class="view-detail"><span class="notice-description text truncate">{{.Description}}</span></td>
- <td>{{DateTime "short" .CreatedUnix.FormatLong .CreatedUnix.FormatShort}}</td>
+ <td>{{DateTime "short" .CreatedUnix}}</td>
<td><a href="#">{{svg "octicon-note" 16 "view-detail"}}</a></td>
</tr>
{{end}}
diff --git a/templates/admin/org/list.tmpl b/templates/admin/org/list.tmpl
index 73435fdd37..a400dcbc86 100644
--- a/templates/admin/org/list.tmpl
+++ b/templates/admin/org/list.tmpl
@@ -41,7 +41,7 @@
<td>{{.NumTeams}}</td>
<td>{{.NumMembers}}</td>
<td>{{.NumRepos}}</td>
- <td>{{DateTime "short" .CreatedUnix.FormatLong .CreatedUnix.FormatShort}}</td>
+ <td>{{DateTime "short" .CreatedUnix}}</td>
<td><a href="{{.OrganisationLink}}/settings">{{svg "octicon-pencil"}}</a></td>
</tr>
{{end}}
diff --git a/templates/admin/packages/list.tmpl b/templates/admin/packages/list.tmpl
index 2edcad4b7b..f320878b80 100644
--- a/templates/admin/packages/list.tmpl
+++ b/templates/admin/packages/list.tmpl
@@ -65,7 +65,7 @@
{{end}}
</td>
<td>{{FileSize .CalculateBlobSize}}</td>
- <td>{{DateTime "short" .Version.CreatedUnix.FormatLong .Version.CreatedUnix.FormatShort}}</td>
+ <td>{{DateTime "short" .Version.CreatedUnix}}</td>
<td><a class="delete-button" href="" data-url="{{$.Link}}/delete?page={{$.Page.Paginater.Current}}&sort={{$.SortType}}" data-id="{{.Version.ID}}" data-name="{{.Package.Name}}" data-data-version="{{.Version.Version}}">{{svg "octicon-trash"}}</a></td>
</tr>
{{end}}
diff --git a/templates/admin/queue.tmpl b/templates/admin/queue.tmpl
index d3052c91a9..3de01a32ab 100644
--- a/templates/admin/queue.tmpl
+++ b/templates/admin/queue.tmpl
@@ -155,8 +155,8 @@
{{range .Queue.Workers}}
<tr>
<td>{{.Workers}}{{if .IsFlusher}}<span title="{{$.locale.Tr "admin.monitor.queue.flush"}}">{{svg "octicon-sync"}}</span>{{end}}</td>
- <td>{{DateTime "full" (DateFmtLong .Start) (DateFmtLong .Start)}}</td>
- <td>{{if .HasTimeout}}{{DateTime "full" (DateFmtLong .Timeout) (DateFmtLong .Timeout)}}{{else}}-{{end}}</td>
+ <td>{{DateTime "full" .Start}}</td>
+ <td>{{if .HasTimeout}}{{DateTime "full" .Timeout}}{{else}}-{{end}}</td>
<td>
<a class="delete-button" href="" data-url="{{$.Link}}/cancel/{{.PID}}" data-id="{{.PID}}" data-name="{{.Workers}}" title="{{$.locale.Tr "remove"}}">{{svg "octicon-trash"}}</a>
</td>
diff --git a/templates/admin/repo/list.tmpl b/templates/admin/repo/list.tmpl
index f9a0a6ef98..3d09f2de23 100644
--- a/templates/admin/repo/list.tmpl
+++ b/templates/admin/repo/list.tmpl
@@ -80,7 +80,7 @@
<td>{{.NumForks}}</td>
<td>{{.NumIssues}}</td>
<td>{{FileSize .Size}}</td>
- <td>{{DateTime "short" .CreatedUnix.FormatLong .CreatedUnix.FormatShort}}</td>
+ <td>{{DateTime "short" .CreatedUnix}}</td>
<td><a class="delete-button" href="" data-url="{{$.Link}}/delete?page={{$.Page.Paginater.Current}}&sort={{$.SortType}}" data-id="{{.ID}}" data-name="{{.Name}}">{{svg "octicon-trash"}}</a></td>
</tr>
{{end}}
diff --git a/templates/admin/user/list.tmpl b/templates/admin/user/list.tmpl
index fef7c7b27f..2f76f2d3ba 100644
--- a/templates/admin/user/list.tmpl
+++ b/templates/admin/user/list.tmpl
@@ -91,9 +91,9 @@
<td>{{if .IsRestricted}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</td>
<td>{{if index $.UsersTwoFaStatus .ID}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</td>
<td>{{.NumRepos}}</td>
- <td>{{DateTime "short" .CreatedUnix.FormatLong .CreatedUnix.FormatShort}}</td>
+ <td>{{DateTime "short" .CreatedUnix}}</td>
{{if .LastLoginUnix}}
- <td>{{DateTime "short" .LastLoginUnix.FormatLong .LastLoginUnix.FormatShort}}</td>
+ <td>{{DateTime "short" .LastLoginUnix}}</td>
{{else}}
<td><span>{{$.locale.Tr "admin.users.never_login"}}</span></td>
{{end}}