From f2e20c81b66e6a937ecdb686f8d1011371433365 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 11 Dec 2017 12:37:04 +0800 Subject: Refactor struct's time to remove unnecessary memory usage (#3142) * refactor struct's time to remove unnecessary memory usage * use AsTimePtr simple code * fix tests * fix time compare * fix template on gpg * use AddDuration instead of Add --- templates/admin/auth/list.tmpl | 4 ++-- templates/admin/monitor.tmpl | 4 ++-- templates/admin/notice.tmpl | 2 +- templates/admin/org/list.tmpl | 2 +- templates/admin/repo/list.tmpl | 2 +- templates/admin/user/list.tmpl | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) (limited to 'templates/admin') diff --git a/templates/admin/auth/list.tmpl b/templates/admin/auth/list.tmpl index 4e8fb1ea82..60b8f6fbe7 100644 --- a/templates/admin/auth/list.tmpl +++ b/templates/admin/auth/list.tmpl @@ -29,8 +29,8 @@ {{.Name}} {{.TypeName}} - {{DateFmtShort .Updated}} - {{DateFmtShort .Created}} + {{.UpdatedUnix.FormatShort}} + {{.CreatedUnix.FormatShort}} {{end}} diff --git a/templates/admin/monitor.tmpl b/templates/admin/monitor.tmpl index 6cc927d68f..ceca29146e 100644 --- a/templates/admin/monitor.tmpl +++ b/templates/admin/monitor.tmpl @@ -49,8 +49,8 @@ {{.PID}} {{.Description}} - {{DateFmtLong .Start}} - {{TimeSince .Start $.Lang}} + {{.Start.FormatLong}} + {{TimeSinceUnix .Start $.Lang}} {{end}} diff --git a/templates/admin/notice.tmpl b/templates/admin/notice.tmpl index 49e760d2b7..745433d180 100644 --- a/templates/admin/notice.tmpl +++ b/templates/admin/notice.tmpl @@ -29,7 +29,7 @@ {{.ID}} {{$.i18n.Tr .TrStr}} {{SubStr .Description 0 120}}... - {{DateFmtShort .Created}} + {{.CreatedUnix.FormatShort}} {{end}} diff --git a/templates/admin/org/list.tmpl b/templates/admin/org/list.tmpl index 362352b695..141628c5b3 100644 --- a/templates/admin/org/list.tmpl +++ b/templates/admin/org/list.tmpl @@ -33,7 +33,7 @@ {{.NumTeams}} {{.NumMembers}} {{.NumRepos}} - {{DateFmtShort .Created}} + {{.CreatedUnix.FormatShort}} {{end}} diff --git a/templates/admin/repo/list.tmpl b/templates/admin/repo/list.tmpl index aeaecf8dfb..470be359eb 100644 --- a/templates/admin/repo/list.tmpl +++ b/templates/admin/repo/list.tmpl @@ -36,7 +36,7 @@ {{.NumStars}} {{.NumIssues}} {{SizeFmt .Size}} - {{DateFmtShort .Created}} + {{.CreatedUnix.FormatShort}} {{end}} diff --git a/templates/admin/user/list.tmpl b/templates/admin/user/list.tmpl index 7e06417013..d590526ca3 100644 --- a/templates/admin/user/list.tmpl +++ b/templates/admin/user/list.tmpl @@ -36,9 +36,9 @@ {{.NumRepos}} - {{DateFmtShort .Created }} + {{.CreatedUnix.FormatShort}} {{if .LastLoginUnix}} - {{DateFmtShort .LastLogin }} + {{.LastLoginUnix.FormatShort}} {{else}} {{$.i18n.Tr "admin.users.never_login"}} {{end}} -- cgit v1.2.3