1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-12-12 13:30:26 +00:00
mycorrhiza/views/admin.qtpl.go

307 lines
7.1 KiB
Go
Raw Normal View History

2021-06-29 10:34:36 +00:00
// Code generated by qtc from "admin.qtpl". DO NOT EDIT.
// See https://github.com/valyala/quicktemplate for details.
//line views/admin.qtpl:1
package views
//line views/admin.qtpl:1
2021-06-29 19:26:36 +00:00
import "github.com/bouncepaw/mycorrhiza/cfg"
//line views/admin.qtpl:2
2021-06-29 10:34:36 +00:00
import "github.com/bouncepaw/mycorrhiza/user"
2021-06-29 19:26:36 +00:00
//line views/admin.qtpl:4
2021-06-29 10:34:36 +00:00
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
2021-06-29 19:26:36 +00:00
//line views/admin.qtpl:4
2021-06-29 10:34:36 +00:00
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
2021-06-29 19:26:36 +00:00
//line views/admin.qtpl:4
func StreamAdminPanelHTML(qw422016 *qt422016.Writer) {
2021-06-29 19:26:36 +00:00
//line views/admin.qtpl:4
2021-06-29 10:34:36 +00:00
qw422016.N().S(`
<div class="layout">
<main class="main-width">
<h1>Administrative functions</h1>
<section>
<h2>Safe things</h2>
<ul>
<li><a href="/about">About this wiki</a></li>
<li><a href="/user-list">User list</a></li>
<li><a href="/update-header-links">Update header links</a></li>
2021-06-30 12:56:38 +00:00
<li><a href="/admin/users/">Manage users</a></li>
</ul>
</section>
<section>
<h2>Dangerous things</h2>
<form action="/admin/shutdown" method="POST" style="float:left">
<fieldset>
<legend>Shutdown wiki</legend>
<input type="submit" class="btn">
</fieldset>
</form>
<form action="/reindex" method="GET" style="float:left">
<fieldset>
<legend>Reindex hyphae</legend>
<input type="submit" class="btn">
</fieldset>
</form>
</section>
</main>
</div>
`)
2021-06-30 12:56:38 +00:00
//line views/admin.qtpl:34
}
2021-06-30 12:56:38 +00:00
//line views/admin.qtpl:34
func WriteAdminPanelHTML(qq422016 qtio422016.Writer) {
2021-06-30 12:56:38 +00:00
//line views/admin.qtpl:34
qw422016 := qt422016.AcquireWriter(qq422016)
2021-06-30 12:56:38 +00:00
//line views/admin.qtpl:34
StreamAdminPanelHTML(qw422016)
2021-06-30 12:56:38 +00:00
//line views/admin.qtpl:34
qt422016.ReleaseWriter(qw422016)
2021-06-30 12:56:38 +00:00
//line views/admin.qtpl:34
}
2021-06-30 12:56:38 +00:00
//line views/admin.qtpl:34
func AdminPanelHTML() string {
2021-06-30 12:56:38 +00:00
//line views/admin.qtpl:34
qb422016 := qt422016.AcquireByteBuffer()
2021-06-30 12:56:38 +00:00
//line views/admin.qtpl:34
WriteAdminPanelHTML(qb422016)
2021-06-30 12:56:38 +00:00
//line views/admin.qtpl:34
qs422016 := string(qb422016.B)
2021-06-30 12:56:38 +00:00
//line views/admin.qtpl:34
qt422016.ReleaseByteBuffer(qb422016)
2021-06-30 12:56:38 +00:00
//line views/admin.qtpl:34
return qs422016
2021-06-30 12:56:38 +00:00
//line views/admin.qtpl:34
}
2021-06-30 12:56:38 +00:00
//line views/admin.qtpl:36
func StreamAdminUsersPanelHTML(qw422016 *qt422016.Writer, userList []*user.User) {
2021-06-30 12:56:38 +00:00
//line views/admin.qtpl:36
qw422016.N().S(`
<div class="layout">
2021-06-29 10:34:36 +00:00
<main class="main-width">
<h1>Manage users</h1>
<form action="/admin/reindex-users" method="post">
2021-06-30 12:56:38 +00:00
<button class="btn" type="submit">Reindex users</button>
2021-06-29 10:34:36 +00:00
</form>
<h2>Users list</h2>
2021-06-30 12:56:38 +00:00
<table class="users-table">
2021-06-29 10:34:36 +00:00
<thead>
<tr>
<th>Name</th>
<th>Group</th>
<th>Registered at</th>
2021-06-30 12:56:38 +00:00
<th aria-label="Actions"></th>
2021-06-29 10:34:36 +00:00
</tr>
</thead>
<tbody>
`)
2021-06-30 12:56:38 +00:00
//line views/admin.qtpl:57
2021-06-29 10:34:36 +00:00
for _, u := range userList {
2021-06-30 12:56:38 +00:00
//line views/admin.qtpl:57
2021-06-29 10:34:36 +00:00
qw422016.N().S(`
<tr>
2021-06-30 12:56:38 +00:00
<td class="table-cell--fill">
2021-06-29 19:26:36 +00:00
<a href="/hypha/`)
2021-06-30 12:56:38 +00:00
//line views/admin.qtpl:60
qw422016.N().U(cfg.UserHypha)
//line views/admin.qtpl:60
2021-06-29 19:26:36 +00:00
qw422016.N().S(`/`)
2021-06-30 12:56:38 +00:00
//line views/admin.qtpl:60
qw422016.N().U(u.Name)
//line views/admin.qtpl:60
2021-06-29 19:26:36 +00:00
qw422016.N().S(`">`)
2021-06-30 12:56:38 +00:00
//line views/admin.qtpl:60
2021-06-29 19:26:36 +00:00
qw422016.E().S(u.Name)
2021-06-30 12:56:38 +00:00
//line views/admin.qtpl:60
2021-06-29 19:26:36 +00:00
qw422016.N().S(`</a>
</td>
2021-06-29 10:34:36 +00:00
<td>`)
2021-06-30 12:56:38 +00:00
//line views/admin.qtpl:62
qw422016.E().S(u.Group)
2021-06-30 12:56:38 +00:00
//line views/admin.qtpl:62
2021-06-29 10:34:36 +00:00
qw422016.N().S(`</td>
2021-07-01 08:29:19 +00:00
<td>
`)
//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(`
</td>
<td>
<a href="/admin/users/`)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:71
qw422016.N().U(u.Name)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:71
qw422016.N().S(`/edit">Edit</a>
</td>
2021-06-29 10:34:36 +00:00
</tr>
`)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:74
2021-06-29 10:34:36 +00:00
}
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:74
2021-06-29 10:34:36 +00:00
qw422016.N().S(`
</tbody>
</table>
</main>
</div>
`)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:79
2021-06-29 10:34:36 +00:00
}
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:79
2021-06-29 10:34:36 +00:00
func WriteAdminUsersPanelHTML(qq422016 qtio422016.Writer, userList []*user.User) {
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:79
2021-06-29 10:34:36 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:79
2021-06-29 10:34:36 +00:00
StreamAdminUsersPanelHTML(qw422016, userList)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:79
2021-06-29 10:34:36 +00:00
qt422016.ReleaseWriter(qw422016)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:79
2021-06-29 10:34:36 +00:00
}
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:79
2021-06-29 10:34:36 +00:00
func AdminUsersPanelHTML(userList []*user.User) string {
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:79
2021-06-29 10:34:36 +00:00
qb422016 := qt422016.AcquireByteBuffer()
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:79
2021-06-29 10:34:36 +00:00
WriteAdminUsersPanelHTML(qb422016, userList)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:79
qs422016 := string(qb422016.B)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:79
qt422016.ReleaseByteBuffer(qb422016)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:79
return qs422016
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:79
}
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:81
func StreamAdminUsersUserHTML(qw422016 *qt422016.Writer, u *user.User) {
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:81
qw422016.N().S(`
<div class="layout">
<main class="main-width">
<h1>`)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:84
qw422016.E().S(u.Name)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:84
qw422016.N().S(`</h1>
<form action="" method="post">
2021-06-30 12:56:38 +00:00
<div class="form-field">
<label for="group">Group:</label>
<select id="group" name="group">
<option`)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:90
if u.Group == "anon" {
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:90
qw422016.N().S(` selected`)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:90
}
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:90
qw422016.N().S(`>anon</option>
2021-06-30 12:56:38 +00:00
<option`)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:91
if u.Group == "editor" {
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:91
qw422016.N().S(` selected`)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:91
}
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:91
qw422016.N().S(`>editor</option>
2021-06-30 12:56:38 +00:00
<option`)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:92
if u.Group == "trusted" {
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:92
qw422016.N().S(` selected`)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:92
}
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:92
qw422016.N().S(`>trusted</option>
2021-06-30 12:56:38 +00:00
<option`)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:93
if u.Group == "moderator" {
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:93
qw422016.N().S(` selected`)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:93
}
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:93
qw422016.N().S(`>moderator</option>
2021-06-30 12:56:38 +00:00
<option`)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:94
if u.Group == "admin" {
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:94
qw422016.N().S(` selected`)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:94
}
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:94
qw422016.N().S(`>admin</option>
2021-06-30 12:56:38 +00:00
</select>
</div>
2021-06-30 12:56:38 +00:00
<button class="btn" type="submit">Update</button>
<a class="btn btn_weak" href="/admin/users/">Cancel</a>
</form>
</main>
</div>
`)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:103
}
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:103
func WriteAdminUsersUserHTML(qq422016 qtio422016.Writer, u *user.User) {
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:103
qw422016 := qt422016.AcquireWriter(qq422016)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:103
StreamAdminUsersUserHTML(qw422016, u)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:103
qt422016.ReleaseWriter(qw422016)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:103
}
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:103
func AdminUsersUserHTML(u *user.User) string {
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:103
qb422016 := qt422016.AcquireByteBuffer()
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:103
WriteAdminUsersUserHTML(qb422016, u)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:103
2021-06-29 10:34:36 +00:00
qs422016 := string(qb422016.B)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:103
2021-06-29 10:34:36 +00:00
qt422016.ReleaseByteBuffer(qb422016)
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:103
2021-06-29 10:34:36 +00:00
return qs422016
2021-07-01 08:29:19 +00:00
//line views/admin.qtpl:103
2021-06-29 10:34:36 +00:00
}