@raketa-cloud/admin 0.0.22 → 0.0.24

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.
Files changed (40) hide show
  1. package/package.json +1 -1
  2. package/src/Adapter.js +59 -8
  3. package/src/HonoAdapter.js +8 -5
  4. package/src/helpers/FormBuilder.js +124 -1
  5. package/src/helpers/form_for.js +5 -3
  6. package/src/styles/application.css +24 -0
  7. package/src/views/article_revisions/codes/edit_form.ejs +2 -2
  8. package/src/views/article_revisions/general/edit_form.ejs +2 -2
  9. package/src/views/article_revisions/meta/edit_form.ejs +2 -2
  10. package/src/views/article_revisions/publishes/create_form.ejs +1 -2
  11. package/src/views/article_revisions/tags/edit_form.ejs +2 -2
  12. package/src/views/article_revisions/visuals/edit_form.ejs +2 -2
  13. package/src/views/articles/create_form.ejs +1 -1
  14. package/src/views/articles/edit_form.ejs +1 -1
  15. package/src/views/articles/translations/create_form.ejs +1 -1
  16. package/src/views/event_revisions/codes/edit_form.ejs +2 -2
  17. package/src/views/event_revisions/general/edit_form.ejs +2 -2
  18. package/src/views/event_revisions/meta/edit_form.ejs +2 -2
  19. package/src/views/event_revisions/publishes/create_form.ejs +1 -2
  20. package/src/views/event_revisions/tags/edit_form.ejs +2 -2
  21. package/src/views/event_revisions/visuals/edit_form.ejs +2 -2
  22. package/src/views/events/create_form.ejs +1 -1
  23. package/src/views/events/edit_form.ejs +1 -1
  24. package/src/views/events/translations/create_form.ejs +1 -1
  25. package/src/views/page_revisions/codes/edit_form.ejs +2 -2
  26. package/src/views/page_revisions/general/edit_form.ejs +2 -2
  27. package/src/views/page_revisions/meta/edit_form.ejs +2 -2
  28. package/src/views/page_revisions/publishes/create_form.ejs +1 -1
  29. package/src/views/page_revisions/tags/edit_form.ejs +2 -2
  30. package/src/views/page_revisions/visuals/edit_form.ejs +2 -2
  31. package/src/views/pages/create_form.ejs +1 -1
  32. package/src/views/pages/edit_form.ejs +1 -1
  33. package/src/views/pages/translations/create_form.ejs +1 -1
  34. package/src/views/redirects/create_form.ejs +1 -1
  35. package/src/views/redirects/edit_form.ejs +2 -2
  36. package/src/views/settings/general/edit_form.ejs +2 -2
  37. package/src/views/settings/layout/edit_form.ejs +1 -1
  38. package/src/views/settings/meta/edit_form.ejs +2 -2
  39. package/src/views/tags/create_form.ejs +2 -2
  40. package/src/views/tags/edit_form.ejs +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raketa-cloud/admin",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "main": "src/index.js",
5
5
  "scripts": {
6
6
  "dev": "npx tailwindcss -i ./src/styles/application.css -o ../../apps/admin/static/application.css --watch",
package/src/Adapter.js CHANGED
@@ -1,6 +1,6 @@
1
- import currentPath from "./currentPath.cjs";
2
- import { existsSync } from "node:fs";
1
+ import { existsSync, readFileSync } from "node:fs";
3
2
  import ejs from "ejs";
3
+ import currentPath from "./currentPath.cjs";
4
4
  import FormBuilder from "./helpers/FormBuilder";
5
5
  import HTMLBuilder from "./helpers/HTMLBuilder";
6
6
  import form_for from "./helpers/form_for";
@@ -88,6 +88,13 @@ function putIn(result, key, value) {
88
88
  });
89
89
  }
90
90
 
