Migration This is my new public git source viewer. Source coming soon. Please contact with concerns/bugs. Contact me

internal/notices/admin.html

83aa601b98007ead72afeadb131a93d5694e04ca · 2.5 KB · 64 lines raw

1 <!doctype html>
2 <html lang="en">
3 <head>
4 <meta charset="utf-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1">
6 <title>Notices &middot; {{ .Site }}</title>
7 <link rel="stylesheet" href="/static/css/base.css">
8 <link rel="stylesheet" href="/static/css/admin.css">
9 <script src="/static/js/admin.js" defer></script>
10 </head>
11 <body>
12 <main class="wrap">
13 <header class="hero">
14 <h1 class="page-title">Notices</h1>
15 <p class="page-subtitle">Global notices render above every repository's.</p>
16 </header>
17
18 {{ if .Saved }}<div class="notice notice-fix">Saved.</div>{{ end }}
19 {{ if .Error }}<div class="notice notice-critical">
20 <strong class="notice-title">Not saved</strong>
21 <pre class="notice-body">{{ .Error }}</pre>
22 </div>{{ end }}
23
24 <form method="post" action="/admin/notices" class="admin-form">
25 <input type="hidden" name="csrf" value="{{ .CSRF }}">
26 <div class="table-wrap">
27 <table class="table admin-table">
28 <thead>
29 <tr>
30 <th>Scope</th><th>Type</th><th>Title</th><th>Body</th>
31 <th>Link</th><th>Link text</th><th>Remove</th>
32 </tr>
33 </thead>
34 <tbody>
35 {{ range $i, $row := .Rows }}
36 <tr>
37 <td><select name="scope">
38 <option value="global"{{ if eq $row.Scope "global" }} selected{{ end }}>global</option>
39 {{ range $.Repos }}<option value="{{ . }}"{{ if eq $row.Scope . }} selected{{ end }}>{{ . }}</option>{{ end }}
40 </select></td>
41 <td><select name="type">
42 <option value="critical"{{ if eq $row.Type "critical" }} selected{{ end }}>critical</option>
43 <option value="warning"{{ if eq $row.Type "warning" }} selected{{ end }}>warning</option>
44 <option value="info"{{ if eq $row.Type "info" }} selected{{ end }}>info</option>
45 <option value="fix"{{ if eq $row.Type "fix" }} selected{{ end }}>fix</option>
46 </select></td>
47 <td><input name="title" value="{{ $row.Title }}"></td>
48 <td><textarea name="body" rows="2">{{ $row.Body }}</textarea></td>
49 <td><input name="link" value="{{ $row.Link }}"></td>
50 <td><input name="link_text" value="{{ $row.LinkText }}"></td>
51 <td class="admin-del"><input type="checkbox" name="del" value="{{ $i }}"></td>
52 </tr>
53 {{ end }}
54 </tbody>
55 </table>
56 </div>
57 <p class="admin-actions">
58 <button class="chip admin-save" type="submit">Save notices</button>
59 <button class="chip js-only" type="button" id="add-notice">Add notice</button>
60 </p>
61 </form>
62 </main>
63 </body>
64 </html>