1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-12-13 05:50:27 +00:00

Show "unknown" if no registration date

This commit is contained in:
handlerug 2021-07-01 15:29:19 +07:00
parent 0052ba0695
commit 530b2a97e1
No known key found for this signature in database
GPG Key ID: 38009F0605051491
2 changed files with 84 additions and 60 deletions

View File

@ -60,7 +60,13 @@
<a href="/hypha/{%u cfg.UserHypha %}/{%u u.Name %}">{%s u.Name %}</a> <a href="/hypha/{%u cfg.UserHypha %}/{%u u.Name %}">{%s u.Name %}</a>
</td> </td>
<td>{%s u.Group %}</td> <td>{%s u.Group %}</td>
<td>{%s u.RegisteredAt.UTC().Format("2006-01-02 15:04") %}</td> <td>
{% if u.RegisteredAt.IsZero() %}
unknown
{% else %}
{%s u.RegisteredAt.UTC().Format("2006-01-02 15:04") %}
{% endif %}
</td>
<td> <td>
<a href="/admin/users/{%u u.Name %}/edit">Edit</a> <a href="/admin/users/{%u u.Name %}/edit">Edit</a>
</td> </td>

View File

@ -136,68 +136,86 @@ func StreamAdminUsersPanelHTML(qw422016 *qt422016.Writer, userList []*user.User)
qw422016.E().S(u.Group) qw422016.E().S(u.Group)
//line views/admin.qtpl:62 //line views/admin.qtpl:62
qw422016.N().S(`</td> qw422016.N().S(`</td>
<td>`) <td>
//line views/admin.qtpl:63 `)
qw422016.E().S(u.RegisteredAt.UTC().Format("2006-01-02 15:04")) //line views/admin.qtpl:64
//line views/admin.qtpl:63 if u.RegisteredAt.IsZero() {
qw422016.N().S(`</td> //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(`
</td>
<td> <td>
<a href="/admin/users/`) <a href="/admin/users/`)
//line views/admin.qtpl:65 //line views/admin.qtpl:71
qw422016.N().U(u.Name) qw422016.N().U(u.Name)
//line views/admin.qtpl:65 //line views/admin.qtpl:71
qw422016.N().S(`/edit">Edit</a> qw422016.N().S(`/edit">Edit</a>
</td> </td>
</tr> </tr>
`) `)
//line views/admin.qtpl:68 //line views/admin.qtpl:74
} }
//line views/admin.qtpl:68 //line views/admin.qtpl:74
qw422016.N().S(` qw422016.N().S(`
</tbody> </tbody>
</table> </table>
</main> </main>
</div> </div>
`) `)
//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) { func WriteAdminUsersPanelHTML(qq422016 qtio422016.Writer, userList []*user.User) {
//line views/admin.qtpl:73 //line views/admin.qtpl:79
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line views/admin.qtpl:73 //line views/admin.qtpl:79
StreamAdminUsersPanelHTML(qw422016, userList) StreamAdminUsersPanelHTML(qw422016, userList)
//line views/admin.qtpl:73 //line views/admin.qtpl:79
qt422016.ReleaseWriter(qw422016) 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 { func AdminUsersPanelHTML(userList []*user.User) string {
//line views/admin.qtpl:73 //line views/admin.qtpl:79
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line views/admin.qtpl:73 //line views/admin.qtpl:79
WriteAdminUsersPanelHTML(qb422016, userList) WriteAdminUsersPanelHTML(qb422016, userList)
//line views/admin.qtpl:73 //line views/admin.qtpl:79
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line views/admin.qtpl:73 //line views/admin.qtpl:79
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line views/admin.qtpl:73 //line views/admin.qtpl:79
return qs422016 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) { func StreamAdminUsersUserHTML(qw422016 *qt422016.Writer, u *user.User) {
//line views/admin.qtpl:75 //line views/admin.qtpl:81
qw422016.N().S(` qw422016.N().S(`
<div class="layout"> <div class="layout">
<main class="main-width"> <main class="main-width">
<h1>`) <h1>`)
//line views/admin.qtpl:78 //line views/admin.qtpl:84
qw422016.E().S(u.Name) qw422016.E().S(u.Name)
//line views/admin.qtpl:78 //line views/admin.qtpl:84
qw422016.N().S(`</h1> qw422016.N().S(`</h1>
<form action="" method="post"> <form action="" method="post">
@ -205,49 +223,49 @@ func StreamAdminUsersUserHTML(qw422016 *qt422016.Writer, u *user.User) {
<label for="group">Group:</label> <label for="group">Group:</label>
<select id="group" name="group"> <select id="group" name="group">
<option`) <option`)
//line views/admin.qtpl:84 //line views/admin.qtpl:90
if u.Group == "anon" { if u.Group == "anon" {
//line views/admin.qtpl:84 //line views/admin.qtpl:90
qw422016.N().S(` selected`) qw422016.N().S(` selected`)
//line views/admin.qtpl:84 //line views/admin.qtpl:90
} }
//line views/admin.qtpl:84 //line views/admin.qtpl:90
qw422016.N().S(`>anon</option> qw422016.N().S(`>anon</option>
<option`) <option`)
//line views/admin.qtpl:85 //line views/admin.qtpl:91
if u.Group == "editor" { if u.Group == "editor" {
//line views/admin.qtpl:85 //line views/admin.qtpl:91
qw422016.N().S(` selected`) qw422016.N().S(` selected`)
//line views/admin.qtpl:85 //line views/admin.qtpl:91
} }
//line views/admin.qtpl:85 //line views/admin.qtpl:91
qw422016.N().S(`>editor</option> qw422016.N().S(`>editor</option>
<option`) <option`)
//line views/admin.qtpl:86 //line views/admin.qtpl:92
if u.Group == "trusted" { if u.Group == "trusted" {
//line views/admin.qtpl:86 //line views/admin.qtpl:92
qw422016.N().S(` selected`) qw422016.N().S(` selected`)
//line views/admin.qtpl:86 //line views/admin.qtpl:92
} }
//line views/admin.qtpl:86 //line views/admin.qtpl:92
qw422016.N().S(`>trusted</option> qw422016.N().S(`>trusted</option>
<option`) <option`)
//line views/admin.qtpl:87 //line views/admin.qtpl:93
if u.Group == "moderator" { if u.Group == "moderator" {
//line views/admin.qtpl:87 //line views/admin.qtpl:93
qw422016.N().S(` selected`) qw422016.N().S(` selected`)
//line views/admin.qtpl:87 //line views/admin.qtpl:93
} }
//line views/admin.qtpl:87 //line views/admin.qtpl:93
qw422016.N().S(`>moderator</option> qw422016.N().S(`>moderator</option>
<option`) <option`)
//line views/admin.qtpl:88 //line views/admin.qtpl:94
if u.Group == "admin" { if u.Group == "admin" {
//line views/admin.qtpl:88 //line views/admin.qtpl:94
qw422016.N().S(` selected`) qw422016.N().S(` selected`)
//line views/admin.qtpl:88 //line views/admin.qtpl:94
} }
//line views/admin.qtpl:88 //line views/admin.qtpl:94
qw422016.N().S(`>admin</option> qw422016.N().S(`>admin</option>
</select> </select>
</div> </div>
@ -258,31 +276,31 @@ func StreamAdminUsersUserHTML(qw422016 *qt422016.Writer, u *user.User) {
</main> </main>
</div> </div>
`) `)
//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) { func WriteAdminUsersUserHTML(qq422016 qtio422016.Writer, u *user.User) {
//line views/admin.qtpl:97 //line views/admin.qtpl:103
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line views/admin.qtpl:97 //line views/admin.qtpl:103
StreamAdminUsersUserHTML(qw422016, u) StreamAdminUsersUserHTML(qw422016, u)
//line views/admin.qtpl:97 //line views/admin.qtpl:103
qt422016.ReleaseWriter(qw422016) 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 { func AdminUsersUserHTML(u *user.User) string {
//line views/admin.qtpl:97 //line views/admin.qtpl:103
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line views/admin.qtpl:97 //line views/admin.qtpl:103
WriteAdminUsersUserHTML(qb422016, u) WriteAdminUsersUserHTML(qb422016, u)
//line views/admin.qtpl:97 //line views/admin.qtpl:103
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line views/admin.qtpl:97 //line views/admin.qtpl:103
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line views/admin.qtpl:97 //line views/admin.qtpl:103
return qs422016 return qs422016
//line views/admin.qtpl:97 //line views/admin.qtpl:103
} }