@raketa-cloud/admin 0.0.58 → 0.0.62

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 (68) hide show
  1. package/package.json +1 -1
  2. package/src/handlers/articles/DeletesHandler.js +1 -0
  3. package/src/handlers/articles/URLsHandler.js +1 -0
  4. package/src/handlers/events/DeletesHandler.js +1 -0
  5. package/src/handlers/events/URLsHandler.js +1 -0
  6. package/src/handlers/page_revisions/TagHandler.js +40 -0
  7. package/src/handlers/pages/DeletesHandler.js +1 -0
  8. package/src/handlers/pages/URLsHandler.js +1 -0
  9. package/src/helpers/FormBuilder.js +2 -2
  10. package/src/styles/application.css +4 -0
  11. package/src/tests/handlers/articles/DeletesHandler.test/create_form.test.js +2 -1
  12. package/src/tests/handlers/articles/URLsHandler.test/create_form.test.js +2 -1
  13. package/src/tests/handlers/events/DeletesHandler.test/create_form.test.js +2 -1
  14. package/src/tests/handlers/events/URLsHandler.test/create_form.test.js +2 -1
  15. package/src/tests/handlers/page_revisions/TagHandler.test/edit_form.test.js +38 -3
  16. package/src/tests/handlers/page_revisions/TagHandler.test/update.test.js +39 -3
  17. package/src/tests/handlers/pages/DeletesHandler.test/create.test.js +1 -1
  18. package/src/tests/handlers/pages/DeletesHandler.test/create_form.test.js +1 -0
  19. package/src/tests/handlers/pages/URLsHandler.test/create_form.test.js +1 -0
  20. package/src/views/article_revisions/codes/edit_form.ejs +5 -16
  21. package/src/views/article_revisions/general/_form.ejs +17 -0
  22. package/src/views/article_revisions/general/edit_form.ejs +6 -33
  23. package/src/views/article_revisions/locks/create_form.ejs +5 -3
  24. package/src/views/article_revisions/meta/edit_form.ejs +8 -19
  25. package/src/views/article_revisions/publishes/_form.ejs +19 -36
  26. package/src/views/article_revisions/tags/edit_form.ejs +5 -16
  27. package/src/views/article_revisions/visuals/edit_form.ejs +5 -16
  28. package/src/views/articles/_form.ejs +14 -19
  29. package/src/views/articles/deletes/create_form.ejs +18 -5
  30. package/src/views/articles/index.ejs +1 -19
  31. package/src/views/articles/show.ejs +1 -1
  32. package/src/views/articles/translations/_form.ejs +1 -15
  33. package/src/views/articles/urls/create_form.ejs +10 -5
  34. package/src/views/categories/_form.ejs +1 -15
  35. package/src/views/event_revisions/_nav.ejs +1 -1
  36. package/src/views/event_revisions/codes/edit_form.ejs +5 -16
  37. package/src/views/event_revisions/general/_form.ejs +19 -0
  38. package/src/views/event_revisions/general/edit_form.ejs +6 -35
  39. package/src/views/event_revisions/locks/create_form.ejs +5 -3
  40. package/src/views/event_revisions/meta/edit_form.ejs +8 -19
  41. package/src/views/event_revisions/publishes/_form.ejs +19 -36
  42. package/src/views/event_revisions/tags/edit_form.ejs +5 -16
  43. package/src/views/event_revisions/visuals/edit_form.ejs +5 -16
  44. package/src/views/events/_form.ejs +14 -19
  45. package/src/views/events/deletes/create_form.ejs +18 -5
  46. package/src/views/events/index.ejs +1 -19
  47. package/src/views/events/show.ejs +1 -1
  48. package/src/views/events/translations/_form.ejs +1 -15
  49. package/src/views/events/urls/create_form.ejs +10 -5
  50. package/src/views/page_revisions/_nav.ejs +1 -1
  51. package/src/views/page_revisions/codes/edit_form.ejs +4 -15
  52. package/src/views/page_revisions/general/_form.ejs +16 -0
  53. package/src/views/page_revisions/general/edit_form.ejs +5 -31
  54. package/src/views/page_revisions/locks/create_form.ejs +5 -3
  55. package/src/views/page_revisions/meta/edit_form.ejs +7 -18
  56. package/src/views/page_revisions/publishes/_form.ejs +19 -36
  57. package/src/views/page_revisions/tags/edit_form.ejs +9 -15
  58. package/src/views/page_revisions/visuals/edit_form.ejs +4 -15
  59. package/src/views/pages/_form.ejs +13 -18
  60. package/src/views/pages/deletes/create_form.ejs +17 -4
  61. package/src/views/pages/index.ejs +1 -19
  62. package/src/views/pages/show.ejs +3 -3
  63. package/src/views/pages/translations/create_form.ejs +13 -5
  64. package/src/views/pages/translations/index.ejs +6 -4
  65. package/src/views/pages/urls/create_form.ejs +9 -4
  66. package/src/views/redirects/_form.ejs +5 -19
  67. package/src/views/settings/meta/edit_form.ejs +4 -18
  68. package/src/views/tags/_form.ejs +2 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raketa-cloud/admin",
