Skip to content

Commit baee7bd

Browse files
committed
Use shared templates
1 parent 506d1b3 commit baee7bd

File tree

24 files changed

+28
-25
lines changed

24 files changed

+28
-25
lines changed

templates/admin/auth/list.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
<td><a href="{{AppSubUrl}}/admin/auths/{{.ID}}">{{.Name}}</a></td>
3030
<td>{{.TypeName}}</td>
3131
<td>{{if .IsActive}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</td>
32-
<td><relative-time format="datetime" year="numeric" month="short" day="numeric" weekday="" datetime="{{.UpdatedUnix.FormatLong}}">{{.UpdatedUnix.FormatShort}}</relative-time></td>
33-
<td><relative-time format="datetime" year="numeric" month="short" day="numeric" weekday="" datetime="{{.CreatedUnix.FormatLong}}">{{.CreatedUnix.FormatShort}}</relative-time></td>
32+
<td>{{template "shared/datetime/short" (dict "Datetime" .UpdatedUnix.FormatLong "Fallback" .UpdatedUnix.FormatShort)}}</td>
33+
<td>{{template "shared/datetime/short" (dict "Datetime" .CreatedUnix.FormatLong "Fallback" .CreatedUnix.FormatShort)}}</td>
3434
<td><a href="{{AppSubUrl}}/admin/auths/{{.ID}}">{{svg "octicon-pencil"}}</a></td>
3535
</tr>
3636
{{end}}

templates/admin/notice.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<td>{{.ID}}</td>
3030
<td>{{$.locale.Tr .TrStr}}</td>
3131
<td class="view-detail"><span class="notice-description text truncate">{{.Description}}</span></td>
32-
<td><span class="notice-created-time"><relative-time format="datetime" year="numeric" month="short" day="numeric" weekday="" datetime="{{.CreatedUnix.FormatLong}}">{{.CreatedUnix.FormatShort}}</relative-time></span></td>
32+
<td><span class="notice-created-time">{{template "shared/datetime/short" (dict "Datetime" .CreatedUnix.FormatLong "Fallback" .CreatedUnix.FormatShort)}}</span></td>
3333
<td><a href="#">{{svg "octicon-note" 16 "view-detail"}}</a></td>
3434
</tr>
3535
{{end}}

templates/admin/org/list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<td>{{.NumTeams}}</td>
4545
<td>{{.NumMembers}}</td>
4646
<td>{{.NumRepos}}</td>
47-
<td><span title="{{.CreatedUnix.FormatLong}}"><relative-time format="datetime" year="numeric" month="short" day="numeric" weekday="" datetime="{{.CreatedUnix.FormatLong}}">{{.CreatedUnix.FormatShort}}</relative-time></span></td>
47+
<td><span title="{{.CreatedUnix.FormatLong}}">{{template "shared/datetime/short" (dict "Datetime" .CreatedUnix.FormatLong "Fallback" .CreatedUnix.FormatShort)}}</span></td>
4848
<td><a href="{{.OrganisationLink}}/settings">{{svg "octicon-pencil"}}</a></td>
4949
</tr>
5050
{{end}}

templates/admin/packages/list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
{{end}}
6969
</td>
7070
<td>{{FileSize .CalculateBlobSize}}</td>
71-
<td><span title="{{.Version.CreatedUnix.FormatLong}}"><relative-time format="datetime" year="numeric" month="short" day="numeric" weekday="" datetime="{{.Version.CreatedUnix.FormatLong}}">{{.Version.CreatedUnix.FormatShort}}</relative-time></span></td>
71+
<td><span title="{{.Version.CreatedUnix.FormatLong}}">{{template "shared/datetime/short" (dict "Datetime" .Version.CreatedUnix.FormatLong "Fallback" .Version.CreatedUnix.FormatShort)}}</span></td>
7272
<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>
7373
</tr>
7474
{{end}}

templates/admin/repo/list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
<td>{{.NumForks}}</td>
8484
<td>{{.NumIssues}}</td>
8585
<td>{{FileSize .Size}}</td>
86-
<td><span title="{{.CreatedUnix.FormatLong}}"><relative-time format="datetime" year="numeric" month="short" day="numeric" weekday="" datetime="{{.CreatedUnix.FormatLong}}">{{.CreatedUnix.FormatShort}}</relative-time></span></td>
86+
<td><span title="{{.CreatedUnix.FormatLong}}">{{template "shared/datetime/short" (dict "Datetime" .CreatedUnix.FormatLong "Fallback" .CreatedUnix.FormatShort)}}</span></td>
8787
<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>
8888
</tr>
8989
{{end}}

templates/admin/user/list.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@
9494
<td>{{if .IsRestricted}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</td>
9595
<td>{{if index $.UsersTwoFaStatus .ID}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</td>
9696
<td>{{.NumRepos}}</td>
97-
<td><span title="{{.CreatedUnix.FormatLong}}"><relative-time format="datetime" year="numeric" month="short" day="numeric" weekday="" datetime="{{.CreatedUnix.FormatLong}}">{{.CreatedUnix.FormatShort}}</relative-time></span></td>
97+
<td><span title="{{.CreatedUnix.FormatLong}}">{{template "shared/datetime/short" (dict "Datetime" .CreatedUnix.FormatLong "Fallback" .CreatedUnix.FormatShort)}}</span></td>
9898
{{if .LastLoginUnix}}
99-
<td><span title="{{.LastLoginUnix.FormatLong}}"><relative-time format="datetime" year="numeric" month="short" day="numeric" weekday="" datetime="{{.LastLoginUnix.FormatLong}}">{{.LastLoginUnix.FormatShort}}</relative-time></span></td>
99+
<td><span title="{{.LastLoginUnix.FormatLong}}">{{template "shared/datetime/short" (dict "Datetime" .LastLoginUnix.FormatLong "Fallback" .LastLoginUnix.FormatShort)}}</span></td>
100100
{{else}}
101101
<td><span>{{$.locale.Tr "admin.users.never_login"}}</span></td>
102102
{{end}}

templates/explore/organizations.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
{{svg "octicon-link"}}
2424
<a href="{{.Website}}" rel="nofollow">{{.Website}}</a>
2525
{{end}}
26-
{{svg "octicon-clock"}} {{$.locale.Tr "user.join_on"}} <relative-time format="datetime" year="numeric" month="short" day="numeric" weekday="" datetime="{{.CreatedUnix.FormatLong}}">{{.CreatedUnix.FormatShort}}</relative-time>
26+
{{svg "octicon-clock"}} {{$.locale.Tr "user.join_on"}} {{template "shared/datetime/short" (dict "Datetime" .CreatedUnix.FormatLong "Fallback" .CreatedUnix.FormatShort)}}
2727
</div>
2828
</div>
2929
</div>

templates/explore/users.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
{{svg "octicon-mail"}}
1919
<a href="mailto:{{.Email}}" rel="nofollow">{{.Email}}</a>
2020
{{end}}
21-
{{svg "octicon-clock"}} {{$.locale.Tr "user.join_on"}} <relative-time format="datetime" year="numeric" month="short" day="numeric" weekday="" datetime="{{.CreatedUnix.FormatLong}}">{{.CreatedUnix.FormatShort}}</relative-time>
21+
{{svg "octicon-clock"}} {{$.locale.Tr "user.join_on"}} {{template "shared/datetime/short" (dict "Datetime" .CreatedUnix.FormatLong "Fallback" .CreatedUnix.FormatShort)}}
2222
</div>
2323
</div>
2424
</div>

templates/package/shared/cleanup_rules/preview.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<td><a href="{{.FullWebLink}}">{{.Version.Version}}</a></td>
2323
<td><a href="{{.Creator.HomeLink}}">{{.Creator.Name}}</a></td>
2424
<td>{{FileSize .CalculateBlobSize}}</td>
25-
<td><span title="{{.Version.CreatedUnix.FormatLong}}"><relative-time format="datetime" year="numeric" month="short" day="numeric" weekday="" datetime="{{.Version.CreatedUnix.FormatLong}}">{{.Version.CreatedUnix.FormatShort}}</relative-time></span></td>
25+
<td><span title="{{.Version.CreatedUnix.FormatLong}}">{{template "shared/datetime/short" (dict "Datetime" .Version.CreatedUnix.FormatLong "Fallback" .Version.CreatedUnix.FormatShort)}}</span></td>
2626
</tr>
2727
{{else}}
2828
<tr>

templates/repo/activity.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div role="main" aria-label="{{.Title}}" class="page-content repository commits">
33
{{template "repo/header" .}}
44
<div class="ui container">
5-
<h2 class="ui header"><relative-time format="datetime" year="numeric" month="long" day="numeric" weekday="" datetime="{{.DateFrom}}">{{.DateFrom}}</relative-time> - <relative-time format="datetime" year="numeric" month="long" day="numeric" weekday="" datetime="{{.DateUntil}}">{{.DateUntil}}</relative-time>
5+
<h2 class="ui header">{{template "shared/datetime/long" (dict "Datetime" .DateFrom "Fallback" .DateFrom)}} - {{template "shared/datetime/long" (dict "Datetime" .DateUntil "Fallback" .DateUntil)}}
66
<div class="ui right">
77
<!-- Period -->
88
<div class="ui floating dropdown jump filter">

0 commit comments

Comments
 (0)