91
+ function getPartialPath(partialPath) {
92
+ const packagePath = `${currentPath}/views/${partialPath}`;
93
+ const appPath = `${process.cwd()}/src/views/${partialPath}`;
94
+
95
+ return existsSync(appPath) ? appPath : packagePath;
96
+ }
97
+
91
98
  export default class Adapter {
92
99
  constructor(router) {
93
100
  this.router = router;
@@ -116,11 +123,17 @@ export default class Adapter {
116
123
  return existsSync(appPath) ? appPath : packagePath;
117
124
  }
118
125
 
119
- getHelpers() {
126
+ getHelpers(viewHelpersConfig) {
120
127
  const t = new HTMLBuilder();
121
128
  const f = new FormBuilder();
122
129
 
123
- return { t, f, form_for, sort_button, pagination };
130
+ return {
131
+ t,
132
+ f,
133
+ form_for: form_for(viewHelpersConfig),
134
+ sort_button,
135
+ pagination,
136
+ };
124
137
  }
125
138
 
126
139
  async renderLayout(assigns, body) {
@@ -132,13 +145,51 @@ export default class Adapter {
132
145
  });
133
146
  }
134
147
 
135
- async renderAction({ views, action, assigns }) {
148
+ renderPartial(assigns) {
149
+ return function render(relativePath, localAssigns) {
150
+ const partialPath = getPartialPath(relativePath);
151
+ try {
152
+ // Synchronously read the partial file as ejs does not support async/await
153
+ const partialTemplate = readFileSync(partialPath, "utf8");
154
+ const rendered = ejs.render(
155
+ partialTemplate,
156
+ {
157
+ ...assigns,
158
+ ...localAssigns,
159
+ },
160
+ { filename: partialPath }
161
+ );
162
+
163
+ return rendered;
164
+ } catch (e) {
165
+ const error = `Error rendering:\n ${partialPath}`;
166
+ Logger.error(`${error}\n\n${e.stack}`);
167
+
168
+ return renderError(error, e.stack);
169
+ }
170
+ };
171
+ }
172
+
173
+ async renderAction({ views, action, assigns }, viewHelpersConfig = {}) {
136
174
  const fullTemplatePath = this.getActionPath(views, action);
137
- const renderAssigns = { ...this.getHelpers(), ...assigns };
175
+ const renderAssigns = { ...this.getHelpers(viewHelpersConfig), ...assigns };
176
+ const renderPartialHelper = this.renderPartial(renderAssigns);
138
177
 
139
178
  try {
140
- const rendered = await ejs.renderFile(fullTemplatePath, renderAssigns);
141
- const fullPage = await this.renderLayout(renderAssigns, rendered);
179
+ // Synchronously read the full template file
180
+ const template = readFileSync(fullTemplatePath, "utf8");
181
+
182
+ // Render the full template with synchronous partial rendering
183
+ const rendered = ejs.render(
184
+ template,
185
+ {
186
+ ...renderAssigns,
187
+ render_partial: renderPartialHelper,
188
+ },
189
+ { filename: fullTemplatePath }
190
+ );
191
+
192
+ const fullPage = this.renderLayout(renderAssigns, rendered);
142
193
 
143
194
  return fullPage;
144
195
  } catch (e) {
@@ -185,11 +185,14 @@ export default class HonoAdapter extends Adapter {
185
185
  return routerCtx.json(json);
186
186
  }
187
187
 
188
- const rendered = this.renderAction({
189
- views,
190
- action,
191
- assigns: fullAssigns,
192
- });
188
+ const rendered = this.renderAction(
189
+ {
190
+ views,
191
+ action,
192
+ assigns: fullAssigns,
193
+ },
194
+ this.globalConfig?.helpers || {}
195
+ );
193
196
 
194
197
  return routerCtx.html(rendered);
195
198
  });
@@ -1,5 +1,61 @@
1
1
  import HTMLBuilder from "./HTMLBuilder";
2
2
 
3
+ const BUTTON_FIELDS_MAP = {
4
+ label: { label: "Label" },
5
+ link: { label: "Link" },
6
+ id: { label: "ID" },
7
+ type: {
8
+ label: "Type",
9
+ as: "select",
10
+ options: [
11
+ ["primary", "Primary"],
12
+ ["secondary", "Secondary"],
13
+ ["text", "Text"],
14
+ ],
15
+ },
16
+ target: {
17
+ label: "Target",
18
+ as: "select",
19
+ options: [
20
+ ["_self", "Self"],
21
+ ["_blank", "New Tab"],
22
+ ],
23
+ },
24
+ rel: {
25
+ label: "Follow Link",
26
+ as: "select",
27
+ options: [
28
+ ["follow", "Follow"],
29
+ ["nofollow", "No Follow"],
30
+ ],
31
+ },
32
+ };
33
+
34
+ const LINK_FIELDS_MAP = {
35
+ label: { label: "Label" },
36
+ link: { label: "Link" },
37
+ id: { label: "ID" },
38
+ className: {
39
+ label: "CSS Class",
40
+ },
41
+ target: {
42
+ label: "Target",
43
+ as: "select",
44
+ options: [
45
+ ["_self", "Self"],
46
+ ["_blank", "New Tab"],
47
+ ],
48
+ },
49
+ rel: {
50
+ label: "Follow Link",
51
+ as: "select",
52
+ options: [
53
+ ["follow", "Follow"],
54
+ ["nofollow", "No Follow"],
55
+ ],
56
+ },
57
+ };
58
+
3
59
  function dig(obj, path) {
4
60
  return path.split(".").reduce((acc, key) => {
5
61
  if (acc && Object.hasOwn(acc, key)) {
@@ -33,10 +89,11 @@ function toFormName(dotNotation) {
33
89
  }
34
90
 
35
91
  export default class FormBuilder extends HTMLBuilder {
36
- constructor(obj = {}, errors = {}) {
92
+ constructor(obj = {}, errors = {}, config = {}) {
37
93
  super();
38
94
  this.obj = obj;
39
95
  this.errors = errors;
96
+ this.config = config;
40
97
  }
41
98
 
42
99
  __getValue(name) {
@@ -85,6 +142,7 @@ export default class FormBuilder extends HTMLBuilder {
85
142
  const selected = value || this.__getValue(name);
86
143
 
87
144
  const renderedOpts = [];
145
+
88
146
  if (prompt) {
89
147
  renderedOpts.push(this.tag("option", prompt, { value: "" }));
90
148
  }
@@ -191,8 +249,73 @@ export default class FormBuilder extends HTMLBuilder {
191
249
  return this.tag("button", label, { type: "submit", ...opts });
192
250
  }
193
251
 
252
+ button(name, opts) {
253
+ const { label, ...rest } = opts;
254
+ const defaultLabel = opts?.label || this.__getDefaultLabel(name);
255
+ const fields = Object.keys(BUTTON_FIELDS_MAP).map((key) => {
256
+ const innerOpts = BUTTON_FIELDS_MAP[key];
257
+
258
+ if (innerOpts.as) {
259
+ return this.field(`${name}.${key}`, {
260
+ as: innerOpts.as,
261
+ options: this.config.buttons?.[`${key}Options`] || innerOpts.options,
262
+ label: innerOpts.label,
263
+ class: "no-margin",
264
+ });
265
+ } else {
266
+ return this.field(`${name}.${key}`, {
267
+ label: innerOpts.label,
268
+ class: "no-margin",
269
+ });
270
+ }
271
+ });
272
+
273
+ return this.tag(
274
+ "fieldset",
275
+ [this.tag("legend", defaultLabel, {}), ...fields].join(""),
276
+ {
277
+ class: "button-group",
278
+ }
279
+ );
280
+ }
281
+
282
+ link(name, opts) {
283
+ const { label, ...rest } = opts;
284
+ const defaultLabel = opts?.label || this.__getDefaultLabel(name);
285
+ const fields = Object.keys(LINK_FIELDS_MAP).map((key) => {
286
+ const innerOpts = LINK_FIELDS_MAP[key];
287
+
288
+ if (innerOpts.as) {
289
+ return this.field(`${name}.${key}`, {
290
+ as: innerOpts.as,
291
+ options: innerOpts.options,
292
+ label: innerOpts.label,
293
+ class: "no-margin",
294
+ });
295
+ } else {
296
+ return this.field(`${name}.${key}`, {
297
+ label: innerOpts.label,
298
+ class: "no-margin",
299
+ });
300
+ }
301
+ });
302
+
303
+ return this.tag(
304
+ "fieldset",
305
+ [this.tag("legend", defaultLabel, {}), ...fields].join(""),
306
+ {
307
+ class: "link-group",
308
+ }
309
+ );
310
+ }
311
+
194
312
  field(name, opts = {}) {
195
313
  const { as = "input", label, ...rest } = opts;
314
+
315
+ if (as === "button" || as === "link") {
316
+ return this[as](name, { ...rest, label });
317
+ }
318
+
196
319
  const defaultLabel = opts?.label || this.__getDefaultLabel(name);
197
320
  const htmlID = this.__getID(name);
198
321
  const error = this.__getError(name);
@@ -1,6 +1,8 @@
1
1
  import FormBuilder from "./FormBuilder";
2
2
 
3
- export default function form_for(obj = {}, errors = {}, callback = (_) => {}) {
4
- const form = new FormBuilder(obj, errors);
5
- return callback(form);
3
+ export default function form_for(viewHelpersConfig = {}) {
4
+ return function form_for(obj = {}, errors = {}, callback = (_) => {}) {
5
+ const form = new FormBuilder(obj, errors, viewHelpersConfig);
6
+ return callback(form);
7
+ };
6
8
  }
@@ -170,6 +170,30 @@ body {
170
170
  .hint {
171
171
  @apply text-sm opacity-50;
172
172
  }
173
+
174
+ .button-group,
175
+ .link-group {
176
+ @apply grid grid-cols-6 gap-4 mb-4;
177
+ }
178
+
179
+ .button-group label,
180
+ .link-group label {
181
+ @apply font-normal;
182
+ }
183
+
184
+ .button-group legend,
185
+ .link-group legend {
186
+ @apply col-span-6 text-nowrap text-sm font-semibold w-fit pb-2;
187
+ }
188
+
189
+ .button-group div,
190
+ .link-group div {
191
+ @apply col-span-2 mb-0;
192
+ }
193
+
194
+ .no-margin {
195
+ @apply m-0;
196
+ }
173
197
  }
174
198
 
175
199
  .inline-form {
@@ -3,7 +3,7 @@
3
3
  <h1 class="heading-1">Edit revision / Code customizations</h1>
4
4
  </div>
5
5
 
6
- <%- include('../_nav.ejs', { settings: code_settings, active: 'codes' }) %>
6
+ <%- render_partial('article_revisions/_nav.ejs', { settings: code_settings, active: 'codes' }) %>
7
7
 
8
8
  <div class="grid gap-4 md:grid-cols-3">
9
9
  <div>
@@ -24,7 +24,7 @@
24
24
 
25
25
  <div>
26
26
  <div class="help">
27
- <div class="mb-2 flex items-center gap-1">
27
+ <div class="flex items-center gap-1 mb-2">
28
28
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
29
29
  <path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" />
30
30
  </svg>
@@ -3,7 +3,7 @@
3
3
  <h1 class="heading-1">Edit revision / General</h1>
4
4
  </div>
5
5
 
6
- <%- include('../_nav.ejs', { settings: general_settings, active: 'general' }) %>
6
+ <%- render_partial('article_revisions/_nav.ejs', { settings: general_settings, active: 'general' }) %>
7
7
 
8
8
  <div class="grid gap-4 md:grid-cols-3">
9
9
  <div>
@@ -29,7 +29,7 @@
29
29
 
30
30
  <div>
31
31
  <div class="help">
32
- <div class="mb-2 flex items-center gap-1">
32
+ <div class="flex items-center gap-1 mb-2">
33
33
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
34
34
  <path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" />
35
35
  </svg>
@@ -3,7 +3,7 @@
3
3
  <h1 class="heading-1">Edit revision / Open graph & meta tags</h1>
4
4
  </div>
5
5
 
6
- <%- include('../_nav.ejs', { settings: meta_settings, active: 'meta' }) %>
6
+ <%- render_partial('article_revisions/_nav.ejs', { settings: meta_settings, active: 'meta' }) %>
7
7
 
8
8
  <div class="grid gap-4 md:grid-cols-3">
9
9
  <div>
@@ -26,7 +26,7 @@
26
26
 
27
27
  <div>
28
28
  <div class="help">
29
- <div class="mb-2 flex items-center gap-1">
29
+ <div class="flex items-center gap-1 mb-2">
30
30
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
31
31
  <path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" />
32
32
  </svg>
@@ -4,7 +4,6 @@
4
4
  </div>
5
5
 
6
6
  <div class="grid gap-4 md:grid-cols-3">
7
- <%- include('_form.ejs') %>
7
+ <%- render_partial('article_revisions/publishes/_form.ejs') %>
8
8
  </div>
9
9
  </div>
10
-
@@ -3,7 +3,7 @@
3
3
  <h1 class="heading-1">Edit revision / Content tags</h1>
4
4
  </div>
5
5
 
6
- <%- include('../_nav.ejs', { settings: tag_settings, active: 'tags' }) %>
6
+ <%- render_partial('article_revisions/_nav.ejs', { settings: tag_settings, active: 'tags' }) %>
7
7
 
8
8
  <div class="grid gap-4 md:grid-cols-3">
9
9
  <div>
@@ -23,7 +23,7 @@
23
23
 
24
24
  <div>
25
25
  <div class="help">
26
- <div class="mb-2 flex items-center gap-1">
26
+ <div class="flex items-center gap-1 mb-2">
27
27
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
28
28
  <path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" />
29
29
  </svg>
@@ -3,7 +3,7 @@
3
3
  <h1 class="heading-1">Edit revision / Visuals</h1>
4
4
  </div>
5
5
 
6
- <%- include('../_nav.ejs', { settings: visual_settings, active: 'visuals' }) %>
6
+ <%- render_partial('article_revisions/_nav.ejs', { settings: visual_settings, active: 'visuals' }) %>
7
7
 
8
8
  <div class="grid gap-4 md:grid-cols-3">
9
9
  <div>
@@ -27,7 +27,7 @@
27
27
 
28
28
  <div>
29
29
  <div class="help">
30
- <div class="mb-2 flex items-center gap-1">
30
+ <div class="flex items-center gap-1 mb-2">
31
31
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
32
32
  <path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" />
33
33
  </svg>
@@ -4,6 +4,6 @@
4
4
  </div>
5
5
 
6
6
  <div class="grid gap-4 md:grid-cols-3">
7
- <%- include('_form.ejs') %>
7
+ <%- render_partial('articles/_form.ejs') %>
8
8
  </div>
9
9
  </div>
@@ -1,3 +1,3 @@
1
1
  <h1>Hello from edit form <%= id %></h1>
2
2
 
3
- <%- include('_form.ejs') %>
3
+ <%- render_partial('articles/_form.ejs') %>
@@ -4,6 +4,6 @@
4
4
  </div>
5
5
 
6
6
  <div class="grid gap-4 md:grid-cols-3">
7
- <%- include('_form.ejs') %>
7
+ <%- render_partial('articles/translations/_form.ejs') %>
8
8
  </div>
9
9
  </div>
@@ -3,7 +3,7 @@
3
3
  <h1 class="heading-1">Edit revision / Code customizations</h1>
4
4
  </div>
5
5
 
6
- <%- include('../_nav.ejs', { settings: code_settings, active: 'codes' }) %>
6
+ <%- render_partial('event_revisions/_nav.ejs', { settings: code_settings, active: 'codes' }) %>
7
7
 
8
8
  <div class="grid gap-4 md:grid-cols-3">
9
9
  <div>
@@ -24,7 +24,7 @@
24
24
 
25
25
  <div>
26
26
  <div class="help">
27
- <div class="mb-2 flex items-center gap-1">
27
+ <div class="flex items-center gap-1 mb-2">
28
28
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
29
29
  <path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" />
30
30
  </svg>
@@ -3,7 +3,7 @@
3
3
  <h1 class="heading-1">Edit revision / General</h1>
4
4
  </div>
5
5
 
6
- <%- include('../_nav.ejs', { settings: general_settings, active: 'general' }) %>
6
+ <%- render_partial('event_revisions/_nav.ejs', { settings: general_settings, active: 'general' }) %>
7
7
 
8
8
  <div class="grid gap-4 md:grid-cols-3">
9
9
  <div>
@@ -31,7 +31,7 @@
31
31
 
32
32
  <div>
33
33
  <div class="help">
34
- <div class="mb-2 flex items-center gap-1">
34
+ <div class="flex items-center gap-1 mb-2">
35
35
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
36
36
  <path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" />
37
37
  </svg>
@@ -3,7 +3,7 @@
3
3
  <h1 class="heading-1">Edit revision / Open graph & meta tags</h1>
4
4
  </div>
5
5
 
6
- <%- include('../_nav.ejs', { settings: meta_settings, active: 'meta' }) %>
6
+ <%- render_partial('event_revisions/_nav.ejs', { settings: meta_settings, active: 'meta' }) %>
7
7
 
8
8
  <div class="grid gap-4 md:grid-cols-3">
9
9
  <div>
@@ -26,7 +26,7 @@
26
26
 
27
27
  <div>
28
28
  <div class="help">
29
- <div class="mb-2 flex items-center gap-1">
29
+ <div class="flex items-center gap-1 mb-2">
30
30
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
31
31
  <path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" />
32
32
  </svg>
@@ -4,7 +4,6 @@
4
4
  </div>
5
5
 
6
6
  <div class="grid gap-4 md:grid-cols-3">
7
- <%- include('_form.ejs') %>
7
+ <%- render_partial('event_revisions/publishes/_form.ejs') %>
8
8
  </div>
9
9
  </div>
10
-
@@ -3,7 +3,7 @@
3
3
  <h1 class="heading-1">Edit revision / Content tags</h1>
4
4
  </div>
5
5
 
6
- <%- include('../_nav.ejs', { settings: tag_settings, active: 'tags' }) %>
6
+ <%- render_partial('event_revisions/_nav.ejs', { settings: tag_settings, active: 'tags' }) %>
7
7
 
8
8
  <div class="grid gap-4 md:grid-cols-3">
9
9
  <div>
@@ -23,7 +23,7 @@
23
23
 
24
24
  <div>
25
25
  <div class="help">
26
- <div class="mb-2 flex items-center gap-1">
26
+ <div class="flex items-center gap-1 mb-2">
27
27
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
28
28
  <path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" />
29
29
  </svg>
@@ -3,7 +3,7 @@
3
3
  <h1 class="heading-1">Edit revision / Visuals</h1>
4
4
  </div>
5
5
 
6
- <%- include('../_nav.ejs', { settings: visual_settings, active: 'visuals' }) %>
6
+ <%- render_partial('event_revisions/_nav.ejs', { settings: visual_settings, active: 'visuals' }) %>
7
7
 
8
8
  <div class="grid gap-4 md:grid-cols-3">
9
9
  <div>
@@ -27,7 +27,7 @@
27
27
 
28
28
  <div>
29
29
  <div class="help">
30
- <div class="mb-2 flex items-center gap-1">
30
+ <div class="flex items-center gap-1 mb-2">
31
31
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
32
32
  <path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" />
33
33
  </svg>
@@ -4,6 +4,6 @@
4
4
  </div>
5
5
 
6
6
  <div class="grid gap-4 md:grid-cols-3">
7
- <%- include('_form.ejs') %>
7
+ <%- render_partial('events/_form.ejs') %>
8
8
  </div>
9
9
  </div>
@@ -1,3 +1,3 @@
1
1
  <h1>Hello from edit form <%= id %></h1>
2
2
 
3
- <%- include('_form.ejs') %>
3
+ <%- render_partial('events/_form.ejs') %>
@@ -4,7 +4,7 @@
4
4
  </div>
5
5
 
6
6
  <div class="grid gap-4 md:grid-cols-3">
7
- <%- include('_form.ejs') %>
7
+ <%- render_partial('events/translations/_form.ejs') %>
8
8
  </div>
9
9
  </div>
10
10
 
@@ -3,7 +3,7 @@
3
3
  <h1 class="heading-1">Edit revision / Code customizations</h1>
4
4
  </div>
5
5
 
6
- <%- include('../_nav.ejs', { settings: code_settings, active: 'codes' }) %>
6
+ <%- render_partial('page_revisions/_nav.ejs', { settings: code_settings, active: 'codes' }) %>
7
7
 
8
8
  <div class="grid gap-4 md:grid-cols-3">
9
9
  <div>
@@ -24,7 +24,7 @@
24
24
 
25
25
  <div>
26
26
  <div class="help">
27
- <div class="mb-2 flex items-center gap-1">
27
+ <div class="flex items-center gap-1 mb-2">
28
28
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
29
29
  <path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" />
30
30
  </svg>
@@ -3,7 +3,7 @@
3
3
  <h1 class="heading-1">Edit revision / General</h1>
4
4
  </div>
5
5
 
6
- <%- include('../_nav.ejs', { settings: general_settings, active: 'general' }) %>
6
+ <%- render_partial('page_revisions/_nav.ejs', { settings: general_settings, active: 'general' }) %>
7
7
 
8
8
  <div class="grid gap-4 md:grid-cols-3">
9
9
  <div>
@@ -28,7 +28,7 @@
28
28
 
29
29
  <div>
30
30
  <div class="help">
31
- <div class="mb-2 flex items-center gap-1">
31
+ <div class="flex items-center gap-1 mb-2">
32
32
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
33
33
  <path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" />
34
34
  </svg>
@@ -3,7 +3,7 @@
3
3
  <h1 class="heading-1">Edit revision / Open graph & meta tags</h1>
4
4
  </div>
5
5
 
6
- <%- include('../_nav.ejs', { settings: meta_settings, active: 'meta' }) %>
6
+ <%- render_partial('page_revisions/_nav.ejs', { settings: meta_settings, active: 'meta' }) %>
7
7
 
8
8
  <div class="grid gap-4 md:grid-cols-3">
9
9
  <div>
@@ -26,7 +26,7 @@
26
26
 
27
27
  <div>
28
28
  <div class="help">
29
- <div class="mb-2 flex items-center gap-1">
29
+ <div class="flex items-center gap-1 mb-2">
30
30
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
31
31
  <path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" />
32
32
  </svg>
@@ -4,7 +4,7 @@
4
4
  </div>
5
5
 
6
6
  <div class="grid gap-4 md:grid-cols-3">
7
- <%- include('_form.ejs') %>
7
+ <%- render_partial('page_revisions/publishes/_form.ejs') %>
8
8
  </div>
9
9
  </div>
10
10
 
@@ -3,7 +3,7 @@
3
3
  <h1 class="heading-1">Edit revision / Content tags</h1>
4
4
  </div>
5
5
 
6
- <%- include('../_nav.ejs', { settings: tag_settings, active: 'tags' }) %>
6
+ <%- render_partial('page_revisions/_nav.ejs', { settings: tag_settings, active: 'tags' }) %>
7
7
 
8
8
  <div class="grid gap-4 md:grid-cols-3">
9
9
  <div>
@@ -23,7 +23,7 @@
23
23
 
24
24
  <div>
25
25
  <div class="help">
26
- <div class="mb-2 flex items-center gap-1">
26
+ <div class="flex items-center gap-1 mb-2">
27
27
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
28
28
  <path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" />
29
29
  </svg>
@@ -3,7 +3,7 @@
3
3
  <h1 class="heading-1">Edit revision / Visuals</h1>
4
4
  </div>
5
5
 
6
- <%- include('../_nav.ejs', { settings: visual_settings, active: 'visuals' }) %>
6
+ <%- render_partial('page_revisions/_nav.ejs', { settings: visual_settings, active: 'visuals' }) %>
7
7
 
8
8
  <div class="grid gap-4 md:grid-cols-3">
9
9
  <div>
@@ -27,7 +27,7 @@
27
27
 
28
28
  <div>
29
29
  <div class="help">
30
- <div class="mb-2 flex items-center gap-1">
30
+ <div class="flex items-center gap-1 mb-2">
31
31
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
32
32
  <path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" />
33
33
  </svg>
@@ -4,6 +4,6 @@
4
4
  </div>
5
5
 
6
6
  <div class="grid gap-4 md:grid-cols-3">
7
- <%- include('_form.ejs') %>
7
+ <%- render_partial('pages/_form.ejs') %>
8
8
  </div>
9
9
  </div>
@@ -1,3 +1,3 @@
1
1
  <h1>Hello from edit form <%= id %></h1>
2
2
 
3
- <%- include('_form.ejs') %>
3
+ <%- render_partial('pages/_form.ejs') %>
@@ -4,6 +4,6 @@
4
4
  </div>
5
5
 
6
6
  <div class="grid gap-4 md:grid-cols-3">
7
- <%- include('_form.ejs') %>
7
+ <%- render_partial('pages/translations/_form.ejs') %>
8
8
  </div>
9
9
  </div>
@@ -4,6 +4,6 @@
4
4
  </div>
5
5
 
6
6
  <div class="grid gap-4 md:grid-cols-3">
7
- <%- include('_form.ejs') %>
7
+ <%- render_partial('redirects/_form.ejs') %>
8
8
  </div>
9
9
  </div>
@@ -4,6 +4,6 @@
4
4
  </div>
5
5
 
6
6
  <div class="grid gap-4 md:grid-cols-3">
7
- <%- include('_form.ejs') %>
7
+ <%- render_partial('redirects/_form.ejs') %>
8
8
  </div>
9
- </div>
9
+ </div>
@@ -3,14 +3,14 @@
3
3
  <h1 class="heading-1">General</h1>
4
4
  </div>
5
5
 
6
- <%- include('../_nav.ejs', { active: 'general' }) %>
6
+ <%- render_partial('settings/_nav.ejs', { active: 'general' }) %>
7
7
 
8
8
  <div class="grid gap-4 md:grid-cols-3">
9
9
  <div></div>
10
10
 
11
11
  <div>
12
12
  <div class="help">
13
- <div class="mb-2 flex items-center gap-1">
13
+ <div class="flex items-center gap-1 mb-2">
14
14
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
15
15
  <path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" />
16
16
  </svg>
@@ -3,7 +3,7 @@
3
3
  <h1 class="heading-1">Layout and Navigation Settings</h1>
4
4
  </div>
5
5
 
6
- <%- include('../_nav.ejs', { active: 'layout' }) %>
6
+ <%- render_partial('settings/_nav.ejs', { active: 'layout' }) %>
7
7
 
8
8
  <div>
9
9
  <% form_for({ layout_settings }, errors, (f) => { %>
@@ -3,7 +3,7 @@
3
3
  <h1 class="heading-1">Meta and OpenGraph</h1>
4
4
  </div>
5
5
 
6
- <%- include('../_nav.ejs', { active: 'meta' }) %>
6
+ <%- render_partial('settings/_nav.ejs', { active: 'meta' }) %>
7
7
 
8
8
  <div class="grid gap-4 md:grid-cols-3">
9
9
  <% form_for({ meta_settings }, errors, (f) => { %>
@@ -23,7 +23,7 @@
23
23
 
24
24
  <div>
25
25
  <div class="help">
26
- <div class="mb-2 flex items-center gap-1">
26
+ <div class="flex items-center gap-1 mb-2">
27
27
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
28
28
  <path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" />
29
29
  </svg>
@@ -4,6 +4,6 @@
4
4
  </div>
5
5
 
6
6
  <div class="grid gap-4 md:grid-cols-3">
7
- <%- include('_form.ejs') %>
7
+ <%- render_partial('tags/_form.ejs') %>
8
8
  </div>
9
- </div>
9
+ </div>
@@ -4,6 +4,6 @@
4
4
  </div>
5
5
 
6
6
  <div class="grid gap-4 md:grid-cols-3">
7
- <%- include('_form.ejs') %>
7
+ <%- render_partial('tags/_form.ejs') %>
8
8
  </div>
9
- </div>
9
+ </div>