@geekity/cms 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +870 -0
- package/admin/layouts/_flash.njk +5 -0
- package/admin/layouts/base.njk +27 -0
- package/admin/layouts/dashboard.njk +78 -0
- package/admin/layouts/document-conflict.njk +49 -0
- package/admin/layouts/document-editor.njk +167 -0
- package/admin/layouts/document-list.njk +92 -0
- package/admin/layouts/federation.njk +145 -0
- package/admin/layouts/login.njk +23 -0
- package/admin/layouts/placeholder.njk +10 -0
- package/admin/layouts/settings.njk +116 -0
- package/admin/layouts/setup.njk +27 -0
- package/admin/layouts/shell.njk +37 -0
- package/admin/layouts/users.njk +91 -0
- package/admin/static/admin.css +726 -0
- package/admin/static/editor.js +30 -0
- package/dist/admin/assets.d.ts +26 -0
- package/dist/admin/assets.d.ts.map +1 -0
- package/dist/admin/assets.js +38 -0
- package/dist/admin/assets.js.map +1 -0
- package/dist/admin/credentials.d.ts +28 -0
- package/dist/admin/credentials.d.ts.map +1 -0
- package/dist/admin/credentials.js +39 -0
- package/dist/admin/credentials.js.map +1 -0
- package/dist/admin/documents.d.ts +134 -0
- package/dist/admin/documents.d.ts.map +1 -0
- package/dist/admin/documents.js +613 -0
- package/dist/admin/documents.js.map +1 -0
- package/dist/admin/federation.d.ts +194 -0
- package/dist/admin/federation.d.ts.map +1 -0
- package/dist/admin/federation.js +299 -0
- package/dist/admin/federation.js.map +1 -0
- package/dist/admin/flash.d.ts +24 -0
- package/dist/admin/flash.d.ts.map +1 -0
- package/dist/admin/flash.js +31 -0
- package/dist/admin/flash.js.map +1 -0
- package/dist/admin/index.d.ts +23 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +15 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/passwords.d.ts +49 -0
- package/dist/admin/passwords.d.ts.map +1 -0
- package/dist/admin/passwords.js +122 -0
- package/dist/admin/passwords.js.map +1 -0
- package/dist/admin/preview.d.ts +18 -0
- package/dist/admin/preview.d.ts.map +1 -0
- package/dist/admin/preview.js +83 -0
- package/dist/admin/preview.js.map +1 -0
- package/dist/admin/routes.d.ts +54 -0
- package/dist/admin/routes.d.ts.map +1 -0
- package/dist/admin/routes.js +383 -0
- package/dist/admin/routes.js.map +1 -0
- package/dist/admin/session.d.ts +44 -0
- package/dist/admin/session.d.ts.map +1 -0
- package/dist/admin/session.js +69 -0
- package/dist/admin/session.js.map +1 -0
- package/dist/admin/settings.d.ts +194 -0
- package/dist/admin/settings.d.ts.map +1 -0
- package/dist/admin/settings.js +470 -0
- package/dist/admin/settings.js.map +1 -0
- package/dist/admin/store.d.ts +407 -0
- package/dist/admin/store.d.ts.map +1 -0
- package/dist/admin/store.js +704 -0
- package/dist/admin/store.js.map +1 -0
- package/dist/admin/templates.d.ts +36 -0
- package/dist/admin/templates.d.ts.map +1 -0
- package/dist/admin/templates.js +43 -0
- package/dist/admin/templates.js.map +1 -0
- package/dist/admin/uploads.d.ts +96 -0
- package/dist/admin/uploads.d.ts.map +1 -0
- package/dist/admin/uploads.js +179 -0
- package/dist/admin/uploads.js.map +1 -0
- package/dist/admin/users.d.ts +95 -0
- package/dist/admin/users.d.ts.map +1 -0
- package/dist/admin/users.js +233 -0
- package/dist/admin/users.js.map +1 -0
- package/dist/cli.d.ts +85 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +424 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +172 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +184 -0
- package/dist/config.js.map +1 -0
- package/dist/content/document.d.ts +66 -0
- package/dist/content/document.d.ts.map +1 -0
- package/dist/content/document.js +13 -0
- package/dist/content/document.js.map +1 -0
- package/dist/content/index.d.ts +17 -0
- package/dist/content/index.d.ts.map +1 -0
- package/dist/content/index.js +10 -0
- package/dist/content/index.js.map +1 -0
- package/dist/content/markdown.d.ts +3 -0
- package/dist/content/markdown.d.ts.map +1 -0
- package/dist/content/markdown.js +39 -0
- package/dist/content/markdown.js.map +1 -0
- package/dist/content/media.d.ts +65 -0
- package/dist/content/media.d.ts.map +1 -0
- package/dist/content/media.js +143 -0
- package/dist/content/media.js.map +1 -0
- package/dist/content/parser.d.ts +24 -0
- package/dist/content/parser.d.ts.map +1 -0
- package/dist/content/parser.js +165 -0
- package/dist/content/parser.js.map +1 -0
- package/dist/content/save.d.ts +60 -0
- package/dist/content/save.d.ts.map +1 -0
- package/dist/content/save.js +103 -0
- package/dist/content/save.js.map +1 -0
- package/dist/content/slug.d.ts +25 -0
- package/dist/content/slug.d.ts.map +1 -0
- package/dist/content/slug.js +75 -0
- package/dist/content/slug.js.map +1 -0
- package/dist/content/store.d.ts +133 -0
- package/dist/content/store.d.ts.map +1 -0
- package/dist/content/store.js +411 -0
- package/dist/content/store.js.map +1 -0
- package/dist/content/sync.d.ts +146 -0
- package/dist/content/sync.d.ts.map +1 -0
- package/dist/content/sync.js +421 -0
- package/dist/content/sync.js.map +1 -0
- package/dist/content/writer.d.ts +37 -0
- package/dist/content/writer.d.ts.map +1 -0
- package/dist/content/writer.js +97 -0
- package/dist/content/writer.js.map +1 -0
- package/dist/env.d.ts +48 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/env.js +2 -0
- package/dist/env.js.map +1 -0
- package/dist/federation/actor.d.ts +55 -0
- package/dist/federation/actor.d.ts.map +1 -0
- package/dist/federation/actor.js +101 -0
- package/dist/federation/actor.js.map +1 -0
- package/dist/federation/article.d.ts +83 -0
- package/dist/federation/article.d.ts.map +1 -0
- package/dist/federation/article.js +169 -0
- package/dist/federation/article.js.map +1 -0
- package/dist/federation/delivery.d.ts +90 -0
- package/dist/federation/delivery.d.ts.map +1 -0
- package/dist/federation/delivery.js +289 -0
- package/dist/federation/delivery.js.map +1 -0
- package/dist/federation/federation.d.ts +75 -0
- package/dist/federation/federation.d.ts.map +1 -0
- package/dist/federation/federation.js +190 -0
- package/dist/federation/federation.js.map +1 -0
- package/dist/federation/followers.d.ts +43 -0
- package/dist/federation/followers.d.ts.map +1 -0
- package/dist/federation/followers.js +69 -0
- package/dist/federation/followers.js.map +1 -0
- package/dist/federation/inbox.d.ts +68 -0
- package/dist/federation/inbox.d.ts.map +1 -0
- package/dist/federation/inbox.js +171 -0
- package/dist/federation/inbox.js.map +1 -0
- package/dist/federation/index.d.ts +14 -0
- package/dist/federation/index.d.ts.map +1 -0
- package/dist/federation/index.js +10 -0
- package/dist/federation/index.js.map +1 -0
- package/dist/federation/keys.d.ts +27 -0
- package/dist/federation/keys.d.ts.map +1 -0
- package/dist/federation/keys.js +60 -0
- package/dist/federation/keys.js.map +1 -0
- package/dist/federation/mount.d.ts +23 -0
- package/dist/federation/mount.d.ts.map +1 -0
- package/dist/federation/mount.js +71 -0
- package/dist/federation/mount.js.map +1 -0
- package/dist/federation/paths.d.ts +85 -0
- package/dist/federation/paths.d.ts.map +1 -0
- package/dist/federation/paths.js +97 -0
- package/dist/federation/paths.js.map +1 -0
- package/dist/index.d.ts +106 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +148 -0
- package/dist/index.js.map +1 -0
- package/dist/init.d.ts +71 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/init.js +125 -0
- package/dist/init.js.map +1 -0
- package/dist/web/assets.d.ts +65 -0
- package/dist/web/assets.d.ts.map +1 -0
- package/dist/web/assets.js +152 -0
- package/dist/web/assets.js.map +1 -0
- package/dist/web/context.d.ts +121 -0
- package/dist/web/context.d.ts.map +1 -0
- package/dist/web/context.js +112 -0
- package/dist/web/context.js.map +1 -0
- package/dist/web/documents.d.ts +28 -0
- package/dist/web/documents.d.ts.map +1 -0
- package/dist/web/documents.js +39 -0
- package/dist/web/documents.js.map +1 -0
- package/dist/web/feeds.d.ts +122 -0
- package/dist/web/feeds.d.ts.map +1 -0
- package/dist/web/feeds.js +229 -0
- package/dist/web/feeds.js.map +1 -0
- package/dist/web/index.d.ts +17 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +10 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/negotiate.d.ts +219 -0
- package/dist/web/negotiate.d.ts.map +1 -0
- package/dist/web/negotiate.js +409 -0
- package/dist/web/negotiate.js.map +1 -0
- package/dist/web/pagination.d.ts +48 -0
- package/dist/web/pagination.d.ts.map +1 -0
- package/dist/web/pagination.js +30 -0
- package/dist/web/pagination.js.map +1 -0
- package/dist/web/render.d.ts +72 -0
- package/dist/web/render.d.ts.map +1 -0
- package/dist/web/render.js +73 -0
- package/dist/web/render.js.map +1 -0
- package/dist/web/routes.d.ts +31 -0
- package/dist/web/routes.d.ts.map +1 -0
- package/dist/web/routes.js +366 -0
- package/dist/web/routes.js.map +1 -0
- package/dist/web/templates.d.ts +34 -0
- package/dist/web/templates.d.ts.map +1 -0
- package/dist/web/templates.js +106 -0
- package/dist/web/templates.js.map +1 -0
- package/package.json +68 -0
- package/templates/site/content/_data/site.json +8 -0
- package/templates/site/content/pages/about.md +11 -0
- package/templates/site/content/pages/pages.json +3 -0
- package/templates/site/content/posts/2026-01-01-hello-world.md +34 -0
- package/templates/site/content/posts/posts.json +4 -0
- package/templates/site/geekity.config.ts +11 -0
- package/templates/site/gitignore +3 -0
- package/templates/site/server.ts +20 -0
- package/templates/site/tsconfig.json +18 -0
- package/themes/default/README.md +148 -0
- package/themes/default/layouts/404.njk +9 -0
- package/themes/default/layouts/base.njk +59 -0
- package/themes/default/layouts/home.njk +9 -0
- package/themes/default/layouts/page.njk +13 -0
- package/themes/default/layouts/post.njk +30 -0
- package/themes/default/layouts/tag.njk +19 -0
- package/themes/default/partials/pagination.njk +14 -0
- package/themes/default/partials/post-list.njk +24 -0
- package/themes/default/partials/tags.njk +12 -0
- package/themes/default/static/style.css +327 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
{# /admin/settings: the values doc-5 lists, stored in SQLite and mirrored to
|
|
2
|
+
content/_data/site.json on every save. #}
|
|
3
|
+
{% extends "layouts/shell.njk" %}
|
|
4
|
+
|
|
5
|
+
{% block title %}Settings{% endblock %}
|
|
6
|
+
|
|
7
|
+
{% block content %}
|
|
8
|
+
<h1>Settings</h1>
|
|
9
|
+
|
|
10
|
+
{% if problems.title or problems.tagline or problems.baseUrl or problems.timezone or problems.postsPerPage or problems.author or problems.actorHandle or problems.actorType %}
|
|
11
|
+
<p class="admin-error">Nothing was saved. Fix the fields marked below and try again.</p>
|
|
12
|
+
{% endif %}
|
|
13
|
+
|
|
14
|
+
<form class="admin-settings" method="post" action="{{ settingsUrl }}">
|
|
15
|
+
<input type="hidden" name="csrf_token" value="{{ csrfToken }}" />
|
|
16
|
+
|
|
17
|
+
<h2>Site</h2>
|
|
18
|
+
|
|
19
|
+
<label for="settings-title">Title</label>
|
|
20
|
+
<input id="settings-title" name="{{ fields.title }}" type="text" value="{{ form.title }}" required autofocus />
|
|
21
|
+
{% if problems.title %}<p class="admin-field-error">{{ problems.title }}</p>{% endif %}
|
|
22
|
+
|
|
23
|
+
<label for="settings-tagline">Tagline</label>
|
|
24
|
+
<input id="settings-tagline" name="{{ fields.tagline }}" type="text" value="{{ form.tagline }}" />
|
|
25
|
+
<p class="admin-hint">One line, shown under the title and used as the feed subtitle.</p>
|
|
26
|
+
|
|
27
|
+
<label for="settings-author">Author</label>
|
|
28
|
+
<input id="settings-author" name="{{ fields.author }}" type="text" value="{{ form.author }}" />
|
|
29
|
+
<p class="admin-hint">The name on the feeds.</p>
|
|
30
|
+
|
|
31
|
+
<label for="settings-base-url">Base URL</label>
|
|
32
|
+
<input
|
|
33
|
+
id="settings-base-url"
|
|
34
|
+
name="{{ fields.baseUrl }}"
|
|
35
|
+
type="text"
|
|
36
|
+
value="{{ form.baseUrl }}"
|
|
37
|
+
inputmode="url"
|
|
38
|
+
{% if baseUrlOverridden %}readonly disabled{% endif %}
|
|
39
|
+
/>
|
|
40
|
+
{% if problems.baseUrl %}<p class="admin-field-error">{{ problems.baseUrl }}</p>{% endif %}
|
|
41
|
+
<p class="admin-hint">
|
|
42
|
+
In effect: <code>{{ baseUrlInEffect }}</code>. {{ baseUrlNote }}
|
|
43
|
+
</p>
|
|
44
|
+
|
|
45
|
+
<label for="settings-timezone">Time zone</label>
|
|
46
|
+
<input id="settings-timezone" name="{{ fields.timezone }}" type="text" value="{{ form.timezone }}" required />
|
|
47
|
+
{% if problems.timezone %}<p class="admin-field-error">{{ problems.timezone }}</p>{% endif %}
|
|
48
|
+
<p class="admin-hint">An IANA name, such as <code>Europe/London</code> or <code>UTC</code>.</p>
|
|
49
|
+
|
|
50
|
+
<label for="settings-posts-per-page">Posts per page</label>
|
|
51
|
+
<input id="settings-posts-per-page" name="{{ fields.postsPerPage }}" type="text" inputmode="numeric" value="{{ form.postsPerPage }}" required />
|
|
52
|
+
{% if problems.postsPerPage %}<p class="admin-field-error">{{ problems.postsPerPage }}</p>{% endif %}
|
|
53
|
+
|
|
54
|
+
<h2>Federation</h2>
|
|
55
|
+
|
|
56
|
+
<label for="settings-actor-handle">Actor handle</label>
|
|
57
|
+
<input id="settings-actor-handle" name="{{ fields.actorHandle }}" type="text" value="{{ form.actorHandle }}" required />
|
|
58
|
+
{% if problems.actorHandle %}<p class="admin-field-error">{{ problems.actorHandle }}</p>{% endif %}
|
|
59
|
+
<p class="admin-hint">The local part of the site's handle: <code>@{{ form.actorHandle }}@…</code>.</p>
|
|
60
|
+
|
|
61
|
+
<label for="settings-actor-type">Actor type</label>
|
|
62
|
+
<select id="settings-actor-type" name="{{ fields.actorType }}">
|
|
63
|
+
{% for type in actorTypes %}
|
|
64
|
+
<option value="{{ type }}"{% if type == form.actorType %} selected{% endif %}>{{ type }}</option>
|
|
65
|
+
{% endfor %}
|
|
66
|
+
</select>
|
|
67
|
+
{% if problems.actorType %}<p class="admin-field-error">{{ problems.actorType }}</p>{% endif %}
|
|
68
|
+
<p class="admin-hint">Some clients hide <code>Service</code> actors from timelines; <code>Person</code> is the safer default.</p>
|
|
69
|
+
|
|
70
|
+
<p class="admin-settings-buttons">
|
|
71
|
+
<button type="submit">Save settings</button>
|
|
72
|
+
</p>
|
|
73
|
+
</form>
|
|
74
|
+
|
|
75
|
+
{# The avatar is its own pair of forms: a file cannot travel in the
|
|
76
|
+
urlencoded body the settings form posts, and a rejected image must not
|
|
77
|
+
take an edit to the title down with it. #}
|
|
78
|
+
<section class="admin-settings admin-avatar-panel">
|
|
79
|
+
<h2>Avatar</h2>
|
|
80
|
+
|
|
81
|
+
<div class="admin-avatar-current">
|
|
82
|
+
{% if avatar %}
|
|
83
|
+
<img class="admin-avatar admin-avatar-large" src="{{ avatar }}" alt="The site's avatar" width="96" height="96" />
|
|
84
|
+
{% else %}
|
|
85
|
+
<span class="admin-avatar admin-avatar-large admin-avatar-blank" aria-hidden="true"></span>
|
|
86
|
+
{% endif %}
|
|
87
|
+
|
|
88
|
+
<div class="admin-avatar-forms">
|
|
89
|
+
<form method="post" action="{{ avatarUrl }}" enctype="multipart/form-data">
|
|
90
|
+
<input type="hidden" name="csrf_token" value="{{ csrfToken }}" />
|
|
91
|
+
<label for="settings-avatar">Image</label>
|
|
92
|
+
<input id="settings-avatar" name="{{ avatarFields.file }}" type="file" accept="image/png,image/jpeg,image/webp,image/gif" required />
|
|
93
|
+
<p class="admin-settings-buttons">
|
|
94
|
+
<button type="submit">Upload avatar</button>
|
|
95
|
+
</p>
|
|
96
|
+
</form>
|
|
97
|
+
|
|
98
|
+
{% if avatar %}
|
|
99
|
+
<form method="post" action="{{ avatarUrl }}">
|
|
100
|
+
<input type="hidden" name="csrf_token" value="{{ csrfToken }}" />
|
|
101
|
+
<input type="hidden" name="{{ avatarFields.action }}" value="{{ avatarRemove }}" />
|
|
102
|
+
<p class="admin-settings-buttons">
|
|
103
|
+
<button type="submit">Remove avatar</button>
|
|
104
|
+
</p>
|
|
105
|
+
</form>
|
|
106
|
+
{% endif %}
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
<p class="admin-hint">
|
|
111
|
+
A PNG, JPEG, WebP or GIF, stored with the site's other uploads. It is the
|
|
112
|
+
picture on the site's fediverse profile, and saving or removing it tells
|
|
113
|
+
the followers.
|
|
114
|
+
</p>
|
|
115
|
+
</section>
|
|
116
|
+
{% endblock %}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{% extends "layouts/base.njk" %}
|
|
2
|
+
|
|
3
|
+
{% block title %}Set up{% endblock %}
|
|
4
|
+
|
|
5
|
+
{% block content %}
|
|
6
|
+
<h1>Create the first admin</h1>
|
|
7
|
+
<p>Nobody can sign in to this site yet. Pick a username and a password.</p>
|
|
8
|
+
|
|
9
|
+
{% if error %}
|
|
10
|
+
<p class="error">{{ error }}</p>
|
|
11
|
+
{% endif %}
|
|
12
|
+
|
|
13
|
+
<form method="post" action="{{ setupUrl }}">
|
|
14
|
+
<input type="hidden" name="csrf_token" value="{{ csrfToken }}" />
|
|
15
|
+
|
|
16
|
+
<label for="username">Username</label>
|
|
17
|
+
<input id="username" name="username" type="text" autocomplete="username" value="{{ username }}" required autofocus />
|
|
18
|
+
|
|
19
|
+
<label for="password">Password</label>
|
|
20
|
+
<input id="password" name="password" type="password" autocomplete="new-password" required />
|
|
21
|
+
|
|
22
|
+
<label for="password_confirmation">Repeat the password</label>
|
|
23
|
+
<input id="password_confirmation" name="password_confirmation" type="password" autocomplete="new-password" required />
|
|
24
|
+
|
|
25
|
+
<button type="submit">Create admin</button>
|
|
26
|
+
</form>
|
|
27
|
+
{% endblock %}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{# The signed-in admin: a bar across the top, the sections down the left, the
|
|
2
|
+
screen itself in the middle. Every screen behind the login extends this. #}
|
|
3
|
+
{% extends "layouts/base.njk" %}
|
|
4
|
+
|
|
5
|
+
{% block chrome %}
|
|
6
|
+
<header class="admin-bar">
|
|
7
|
+
<a class="admin-bar-site" href="{{ adminUrl }}">{{ site.title }}</a>
|
|
8
|
+
<a href="{{ siteUrl }}">View site</a>
|
|
9
|
+
<span class="admin-bar-spacer"></span>
|
|
10
|
+
{% if user %}
|
|
11
|
+
<span class="admin-bar-user">Signed in as {{ user.username }}</span>
|
|
12
|
+
<form method="post" action="{{ logoutUrl }}">
|
|
13
|
+
<input type="hidden" name="csrf_token" value="{{ csrfToken }}" />
|
|
14
|
+
<button type="submit">Log out</button>
|
|
15
|
+
</form>
|
|
16
|
+
{% endif %}
|
|
17
|
+
</header>
|
|
18
|
+
{% endblock %}
|
|
19
|
+
|
|
20
|
+
{% block main %}
|
|
21
|
+
<div class="admin-shell">
|
|
22
|
+
<nav class="admin-nav" aria-label="Sections">
|
|
23
|
+
<ul>
|
|
24
|
+
{% for item in navigation %}
|
|
25
|
+
<li>
|
|
26
|
+
<a href="{{ item.url }}"{% if item.section == section %} aria-current="page"{% endif %}>{{ item.label }}</a>
|
|
27
|
+
</li>
|
|
28
|
+
{% endfor %}
|
|
29
|
+
</ul>
|
|
30
|
+
</nav>
|
|
31
|
+
|
|
32
|
+
<main class="admin-main">
|
|
33
|
+
{% include "layouts/_flash.njk" %}
|
|
34
|
+
{% block content %}{% endblock %}
|
|
35
|
+
</main>
|
|
36
|
+
</div>
|
|
37
|
+
{% endblock %}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{# /admin/users: who can sign in, how to add one, and how to change your own
|
|
2
|
+
password. One role, so a row has no fields to edit. #}
|
|
3
|
+
{% extends "layouts/shell.njk" %}
|
|
4
|
+
|
|
5
|
+
{% block title %}Users{% endblock %}
|
|
6
|
+
|
|
7
|
+
{% block content %}
|
|
8
|
+
<h1>Users</h1>
|
|
9
|
+
|
|
10
|
+
<table class="admin-list">
|
|
11
|
+
<thead>
|
|
12
|
+
<tr>
|
|
13
|
+
<th scope="col">Username</th>
|
|
14
|
+
<th scope="col">Created</th>
|
|
15
|
+
<th scope="col">Actions</th>
|
|
16
|
+
</tr>
|
|
17
|
+
</thead>
|
|
18
|
+
<tbody>
|
|
19
|
+
{% for entry in users %}
|
|
20
|
+
<tr>
|
|
21
|
+
<td>{{ entry.username }}{% if entry.you %} <span class="admin-status">(you)</span>{% endif %}</td>
|
|
22
|
+
<td>{{ entry.createdAt | date('html') }}</td>
|
|
23
|
+
<td class="admin-actions">
|
|
24
|
+
{% if entry.deletable %}
|
|
25
|
+
<form method="post" action="{{ deleteUserUrl }}">
|
|
26
|
+
<input type="hidden" name="csrf_token" value="{{ csrfToken }}" />
|
|
27
|
+
<input type="hidden" name="{{ fields.userId }}" value="{{ entry.id }}" />
|
|
28
|
+
<button type="submit">Delete</button>
|
|
29
|
+
</form>
|
|
30
|
+
{% endif %}
|
|
31
|
+
</td>
|
|
32
|
+
</tr>
|
|
33
|
+
{% endfor %}
|
|
34
|
+
</tbody>
|
|
35
|
+
</table>
|
|
36
|
+
|
|
37
|
+
<form class="admin-settings" method="post" action="{{ usersUrl }}">
|
|
38
|
+
<input type="hidden" name="csrf_token" value="{{ csrfToken }}" />
|
|
39
|
+
|
|
40
|
+
<h2>Add a user</h2>
|
|
41
|
+
|
|
42
|
+
{% if addProblems.username or addProblems.password %}
|
|
43
|
+
<p class="admin-error">Nobody was added. Fix the fields marked below and try again.</p>
|
|
44
|
+
{% endif %}
|
|
45
|
+
|
|
46
|
+
<label for="add-username">Username</label>
|
|
47
|
+
<input id="add-username" name="{{ fields.username }}" type="text" value="{{ addForm.username }}" required />
|
|
48
|
+
{% if addProblems.username %}<p class="admin-field-error">{{ addProblems.username }}</p>{% endif %}
|
|
49
|
+
|
|
50
|
+
<label for="add-password">Password</label>
|
|
51
|
+
<input id="add-password" name="{{ fields.password }}" type="password" autocomplete="new-password" />
|
|
52
|
+
{% if addProblems.password %}<p class="admin-field-error">{{ addProblems.password }}</p>{% endif %}
|
|
53
|
+
|
|
54
|
+
<p class="admin-check">
|
|
55
|
+
<input id="add-generate" name="{{ fields.generate }}" type="checkbox" value="1"{% if addForm.generate %} checked{% endif %} />
|
|
56
|
+
<label for="add-generate">Generate one instead, and show it to me once</label>
|
|
57
|
+
</p>
|
|
58
|
+
<p class="admin-hint">A generated password is shown on the next page and nowhere else. Copy it before you leave.</p>
|
|
59
|
+
|
|
60
|
+
<p class="admin-settings-buttons">
|
|
61
|
+
<button type="submit">Add user</button>
|
|
62
|
+
</p>
|
|
63
|
+
</form>
|
|
64
|
+
|
|
65
|
+
<form class="admin-settings" method="post" action="{{ changePasswordUrl }}">
|
|
66
|
+
<input type="hidden" name="csrf_token" value="{{ csrfToken }}" />
|
|
67
|
+
|
|
68
|
+
<h2>Change your password</h2>
|
|
69
|
+
|
|
70
|
+
{% if passwordProblems.currentPassword or passwordProblems.newPassword %}
|
|
71
|
+
<p class="admin-error">Your password was not changed. Fix the fields marked below and try again.</p>
|
|
72
|
+
{% endif %}
|
|
73
|
+
|
|
74
|
+
<label for="current-password">Current password</label>
|
|
75
|
+
<input id="current-password" name="{{ fields.currentPassword }}" type="password" autocomplete="current-password" required />
|
|
76
|
+
{% if passwordProblems.currentPassword %}<p class="admin-field-error">{{ passwordProblems.currentPassword }}</p>{% endif %}
|
|
77
|
+
|
|
78
|
+
<label for="new-password">New password</label>
|
|
79
|
+
<input id="new-password" name="{{ fields.newPassword }}" type="password" autocomplete="new-password" required />
|
|
80
|
+
{% if passwordProblems.newPassword %}<p class="admin-field-error">{{ passwordProblems.newPassword }}</p>{% endif %}
|
|
81
|
+
|
|
82
|
+
<label for="new-password-confirmation">New password again</label>
|
|
83
|
+
<input id="new-password-confirmation" name="{{ fields.newPasswordConfirmation }}" type="password" autocomplete="new-password" required />
|
|
84
|
+
|
|
85
|
+
<p class="admin-hint">Every other browser signed in as you is signed out. This one stays.</p>
|
|
86
|
+
|
|
87
|
+
<p class="admin-settings-buttons">
|
|
88
|
+
<button type="submit">Change password</button>
|
|
89
|
+
</p>
|
|
90
|
+
</form>
|
|
91
|
+
{% endblock %}
|