From 530b2a97e1547f1239349d0b708373353c28f22a Mon Sep 17 00:00:00 2001 From: handlerug Date: Thu, 1 Jul 2021 15:29:19 +0700 Subject: [PATCH] Show "unknown" if no registration date --- views/admin.qtpl | 8 ++- views/admin.qtpl.go | 136 +++++++++++++++++++++++++------------------- 2 files changed, 84 insertions(+), 60 deletions(-) diff --git a/views/admin.qtpl b/views/admin.qtpl index 2b77e49..6854f0a 100644 --- a/views/admin.qtpl +++ b/views/admin.qtpl @@ -60,7 +60,13 @@ {%s u.Name %} {%s u.Group %} - {%s u.RegisteredAt.UTC().Format("2006-01-02 15:04") %} + + {% if u.RegisteredAt.IsZero() %} + unknown + {% else %} + {%s u.RegisteredAt.UTC().Format("2006-01-02 15:04") %} + {% endif %} + Edit diff --git a/views/admin.qtpl.go b/views/admin.qtpl.go index 17c4c65..fc30b2b 100644 --- a/views/admin.qtpl.go +++ b/views/admin.qtpl.go @@ -136,68 +136,86 @@ func StreamAdminUsersPanelHTML(qw422016 *qt422016.Writer, userList []*user.User) qw422016.E().S(u.Group) //line views/admin.qtpl:62 qw422016.N().S(` - `) -//line views/admin.qtpl:63 - qw422016.E().S(u.RegisteredAt.UTC().Format("2006-01-02 15:04")) -//line views/admin.qtpl:63 - qw422016.N().S(` + + `) +//line views/admin.qtpl:64 + if u.RegisteredAt.IsZero() { +//line views/admin.qtpl:64 + qw422016.N().S(` + unknown + `) +//line views/admin.qtpl:66 + } else { +//line views/admin.qtpl:66 + qw422016.N().S(` + `) +//line views/admin.qtpl:67 + qw422016.E().S(u.RegisteredAt.UTC().Format("2006-01-02 15:04")) +//line views/admin.qtpl:67 + qw422016.N().S(` + `) +//line views/admin.qtpl:68 + } +//line views/admin.qtpl:68 + qw422016.N().S(` + Edit `) -//line views/admin.qtpl:68 +//line views/admin.qtpl:74 } -//line views/admin.qtpl:68 +//line views/admin.qtpl:74 qw422016.N().S(` `) -//line views/admin.qtpl:73 +//line views/admin.qtpl:79 } -//line views/admin.qtpl:73 +//line views/admin.qtpl:79 func WriteAdminUsersPanelHTML(qq422016 qtio422016.Writer, userList []*user.User) { -//line views/admin.qtpl:73 +//line views/admin.qtpl:79 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/admin.qtpl:73 +//line views/admin.qtpl:79 StreamAdminUsersPanelHTML(qw422016, userList) -//line views/admin.qtpl:73 +//line views/admin.qtpl:79 qt422016.ReleaseWriter(qw422016) -//line views/admin.qtpl:73 +//line views/admin.qtpl:79 } -//line views/admin.qtpl:73 +//line views/admin.qtpl:79 func AdminUsersPanelHTML(userList []*user.User) string { -//line views/admin.qtpl:73 +//line views/admin.qtpl:79 qb422016 := qt422016.AcquireByteBuffer() -//line views/admin.qtpl:73 +//line views/admin.qtpl:79 WriteAdminUsersPanelHTML(qb422016, userList) -//line views/admin.qtpl:73 +//line views/admin.qtpl:79 qs422016 := string(qb422016.B) -//line views/admin.qtpl:73 +//line views/admin.qtpl:79 qt422016.ReleaseByteBuffer(qb422016) -//line views/admin.qtpl:73 +//line views/admin.qtpl:79 return qs422016 -//line views/admin.qtpl:73 +//line views/admin.qtpl:79 } -//line views/admin.qtpl:75 +//line views/admin.qtpl:81 func StreamAdminUsersUserHTML(qw422016 *qt422016.Writer, u *user.User) { -//line views/admin.qtpl:75 +//line views/admin.qtpl:81 qw422016.N().S(`

`) -//line views/admin.qtpl:78 +//line views/admin.qtpl:84 qw422016.E().S(u.Name) -//line views/admin.qtpl:78 +//line views/admin.qtpl:84 qw422016.N().S(`

@@ -205,49 +223,49 @@ func StreamAdminUsersUserHTML(qw422016 *qt422016.Writer, u *user.User) {
@@ -258,31 +276,31 @@ func StreamAdminUsersUserHTML(qw422016 *qt422016.Writer, u *user.User) { `) -//line views/admin.qtpl:97 +//line views/admin.qtpl:103 } -//line views/admin.qtpl:97 +//line views/admin.qtpl:103 func WriteAdminUsersUserHTML(qq422016 qtio422016.Writer, u *user.User) { -//line views/admin.qtpl:97 +//line views/admin.qtpl:103 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/admin.qtpl:97 +//line views/admin.qtpl:103 StreamAdminUsersUserHTML(qw422016, u) -//line views/admin.qtpl:97 +//line views/admin.qtpl:103 qt422016.ReleaseWriter(qw422016) -//line views/admin.qtpl:97 +//line views/admin.qtpl:103 } -//line views/admin.qtpl:97 +//line views/admin.qtpl:103 func AdminUsersUserHTML(u *user.User) string { -//line views/admin.qtpl:97 +//line views/admin.qtpl:103 qb422016 := qt422016.AcquireByteBuffer() -//line views/admin.qtpl:97 +//line views/admin.qtpl:103 WriteAdminUsersUserHTML(qb422016, u) -//line views/admin.qtpl:97 +//line views/admin.qtpl:103 qs422016 := string(qb422016.B) -//line views/admin.qtpl:97 +//line views/admin.qtpl:103 qt422016.ReleaseByteBuffer(qb422016) -//line views/admin.qtpl:97 +//line views/admin.qtpl:103 return qs422016 -//line views/admin.qtpl:97 +//line views/admin.qtpl:103 }