3
- "version": "0.0.58",
3
+ "version": "0.0.62",
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",
@@ -8,6 +8,7 @@ const create_form = async (ctx) => {
8
8
 
9
9
  return {
10
10
  assigns: {
11
+ article,
11
12
  resource: {
12
13
  id: article.id,
13
14
  redirect: "",
@@ -10,6 +10,7 @@ const create_form = async (ctx) => {
10
10
 
11
11
  return {
12
12
  assigns: {
13
+ article,
13
14
  resource: {
14
15
  id: article.id,
15
16
  slug: article.slug,
@@ -8,6 +8,7 @@ const create_form = async (ctx) => {
8
8
 
9
9
  return {
10
10
  assigns: {
11
+ event,
11
12
  resource: {
12
13
  id: event.id,
13
14
  redirect: "",
@@ -10,6 +10,7 @@ const create_form = async (ctx) => {
10
10
 
11
11
  return {
12
12
  assigns: {
13
+ event,
13
14
  resource: {
14
15
  id: event.id,
15
16
  slug: event.slug,
@@ -1,5 +1,33 @@
1
1
  import { checkboxesToArray } from "../../utils";
2
2
 
3
+ const fetchDefaultLocaleTags = async (ctx, resource) => {
4
+ if (ctx.locale === ctx.defaultLocale) {
5
+ return { defaultLocaleName: "", defaultLocaleTags: [] };
6
+ }
7
+
8
+ const originalPage = await ctx.client.pages.find(
9
+ resource.originalId,
10
+ ctx.locale
11
+ );
12
+
13
+ if (
14
+ Object.keys(originalPage.translations).length === 0 ||
15
+ !originalPage.translations[ctx.defaultLocale]
16
+ ) {
17
+ return { defaultLocaleName: "", defaultLocaleTags: [] };
18
+ }
19
+
20
+ const defaultLocale = ctx.locales[ctx.defaultLocale];
21
+ const defaultLocalePage = await ctx.client.pages.find(
22
+ originalPage.translations[ctx.defaultLocale].id,
23
+ ctx.defaultLocale
24
+ );
25
+
26
+ const defaultLocaleTags = defaultLocalePage?.tags || [];
27
+
28
+ return { defaultLocaleName: defaultLocale.name, defaultLocaleTags };
29
+ };
30
+
3
31
  const edit_form = async (ctx) => {
4
32
  const { parent_id } = ctx.params;
5
33
 
@@ -13,12 +41,19 @@ const edit_form = async (ctx) => {
13
41
 
14
42
  resource.tags = resource.tags.map((t) => t.id);
15
43
 
44
+ const { defaultLocaleName, defaultLocaleTags } = await fetchDefaultLocaleTags(
45
+ ctx,
46
+ resource
47
+ );
48
+
16
49
  return {
17
50
  assigns: {
18
51
  resource,
19
52
  tags: tags.list,
20
53
  errors: {},
21
54
  _translations: [],
55
+ defaultLocaleTags,
56
+ defaultLocaleName,
22
57
  },
23
58
  };
24
59
  };
@@ -46,6 +81,9 @@ const update = async (ctx) => {
46
81
  if (errors) {
47
82
  const tags = await ctx.client.tags.all(ctx.locale);
48
83
 
84
+ const { defaultLocaleName, defaultLocaleTags } =
85
+ await fetchDefaultLocaleTags(ctx, resource);
86
+
49
87
  return {
50
88
  assigns: {
51
89
  resource,
@@ -54,6 +92,8 @@ const update = async (ctx) => {
54
92
  resource: ctx.client.pageRevisions.formatErrors(errors),
55
93
  },
56
94
  _translations: [],
95
+ defaultLocaleTags,
96
+ defaultLocaleName,
57
97
  },
58
98
  };
59
99
  }
@@ -8,6 +8,7 @@ const create_form = async (ctx) => {
8
8
 
9
9
  return {
10
10
  assigns: {
11
+ page,
11
12
  resource: {
12
13
  id: page.id,
13
14
  redirect: "",
@@ -10,6 +10,7 @@ const create_form = async (ctx) => {
10
10
 
11
11
  return {
12
12
  assigns: {
13
+ page,
13
14
  resource: {
14
15
  id: page.id,
15
16
  slug: page.slug,
@@ -234,8 +234,8 @@ export default class FormBuilder extends HTMLBuilder {
234
234
  renderedOpts.length
235
235
  ? renderedOpts.join("")
236
236
  : this.tag("div", "No items available.", {
237
- class: "italic opacity-50",
238
- }),
237
+ class: "italic opacity-50",
238
+ }),
239
239
 
240
240
  {
241
241
  ...rest,
@@ -25,6 +25,10 @@ body {
25
25
  @apply text-raketa-foreground bg-raketa-background;
26
26
  }
27
27
 
28
+ .markdown {
29
+ @apply prose text-raketa-foreground text-sm;
30
+ }
31
+
28
32
  @layer components {
29
33
 
30
34
  /* Utils */
@@ -1,5 +1,5 @@
1
- import DeletesHandler from "../../../../handlers/articles/DeletesHandler";
2
1
  import Articles from "../../../../cloud/Articles";
2
+ import DeletesHandler from "../../../../handlers/articles/DeletesHandler";
3
3
  import Factory from "../../../support/factory";
4
4
  import { remoteConfig } from "../../../support/handlersHelper";
5
5
 
@@ -33,6 +33,7 @@ describe("Article delete", () => {
33
33
 
34
34
  expect(result).toEqual({
35
35
  assigns: {
36
+ article,
36
37
  resource: {
37
38
  id: article.id,
38
39
  redirect: "",
@@ -1,5 +1,5 @@
1
- import URLsHandler from "../../../../handlers/articles/URLsHandler";
2
1
  import Articles from "../../../../cloud/Articles";
2
+ import URLsHandler from "../../../../handlers/articles/URLsHandler";
3
3
  import Factory from "../../../support/factory";
4
4
 
5
5
  function buildCtx(article) {
@@ -31,6 +31,7 @@ describe("Article change url", () => {
31
31
 
32
32
  expect(result).toEqual({
33
33
  assigns: {
34
+ article,
34
35
  resource: { slug: article.slug, id: article.id, redirect: null },
35
36
  errors: {},
36
37
  _translations: [],
@@ -1,5 +1,5 @@
1
- import DeletesHandler from "../../../../handlers/events/DeletesHandler";
2
1
  import Events from "../../../../cloud/Events";
2
+ import DeletesHandler from "../../../../handlers/events/DeletesHandler";
3
3
  import Factory from "../../../support/factory";
4
4
  import { remoteConfig } from "../../../support/handlersHelper";
5
5
 
@@ -33,6 +33,7 @@ describe("Event delete", () => {
33
33
 
34
34
  expect(result).toEqual({
35
35
  assigns: {
36
+ event,
36
37
  resource: {
37
38
  id: event.id,
38
39
  redirect: "",
@@ -1,5 +1,5 @@
1
- import URLsHandler from "../../../../handlers/events/URLsHandler";
2
1
  import Events from "../../../../cloud/Events";
2
+ import URLsHandler from "../../../../handlers/events/URLsHandler";
3
3
  import Factory from "../../../support/factory";
4
4
 
5
5
  function buildCtx(event) {
@@ -31,6 +31,7 @@ describe("Event change url", () => {
31
31
 
32
32
  expect(result).toEqual({
33
33
  assigns: {
34
+ event,
34
35
  resource: { slug: event.slug, id: event.id, redirect: null },
35
36
  errors: {},
36
37
  _translations: [],
@@ -1,6 +1,7 @@
1
- import TagHandler from "../../../../handlers/page_revisions/TagHandler";
2
1
  import PageRevisions from "../../../../cloud/PageRevisions";
2
+ import Pages from "../../../../cloud/Pages";
3
3
  import Tags from "../../../../cloud/Tags";
4
+ import TagHandler from "../../../../handlers/page_revisions/TagHandler";
4
5
 
5
6
  import Factory from "../../../support/factory";
6
7
 
@@ -9,9 +10,17 @@ function buildCtx(revision) {
9
10
  client: {
10
11
  pageRevisions: new PageRevisions(() => ({}), "token"),
11
12
  tags: new Tags(() => ({}), "token"),
13
+ pages: new Pages(() => ({}), "token"),
12
14
  },
13
15
  params: { parent_id: revision.id },
14
16
  locale: "en",
17
+ defaultLocale: "es",
18
+ locales: {
19
+ es: {
20
+ name: "Spanish",
21
+ code: "es",
22
+ },
23
+ },
15
24
  };
16
25
  }
17
26
 
@@ -21,23 +30,47 @@ describe("Page revision tags settings", () => {
21
30
  Factory.build("tag", { id: 42 }),
22
31
  Factory.build("tag", { id: 69 }),
23
32
  ];
33
+ const spanishTags = [Factory.build("tag", { id: 100 })];
24
34
  const revision = Factory.build("page_revision", { tags: [tags[0]] });
35
+ const originalPage = Factory.build("page", {
36
+ id: "original-123",
37
+ translations: {
38
+ en: { id: "translated-123" },
39
+ es: { id: "es-translated-123" },
40
+ },
41
+ });
42
+ const spanishPage = Factory.build("page", {
43
+ id: "es-translated-123",
44
+ tags: spanishTags,
45
+ });
46
+
25
47
  const ctx = buildCtx(revision);
26
48
 
27
49
  const mockFind = jest
28
50
  .spyOn(ctx.client.pageRevisions, "find")
29
51
  .mockImplementation(() => revision);
30
52
 
53
+ const mockPageFind = jest
54
+ .spyOn(ctx.client.pages, "find")
55
+ .mockImplementation((id, locale) => {
56
+ if (locale === "es") {
57
+ return spanishPage;
58
+ }
59
+ return originalPage;
60
+ });
61
+
31
62
  const mockTags = jest
32
63
  .spyOn(ctx.client.tags, "all")
33
- .mockImplementation(() => ({
34
- list: tags,
64
+ .mockImplementation((locale) => ({
65
+ list: locale === "es" ? spanishTags : tags,
35
66
  }));
36
67
 
37
68
  const result = await TagHandler.edit_form(ctx);
38
69
 
39
70
  expect(mockFind).toHaveBeenCalledWith(revision.id, "en");
40
71
  expect(mockTags).toHaveBeenCalledWith("en");
72
+ expect(mockPageFind).toHaveBeenCalledWith(revision.originalId, "en");
73
+ expect(mockPageFind).toHaveBeenCalledWith("es-translated-123", "es");
41
74
 
42
75
  expect(result).toEqual({
43
76
  assigns: {
@@ -45,6 +78,8 @@ describe("Page revision tags settings", () => {
45
78
  tags: tags,
46
79
  errors: {},
47
80
  _translations: [],
81
+ defaultLocaleTags: spanishTags,
82
+ defaultLocaleName: "Spanish",
48
83
  },
49
84
  });
50
85
  });
@@ -1,6 +1,7 @@
1
- import TagHandler from "../../../../handlers/page_revisions/TagHandler";
2
1
  import PageRevisions from "../../../../cloud/PageRevisions";
2
+ import Pages from "../../../../cloud/Pages";
3
3
  import Tags from "../../../../cloud/Tags";
4
+ import TagHandler from "../../../../handlers/page_revisions/TagHandler";
4
5
 
5
6
  import Factory from "../../../support/factory";
6
7
 
@@ -9,12 +10,20 @@ function buildCtx(revision, updateSettings) {
9
10
  client: {
10
11
  pageRevisions: new PageRevisions(() => ({}), "token"),
11
12
  tags: new Tags(() => ({}), "token"),
13
+ pages: new Pages(() => ({}), "token"),
12
14
  },
13
15
  params: { parent_id: revision.id },
14
16
  resourceParams: {
15
17
  resource: updateSettings,
16
18
  },
17
19
  locale: "en",
20
+ defaultLocale: "es",
21
+ locales: {
22
+ es: {
23
+ name: "Spanish",
24
+ code: "es",
25
+ },
26
+ },
18
27
  resourceConfig: {
19
28
  pageType: "page",
20
29
  pageTypePlural: "pages",
@@ -70,8 +79,22 @@ describe("Page revision tags settings", () => {
70
79
  Factory.build("tag", { id: 42 }),
71
80
  Factory.build("tag", { id: 69 }),
72
81
  ];
82
+ const spanishTags = [Factory.build("tag", { id: 100 })];
73
83
  const revision = Factory.build("page_revision", { tags: [tags[0]] });
74
84
 
85
+ const originalPage = Factory.build("page", {
86
+ id: "original-123",
87
+ translations: {
88
+ en: { id: "translated-123" },
89
+ es: { id: "es-translated-123" },
90
+ },
91
+ });
92
+
93
+ const spanishPage = Factory.build("page", {
94
+ id: "es-translated-123",
95
+ tags: spanishTags,
96
+ });
97
+
75
98
  const updateSettings = {
76
99
  tags: [tags.map((t) => t.id)],
77
100
  };
@@ -91,10 +114,19 @@ describe("Page revision tags settings", () => {
91
114
 
92
115
  const mockTags = jest
93
116
  .spyOn(ctx.client.tags, "all")
94
- .mockImplementation(() => ({
95
- list: tags,
117
+ .mockImplementation((locale) => ({
118
+ list: locale === "es" ? spanishTags : tags,
96
119
  }));
97
120
 
121
+ const mockPageFind = jest
122
+ .spyOn(ctx.client.pages, "find")
123
+ .mockImplementation((id, locale) => {
124
+ if (locale === "es") {
125
+ return spanishPage;
126
+ }
127
+ return originalPage;
128
+ });
129
+
98
130
  const result = await TagHandler.update(ctx);
99
131
 
100
132
  expect(mockFind).toHaveBeenCalledWith(revision.id, "en");
@@ -108,6 +140,8 @@ describe("Page revision tags settings", () => {
108
140
  settings: revision.settings,
109
141
  });
110
142
  expect(mockTags).toHaveBeenCalledWith("en");
143
+ expect(mockPageFind).toHaveBeenCalledWith(revision.originalId, "en");
144
+ expect(mockPageFind).toHaveBeenCalledWith("es-translated-123", "es");
111
145
 
112
146
  expect(result).toEqual({
113
147
  assigns: {
@@ -120,6 +154,8 @@ describe("Page revision tags settings", () => {
120
154
  },
121
155
  tags: tags,
122
156
  _translations: [],
157
+ defaultLocaleTags: spanishTags,
158
+ defaultLocaleName: "Spanish",
123
159
  },
124
160
  });
125
161
  });
@@ -1,5 +1,5 @@
1
- import DeletesHandler from "../../../../handlers/pages/DeletesHandler";
2
1
  import Pages from "../../../../cloud/Pages";
2
+ import DeletesHandler from "../../../../handlers/pages/DeletesHandler";
3
3
  import Factory from "../../../support/factory";
4
4
  import { remoteConfig } from "../../../support/handlersHelper";
5
5
 
@@ -33,6 +33,7 @@ describe("Page delete", () => {
33
33
 
34
34
  expect(result).toEqual({
35
35
  assigns: {
36
+ page,
36
37
  resource: {
37
38
  id: page.id,
38
39
  redirect: "",
@@ -34,6 +34,7 @@ describe("Page change url", () => {
34
34
 
35
35
  expect(result).toEqual({
36
36
  assigns: {
37
+ page,
37
38
  resource: { slug: page.slug, id: page.id, redirect: null },
38
39
  errors: {},
39
40
  _translations: [],
@@ -1,6 +1,9 @@
1
1
  <div class="page-wrapper">
2
2
  <div class="page-title">
3
- <h1 class="heading-1">Edit revision / Code customizations</h1>
3
+ <h1 class="heading-1">
4
+ <span class="opacity-50">Code customizations / </span>
5
+ <%= resource.title %>
6
+ </h1>
4
7
  </div>
5
8
 
6
9
  <%- render_partial('../_nav.ejs', { resource, active: 'codes' }) %>
@@ -32,19 +35,5 @@
32
35
  </form>
33
36
  <% }) %>
34
37
  </div>
35
-
36
- <div>
37
- <div class="help">
38
- <div class="flex items-center gap-1 mb-2">
39
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
40
- <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" />
41
- </svg>
42
-
43
- <h3 class="heading-3">Contextual help</h3>
44
- </div>
45
-
46
- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Tempore nostrum fugit sint sunt distinctio ut cum, corrupti ad error, quo labore minima. Reprehenderit quasi maxime repudiandae voluptatum commodi saepe molestiae?</p>
47
- </div>
48
- </div>
49
38
  </div>
50
- </div>
39
+ </div>
@@ -0,0 +1,17 @@
1
+ <% form_for({ resource }, errors, (f) => { %>
2
+ <form action="<%= `/${_context.locale}/${_context.resourceConfig.articleType}_revisions/${resource.id}/general` %>" method="POST" class="form">
3
+ <%- f.field('resource.title', { required: true }) %>
4
+ <%- f.field('resource.slug', { label: "URL", required: true, hint: "Only lowercase letters, numbers and dash allowed. E.g: celebrate-friday-13" }) %>
5
+ <%- f.field('resource.publishAt', { required: true, type: 'datetime-local', label: 'Publish at (UTC)' }) %>
6
+ <%- f.field('resource.visibility', { as: 'select', required: true, options: visibilityOptions }) %>
7
+
8
+ <%- include('../../_shared/_credentials_input.ejs', { f, visibilityFieldId: "f_resource_visibility"}) %>
9
+
10
+ <div class="form-actions">
11
+ <div class="btn-toolbar">
12
+ <%- f.submit('Save changes', { class: 'btn-primary' }) %>
13
+ <a href="<%= `/${_context.locale}/${_context.resourceConfig.articleTypePlural}/${resource.originalId}` %>" class="btn-secondary">Back</a>
14
+ </div>
15
+ </div>
16
+ </form>
17
+ <% }) %>
@@ -1,43 +1,16 @@
1
1
  <div class="page-wrapper">
2
2
  <div class="page-title">
3
- <h1 class="heading-1">Edit revision / General</h1>
3
+ <h1 class="heading-1">
4
+ <span class="opacity-50">General / </span>
5
+ <%= resource.title %>
6
+ </h1>
4
7
  </div>
5
8
 
6
9
  <%- render_partial('../_nav.ejs', { resource, active: 'general' }) %>
7
10
 
8
11
  <div class="grid gap-4 md:grid-cols-3">
9
12
  <div>
10
- <% form_for({ resource }, errors, (f) => { %>
11
- <form action="<%= `/${_context.locale}/${_context.resourceConfig.articleType}_revisions/${resource.id}/general` %>" method="POST" class="form">
12
- <%- f.field('resource.title', { required: true }) %>
13
- <%- f.field('resource.slug', { label: "URL", required: true }) %>
14
- <%- f.field('resource.publishAt', { required: true, type: 'datetime-local', label: 'Publish at (UTC)' }) %>
15
- <%- f.field('resource.visibility', { as: 'select', required: true, options: visibilityOptions }) %>
16
-
17
- <%- include('../../_shared/_credentials_input.ejs', { f, visibilityFieldId: "f_resource_visibility"}) %>
18
-
19
- <div class="form-actions">
20
- <div class="btn-toolbar">
21
- <%- f.submit('Save changes', { class: 'btn-primary' }) %>
22
- <a href="<%= `/${_context.locale}/${_context.resourceConfig.articleTypePlural}/${resource.originalId}` %>" class="btn-secondary">Back</a>
23
- </div>
24
- </div>
25
- </form>
26
- <% }) %>
27
- </div>
28
-
29
- <div>
30
- <div class="help">
31
- <div class="flex items-center gap-1 mb-2">
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
- <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
- </svg>
35
-
36
- <h3 class="heading-3">Contextual help</h3>
37
- </div>
38
-
39
- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Tempore nostrum fugit sint sunt distinctio ut cum, corrupti ad error, quo labore minima. Reprehenderit quasi maxime repudiandae voluptatum commodi saepe molestiae?</p>
40
- </div>
13
+ <%- render_partial('_form.ejs') %>
41
14
  </div>
42
15
  </div>
43
- </div>
16
+ </div>
@@ -25,11 +25,13 @@
25
25
  <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" />
26
26
  </svg>
27
27
 
28
- <h3 class="heading-3">Contextual help</h3>
28
+ <h3 class="heading-3">How to lock a revision?</h3>
29
29
  </div>
30
30
 
31
- <p>Locking a revision will prevent further changes to this version of the article. This action cannot be undone. Please provide a reason for locking this revision.</p>
31
+ <div class="markdown">
32
+ <p>You can lock a revision to prevent publishing or deletion by anyone, including yourself. When locking, provide a clear, informative message explaining the reason. Remember that while this feature is designed to facilitate collaboration, any user can still unlock the revision.</p>
33
+ </div>
32
34
  </div>
33
35
  </div>
34
36
  </div>
35
- </div>
37
+ </div>
@@ -1,6 +1,9 @@
1
1
  <div class="page-wrapper">
2
2
  <div class="page-title">
3
- <h1 class="heading-1">Edit revision / Open graph & meta tags</h1>
3
+ <h1 class="heading-1">
4
+ <span class="opacity-50">OpenGraph & Meta tags / </span>
5
+ <%= resource.title %>
6
+ </h1>
4
7
  </div>
5
8
 
6
9
  <%- render_partial('../_nav.ejs', { resource, active: 'meta' }) %>
@@ -9,10 +12,10 @@
9
12
  <div>
10
13
  <% form_for({ resource }, errors, (f) => { %>
11
14
  <form action="<%= `/${_context.locale}/${_context.resourceConfig.articleType}_revisions/${resource.id}/meta` %>" method="POST" class="form">
12
- <%- f.field('resource.settings.meta.title', { required: true, label: "Meta title" }) %>
13
- <%- f.field('resource.settings.meta.description', { as: "textarea", required: true, label: "Meta description" }) %>
15
+ <%- f.field('resource.settings.meta.title', { required: true, label: "Meta title", hint: "Used for both meta and OpenGraph" }) %>
16
+ <%- f.field('resource.settings.meta.description', { as: "textarea", required: true, label: "Meta description", hint: "Used for both meta and OpenGraph" }) %>
14
17
 
15
- <raketa-image-picker name="resource[settings][meta][image]" value="<%= JSON.stringify(resource.settings?.meta?.image || {}) %>" label="Meta image"></raketa-image-picker>
18
+ <raketa-image-picker name="resource[settings][meta][image]" value="<%= JSON.stringify(resource.settings?.meta?.image || {}) %>" label="OpenGraph image"></raketa-image-picker>
16
19
 
17
20
  <div class="form-actions">
18
21
  <div class="btn-toolbar">
@@ -23,19 +26,5 @@
23
26
  </form>
24
27
  <% }) %>
25
28
  </div>
26
-
27
- <div>
28
- <div class="help">
29
- <div class="flex items-center gap-1 mb-2">
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
- <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
- </svg>
33
-
34
- <h3 class="heading-3">Contextual help</h3>
35
- </div>
36
-
37
- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Tempore nostrum fugit sint sunt distinctio ut cum, corrupti ad error, quo labore minima. Reprehenderit quasi maxime repudiandae voluptatum commodi saepe molestiae?</p>
38
- </div>
39
- </div>
40
29
  </div>
41
- </div>
30
+ </div>