@raketa-cloud/admin 1.8.7 → 1.8.8

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 (120) hide show
  1. package/dist/application.css +0 -4
  2. package/package.json +1 -1
  3. package/src/HonoAdapter.js +9 -22
  4. package/src/index.js +0 -3
  5. package/src/routeCategoriesModule.js +1 -1
  6. package/src/routeCollection.js +15 -8
  7. package/src/routeNestedCollection.js +1 -1
  8. package/src/routeNestedMember.js +1 -1
  9. package/src/routeResource.js +19 -21
  10. package/src/routeStandard.js +6 -6
  11. package/src/tests/HonoAdapter.coverage.test.js +15 -25
  12. package/src/tests/routeCategoriesModule.test.js +2 -2
  13. package/src/tests/routeResource.test.js +12 -37
  14. package/src/tests/routeStandard.test.js +13 -13
  15. package/src/views/_shared/_date_fields_input.ejs +13 -0
  16. package/src/views/{page_revisions → resource_revisions}/general/_form.ejs +1 -0
  17. package/src/views/{pages → resources}/_form.ejs +1 -0
  18. package/src/views/{pages → resources}/history/index.ejs +1 -1
  19. package/src/views/{articles → resources}/index.ejs +6 -0
  20. package/src/views/{pages → resources}/show.ejs +7 -7
  21. package/src/views/{articles → resources}/translations/create_form.ejs +2 -2
  22. package/src/routeArticlesModule.js +0 -15
  23. package/src/routeEventsModule.js +0 -15
  24. package/src/routePagesModule.js +0 -15
  25. package/src/tests/routeArticlesModule.test.js +0 -43
  26. package/src/tests/routeEventsModule.test.js +0 -43
  27. package/src/tests/routePagesModule.test.js +0 -43
  28. package/src/views/article_revisions/_nav.ejs +0 -53
  29. package/src/views/article_revisions/general/_form.ejs +0 -18
  30. package/src/views/article_revisions/tags/edit_form.ejs +0 -16
  31. package/src/views/articles/_form.ejs +0 -45
  32. package/src/views/articles/_shared/history_table.ejs +0 -74
  33. package/src/views/articles/deletes/create_form.ejs +0 -68
  34. package/src/views/articles/history/index.ejs +0 -80
  35. package/src/views/articles/show.ejs +0 -222
  36. package/src/views/articles/urls/create_form.ejs +0 -36
  37. package/src/views/event_revisions/codes/_form.ejs +0 -14
  38. package/src/views/event_revisions/codes/edit_form.ejs +0 -16
  39. package/src/views/event_revisions/general/_form.ejs +0 -20
  40. package/src/views/event_revisions/general/edit_form.ejs +0 -16
  41. package/src/views/event_revisions/locks/_form.ejs +0 -11
  42. package/src/views/event_revisions/locks/create_form.ejs +0 -27
  43. package/src/views/event_revisions/meta/_form.ejs +0 -16
  44. package/src/views/event_revisions/meta/edit_form.ejs +0 -16
  45. package/src/views/event_revisions/publishes/_form.ejs +0 -77
  46. package/src/views/event_revisions/publishes/create_form.ejs +0 -9
  47. package/src/views/event_revisions/tags/_form.ejs +0 -13
  48. package/src/views/event_revisions/tags/edit_form.ejs +0 -16
  49. package/src/views/event_revisions/visuals/_form.ejs +0 -13
  50. package/src/views/event_revisions/visuals/edit_form.ejs +0 -16
  51. package/src/views/events/_form.ejs +0 -47
  52. package/src/views/events/_shared/_addons.ejs +0 -0
  53. package/src/views/events/_shared/_export_button.ejs +0 -9
  54. package/src/views/events/_shared/_history_toolbar.ejs +0 -24
  55. package/src/views/events/_shared/_revision_operator.ejs +0 -8
  56. package/src/views/events/_shared/_revision_toolbar.ejs +0 -68
  57. package/src/views/events/_shared/_title.ejs +0 -14
  58. package/src/views/events/_shared/_toolbar.ejs +0 -45
  59. package/src/views/events/_shared/history_table.ejs +0 -74
  60. package/src/views/events/create_form.ejs +0 -9
  61. package/src/views/events/deletes/create_form.ejs +0 -68
  62. package/src/views/events/history/index.ejs +0 -80
  63. package/src/views/events/index.ejs +0 -190
  64. package/src/views/events/show.ejs +0 -222
  65. package/src/views/events/translations/_translation_toolbar.ejs +0 -18
  66. package/src/views/events/translations/create_form.ejs +0 -75
  67. package/src/views/events/translations/index.ejs +0 -39
  68. package/src/views/events/urls/create_form.ejs +0 -36
  69. package/src/views/page_revisions/_nav.ejs +0 -53
  70. package/src/views/page_revisions/codes/_form.ejs +0 -14
  71. package/src/views/page_revisions/codes/edit_form.ejs +0 -16
  72. package/src/views/page_revisions/general/edit_form.ejs +0 -16
  73. package/src/views/page_revisions/locks/_form.ejs +0 -11
  74. package/src/views/page_revisions/locks/create_form.ejs +0 -27
  75. package/src/views/page_revisions/meta/_form.ejs +0 -16
  76. package/src/views/page_revisions/meta/edit_form.ejs +0 -16
  77. package/src/views/page_revisions/publishes/_form.ejs +0 -76
  78. package/src/views/page_revisions/publishes/create_form.ejs +0 -9
  79. package/src/views/page_revisions/tags/_form.ejs +0 -13
  80. package/src/views/page_revisions/visuals/_form.ejs +0 -13
  81. package/src/views/page_revisions/visuals/edit_form.ejs +0 -16
  82. package/src/views/pages/_shared/_addons.ejs +0 -0
  83. package/src/views/pages/_shared/_export_button.ejs +0 -9
  84. package/src/views/pages/_shared/_history_toolbar.ejs +0 -24
  85. package/src/views/pages/_shared/_revision_operator.ejs +0 -8
  86. package/src/views/pages/_shared/_revision_toolbar.ejs +0 -68
  87. package/src/views/pages/_shared/_title.ejs +0 -14
  88. package/src/views/pages/_shared/_toolbar.ejs +0 -45
  89. package/src/views/pages/create_form.ejs +0 -9
  90. package/src/views/pages/index.ejs +0 -185
  91. package/src/views/pages/translations/_translation_toolbar.ejs +0 -18
  92. package/src/views/pages/translations/create_form.ejs +0 -75
  93. package/src/views/pages/translations/index.ejs +0 -39
  94. /package/src/views/{event_revisions → resource_revisions}/_nav.ejs +0 -0
  95. /package/src/views/{article_revisions → resource_revisions}/codes/_form.ejs +0 -0
  96. /package/src/views/{article_revisions → resource_revisions}/codes/edit_form.ejs +0 -0
  97. /package/src/views/{article_revisions → resource_revisions}/general/edit_form.ejs +0 -0
  98. /package/src/views/{article_revisions → resource_revisions}/locks/_form.ejs +0 -0
  99. /package/src/views/{article_revisions → resource_revisions}/locks/create_form.ejs +0 -0
  100. /package/src/views/{article_revisions → resource_revisions}/meta/_form.ejs +0 -0
  101. /package/src/views/{article_revisions → resource_revisions}/meta/edit_form.ejs +0 -0
  102. /package/src/views/{article_revisions → resource_revisions}/publishes/_form.ejs +0 -0
  103. /package/src/views/{article_revisions → resource_revisions}/publishes/create_form.ejs +0 -0
  104. /package/src/views/{article_revisions → resource_revisions}/tags/_form.ejs +0 -0
  105. /package/src/views/{page_revisions → resource_revisions}/tags/edit_form.ejs +0 -0
  106. /package/src/views/{article_revisions → resource_revisions}/visuals/_form.ejs +0 -0
  107. /package/src/views/{article_revisions → resource_revisions}/visuals/edit_form.ejs +0 -0
  108. /package/src/views/{articles → resources}/_shared/_addons.ejs +0 -0
  109. /package/src/views/{articles → resources}/_shared/_export_button.ejs +0 -0
  110. /package/src/views/{articles → resources}/_shared/_history_toolbar.ejs +0 -0
  111. /package/src/views/{articles → resources}/_shared/_revision_operator.ejs +0 -0
  112. /package/src/views/{articles → resources}/_shared/_revision_toolbar.ejs +0 -0
  113. /package/src/views/{articles → resources}/_shared/_title.ejs +0 -0
  114. /package/src/views/{articles → resources}/_shared/_toolbar.ejs +0 -0
  115. /package/src/views/{pages → resources}/_shared/history_table.ejs +0 -0
  116. /package/src/views/{articles → resources}/create_form.ejs +0 -0
  117. /package/src/views/{pages → resources}/deletes/create_form.ejs +0 -0
  118. /package/src/views/{articles → resources}/translations/_translation_toolbar.ejs +0 -0
  119. /package/src/views/{articles → resources}/translations/index.ejs +0 -0
  120. /package/src/views/{pages → resources}/urls/create_form.ejs +0 -0
@@ -1,76 +0,0 @@
1
- <% form_for({ publishing }, errors, (f) => { %>
2
- <form action="<%= `/${_context.locale}/${_context.resourceConfig.resourceType}_revisions/${publishing.id}/publishes` %>" method="post" class="form">
3
- <% if (errors.slug) { %>
4
- <div class="mb-4 text-red-500">A page with this URL already exists</div>
5
- <% } %>
6
-
7
- <%- f.field('publishing.type', { as: 'radio_group', label: "", options: [["now", "Publish now"], ["later", "Schedule for a date"]] }) %>
8
- <%- f.field('publishing.mergeAt', { type: 'datetime-local', label: 'Publish revision at (UTC)' }) %>
9
-
10
- <%- f.field('publishing.title', { required: true, hint: "Appears in the history of changes" }) %>
11
- <%- f.field('publishing.description', { as: "textarea", hint: "Provide optional details" }) %>
12
- <%- f.field('publishing.visibility', { as: 'select', required: true, options: visibilityOptions }) %>
13
- <%- f.field('publishing.username', { required: true }) %>
14
- <%- f.field('publishing.password', { required: true }) %>
15
-
16
- <div class="form-actions">
17
- <div class="btn-toolbar">
18
- <%- f.submit('Save record', { class: 'btn-primary' }) %>
19
-
20
- <a href="<%= `/${_context.locale}/${_context.resourceConfig.resourceTypePlural}/${publishing.originalId}` %>" class="btn-secondary">Back</a>
21
- </div>
22
- </div>
23
- </form>
24
- <% }) %>
25
-
26
- <script>
27
- // Takes care of the publishint time!
28
- const typeEl = document.getElementById("f_publishing_type")
29
- const mergeAtEl = document.getElementById("f_publishing_mergeAt")
30
-
31
- function radioGroupValue(radioGroup) {
32
- let val = "";
33
-
34
- radioGroup.querySelectorAll('input[type="radio"]').forEach(input => {
35
-
36
- if (input.checked) {
37
- val = input.value
38
- }
39
-
40
- })
41
-
42
- return val;
43
- }
44
-
45
- function handleTypeChange(value) {
46
- const shouldShowMergeAt = value === "later"
47
-
48
- if (shouldShowMergeAt) {
49
- mergeAtEl.parentNode.classList.remove('hidden')
50
- } else {
51
- mergeAtEl.parentNode.classList.add('hidden')
52
- }
53
- }
54
-
55
- typeEl.addEventListener("change", (e) => handleTypeChange(e.target.value))
56
- handleTypeChange(radioGroupValue(typeEl))
57
- </script>
58
-
59
- <script>
60
- const visibilityEl = document.getElementById("f_publishing_visibility");
61
- const usernameEl = document.getElementById("f_publishing_username").parentElement;
62
- const passwordEl = document.getElementById("f_publishing_password").parentElement;
63
-
64
- function handleVisibilityChange(value) {
65
- const isHidden = value !== "protected";
66
-
67
- usernameEl.classList.toggle('hidden', isHidden);
68
- passwordEl.classList.toggle('hidden', isHidden);
69
-
70
- usernameEl.querySelector('input').toggleAttribute('required', !isHidden);
71
- passwordEl.querySelector('input').toggleAttribute('required', !isHidden);
72
- }
73
-
74
- visibilityEl.addEventListener("change", (e) => handleVisibilityChange(e.target.value));
75
- handleVisibilityChange(visibilityEl.value);
76
- </script>
@@ -1,9 +0,0 @@
1
- <div class="page-wrapper">
2
- <div class="page-title">
3
- <h1 class="heading-1">Publish revision</h1>
4
- </div>
5
-
6
- <div class="grid gap-4 md:grid-cols-3">
7
- <%- render_partial('_form.ejs') %>
8
- </div>
9
- </div>
@@ -1,13 +0,0 @@
1
- <% form_for({ resource }, errors, (f) => { %>
2
- <form action="<%= `/${_context.locale}/${_context.resourceConfig.resourceType}_revisions/${resource.id}/tags` %>" method="POST" class="form">
3
- <%- f.field('resource.tags', { as: 'checkbox_group', options: tags.map(tag => [tag.id, tag.name]) }) %>
4
-
5
- <div class="form-actions">
6
- <div class="btn-toolbar">
7
- <%- f.submit('Save', { class: 'btn-primary' }) %>
8
- <%- f.submit('Save and publish', { class: 'btn-secondary', name: '_next', value: 'publish' }) %>
9
- <a href="<%= `/${_context.locale}/${_context.resourceConfig.resourceTypePlural}/${resource.originalId}` %>" class="btn-text">Back</a>
10
- </div>
11
- </div>
12
- </form>
13
- <% }) %>
@@ -1,13 +0,0 @@
1
- <% form_for({ resource }, errors, (f) => { %>
2
- <form action="<%= `/${_context.locale}/${_context.resourceConfig.resourceType}_revisions/${resource.id}/visuals` %>" method="POST" class="form">
3
- <%- include('../../_shared/_layout_input.ejs', { f }) %>
4
-
5
- <div class="form-actions">
6
- <div class="btn-toolbar">
7
- <%- f.submit('Save', { class: 'btn-primary' }) %>
8
- <%- f.submit('Save and publish', { class: 'btn-secondary', name: '_next', value: 'publish' }) %>
9
- <a href="<%= `/${_context.locale}/${_context.resourceConfig.resourceTypePlural}/${resource.originalId}` %>" class="btn-text">Back</a>
10
- </div>
11
- </div>
12
- </form>
13
- <% }) %>
@@ -1,16 +0,0 @@
1
- <div class="page-wrapper">
2
- <div class="page-title">
3
- <h1 class="heading-1">
4
- <span class="opacity-50">Visuals / </span>
5
- <%= resource.title %>
6
- </h1>
7
- </div>
8
-
9
- <%- render_partial('../_nav.ejs', { resource, active: 'visuals' }) %>
10
-
11
- <div class="grid gap-4 md:grid-cols-3">
12
- <div>
13
- <%- render_partial('_form.ejs') %>
14
- </div>
15
- </div>
16
- </div>
File without changes
@@ -1,9 +0,0 @@
1
- <% if (Object.keys(_context.query).some(k => k.startsWith('f:')) && items.list.length > 0) { %>
2
- <%
3
- const queryString = Object.entries(_context.query)
4
- .filter(([key, value]) => value !== undefined && value !== null && value !== '')
5
- .map(([key, value]) => Array.isArray(value) ? value.map(v => `${key}=${encodeURIComponent(v)}`).join('&') : `${key}=${encodeURIComponent(value)}`)
6
- .join('&');
7
- %>
8
- <a href="<%= `/${_context.locale}/${_context.resourceConfig.resourceTypePlural}/exports${queryString ? '?' + queryString : ''}` %>" class="btn-secondary">Export</a>
9
- <% } %>
@@ -1,24 +0,0 @@
1
- <div class="actions-toolbar justify-end">
2
- <form method="POST" action="<%= `/${_context.locale}/${_context.resourceConfig.resourceTypePlural}/${resource.id}/${_context.resourceConfig.resourceType}_changes/reverts` %>" class="inline-block">
3
- <input type="hidden" name="version" value="<%= change.version %>">
4
-
5
- <% if (history.isChangeRevertable(change, maxVersion) && !(resource.revisionsCount >= _context.maxOpenRevisions)) { %>
6
- <button type="submit" class="btn-text">
7
- Revert
8
- </button>
9
- <% } else { %>
10
- <button type="submit" disabled class="btn-text opacity-50 cursor-not-allowed">
11
- Revert
12
- </button>
13
- <% } %>
14
- </form>
15
-
16
- <a href="/remote/login?redirect_to=/<%= _context.locale %>/admin/<%= _context.resourceConfig.resourceTypePlural %>/<%= resource.id %>/changes/<%= change.version %>" class="btn-text has-icon">
17
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
18
- <path stroke-linecap="round" stroke-linejoin="round" d="M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z" />
19
- <path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
20
- </svg>
21
-
22
- Preview
23
- </a>
24
- </div>
@@ -1,8 +0,0 @@
1
- <div class="body-3 text-raketa-foreground/50">
2
- <div class="flex items-center gap-1" title="<%= revision.meta.operatorMeta.name %>">
3
- <% if (revision.meta.operatorMeta.avatar) { %>
4
- <img src="<%= revision.meta.operatorMeta.avatar %>" class="rounded-full size-4">
5
- <% } %>
6
- <%= revision.meta.operatorMeta.name %>
7
- </div>
8
- </div>
@@ -1,68 +0,0 @@
1
- <div class="actions-toolbar justify-end">
2
- <a href="/remote/login?redirect_to=/<%= _context.locale %>/admin/<%= _context.resourceConfig.resourceType %>-revisions/<%= revision.id %>/builder" class="btn-text has-icon <%= revision.meta && revision.meta.locked ? 'cursor-not-allowed text-gray-400 pointer-events-none' : '' %>">
3
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
4
- <path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125" />
5
- </svg>
6
- Edit content
7
- </a>
8
-
9
- <a href="<%= `/${_context.locale}/${_context.resourceConfig.resourceType}_revisions/${revision.id}/general/edit` %>" class="btn-text has-icon <%= revision.meta && revision.meta.locked ? 'cursor-not-allowed text-gray-400 pointer-events-none' : '' %>">
10
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
11
- <path stroke-linecap="round" stroke-linejoin="round" d="M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 0 1 1.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.559.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.894.149c-.424.07-.764.383-.929.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 0 1-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.398.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 0 1-.12-1.45l.527-.737c.25-.35.272-.806.108-1.204-.165-.397-.506-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.108-1.204l-.526-.738a1.125 1.125 0 0 1 .12-1.45l.773-.773a1.125 1.125 0 0 1 1.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894Z" />
12
- <path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
13
- </svg>
14
-
15
- Edit settings
16
- </a>
17
-
18
- <a href="<%= `/${_context.locale}/${_context.resourceConfig.resourceType}_revisions/${revision.id}/publishes/new` %>" class="btn-text has-icon <%= revision.meta && revision.meta.locked ? 'cursor-not-allowed text-gray-400 pointer-events-none' : '' %>">
19
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
20
- <path stroke-linecap="round" stroke-linejoin="round" d="M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z" />
21
- </svg>
22
-
23
- Publish
24
- </a>
25
-
26
- <details class="unstyled-details">
27
- <summary class="cursor-pointer">
28
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
29
- <path stroke-linecap="round" stroke-linejoin="round" d="M12 6.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 12.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 18.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5Z" />
30
- </svg>
31
- </summary>
32
-
33
- <div class="absolute border bg-raketa-background p-4 right-4 z-20 mt-2 flex flex-col gap-4 shadow-md rounded dark:border-neutral-500">
34
- <a href="/remote/login?redirect_to=/<%= _context.locale %>/admin/<%= _context.resourceConfig.resourceType %>-revisions/<%= revision.id %>/preview" target="_blank" class="btn-text has-icon <%= revision.meta && revision.meta.locked ? 'cursor-not-allowed text-gray-400 pointer-events-none' : '' %>">
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
- <path stroke-linecap="round" stroke-linejoin="round" d="M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z" />
37
- <path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
38
- </svg>
39
-
40
- Preview
41
- </a>
42
-
43
- <% if (revision.meta && revision.meta.locked) { %>
44
- <form action="<%= `/${_context.locale}/${_context.resourceConfig.resourceType}_revisions/${revision.id}/unlocks` %>" method="post" class="inline-flex gap-2 items-center">
45
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
46
- <path stroke-linecap="round" stroke-linejoin="round" d="M13.5 10.5V6.75a4.5 4.5 0 1 1 9 0v3.75M3.75 21.75h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H3.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z" />
47
- </svg>
48
- <%- f.submit('Unlock', { class: 'btn-text' }) %>
49
- </form>
50
- <% } else { %>
51
- <a href="<%= `/${_context.locale}/${_context.resourceConfig.resourceType}_revisions/${revision.id}/locks/new` %>" class="btn-text has-icon">
52
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
53
- <path stroke-linecap="round" stroke-linejoin="round" d="M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z" />
54
- </svg>
55
- Lock
56
- </a>
57
- <% } %>
58
-
59
- <button hx-delete="<%= `/${_context.locale}/${_context.resourceConfig.resourceType}_revisions/${revision.id}` %>" hx-confirm="Are you sure?" type="button" class="btn-danger has-icon <%= revision.meta && revision.meta.locked ? 'cursor-not-allowed text-gray-400 pointer-events-none' : '' %>">
60
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
61
- <path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0" />
62
- </svg>
63
-
64
- Delete
65
- </button>
66
- </div>
67
- </details>
68
- </div>
@@ -1,14 +0,0 @@
1
- <div class="flex flex-col pb-4">
2
- <h1 class="heading-1 flex items-center gap-2">
3
- <%= resource.title %>
4
-
5
- <% if (resource.visibility !== "private") { %>
6
- <a href="<%= _context.remoteConfig.resourceUrl(resource, _context.resourceConfig.resourceType, _context.locale) %>" target="_blank">
7
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6 text-raketa-primary">
8
- <path stroke-linecap="round" stroke-linejoin="round" d="M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25" />
9
- </svg>
10
- </a>
11
- <% } %>
12
- </h1>
13
- <a href="<%= _context.remoteConfig.resourceUrl(resource, _context.resourceConfig.resourceType, _context.locale) %>" target="_blank" class="btn-text"><%= _context.remoteConfig.resourceUrl(resource, _context.resourceConfig.resourceType, _context.locale) %></a>
14
- </div>
@@ -1,45 +0,0 @@
1
- <div>
2
- <div class="actions-toolbar">
3
- <form method="POST" action="<%= `/${_context.locale}/${_context.resourceConfig.resourceTypePlural}/${resource.id}/${_context.resourceConfig.resourceType}_revisions` %>" class="inline-block">
4
- <% if (resource.revisionsCount >= _context?.maxOpenRevisions) { %>
5
- <button type="submit" class="btn-primary" disabled style="opacity: 50%;">
6
- Start revision
7
- </button>
8
- <% } else {%>
9
- <button type="submit" class="btn-primary">
10
- Start revision
11
- </button>
12
- <% } %>
13
- </form>
14
-
15
- <a href="<%= `/${_context.locale}/${_context.resourceConfig.resourceTypePlural}/${resource.id}/urls/new` %>" class="btn-text has-icon">
16
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
17
- <path stroke-linecap="round" stroke-linejoin="round" d="M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244" />
18
- </svg>
19
-
20
- Change URL
21
- </a>
22
-
23
- <form action="<%= `/${_context.locale}/${_context.resourceConfig.resourceTypePlural}/${resource.id}/clones` %>" method="post" class="inline-block">
24
- <button type="submit" class="btn-text has-icon">
25
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
26
- <path stroke-linecap="round" stroke-linejoin="round" d="M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75" />
27
- </svg>
28
-
29
- Clone <%= Inflector.humanize(Inflector.downcase(_context.resourceConfig.resourceType)) %>
30
- </button>
31
- </form>
32
-
33
- <a href="<%= `/${_context.locale}/${_context.resourceConfig.resourceTypePlural}/${resource.id}/deletes/new` %>" class="btn-danger has-icon">
34
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
35
- <path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0" />
36
- </svg>
37
-
38
- Delete <%= Inflector.humanize(Inflector.downcase(_context.resourceConfig.resourceType)) %>
39
- </a>
40
- </div>
41
-
42
- <% if (_context.query?.revisions_count_error) { %>
43
- <div class="text-red-600">Cannot open a new revision. Current limit is <%= _context.maxOpenRevisions %>. </div>
44
- <% } %>
45
- </div>
@@ -1,9 +0,0 @@
1
- <div class="page-wrapper">
2
- <div class="page-title">
3
- <h1 class="heading-1">Create <%= Inflector.humanize(Inflector.downcase(_context.resourceConfig.resourceType)) %></h1>
4
- </div>
5
-
6
- <div class="grid gap-4 md:grid-cols-3">
7
- <%- render_partial('_form.ejs') %>
8
- </div>
9
- </div>
@@ -1,185 +0,0 @@
1
- <div class="page-wrapper">
2
- <div class="page-title">
3
- <h1 class="heading-1"><%= Inflector.humanize(Inflector.capitalize(_context.resourceConfig.resourceTypePlural)) %></h1>
4
-
5
- <div class="actions-toolbar">
6
- <a href="<%= `/${_context.locale}/${_context.resourceConfig.resourceTypePlural}/new` %>" class="btn-primary">
7
- Create new
8
- </a>
9
-
10
- <button type="button" data-toggle-sidebar="1" class="p-2.5 rounded hover:bg-neutral-200 transition-all duration-300 ease-in-out dark:hover:bg-neutral-700">
11
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
12
- <path stroke-linecap="round" stroke-linejoin="round" d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z" />
13
- </svg>
14
- </button>
15
- </div>
16
- </div>
17
-
18
- <table class="data-grid">
19
- <thead>
20
- <tr>
21
- <th><%- sort_button("Title", "title", _context) %></th>
22
- <th>Visibility</th>
23
- <th><%- sort_button("Last change", "updated_at", _context) %></th>
24
- <th>Translations</th>
25
- </tr>
26
- </thead>
27
-
28
- <tbody>
29
- <% items.list.forEach((item, idx)=> { %>
30
- <tr>
31
- <td class="w-1/2">
32
- <a href="<%= `/${_context.locale}/${_context.resourceConfig.resourceTypePlural}/${item.id}` %>" class="btn-text mr-1">
33
- <%= item.title %>
34
- </a>
35
- <% if (item.revisionsCount > 0) { %>
36
- <span class="bg-orange-100 chip text-orange-700 dark:bg-orange-900/50 dark:text-orange-300"><%= item.revisionsCount !== 1 ? `${item.revisionsCount} open revisions` : 'Open revision' %></span>
37
- <% } %>
38
-
39
- <% if (item.visibility !== "private") { %>
40
- <div class="mt-1">
41
- <a href="<%= _context.remoteConfig.resourceUrl(item, _context.resourceConfig.resourceType, _context.locale) %>" class="body-3 text-raketa-foreground/50" target="_blank">
42
- <%= _context.remoteConfig.resourcePath(item, _context.resourceConfig.resourceType, _context.locale) %>
43
- </a>
44
- </div>
45
- <% } %>
46
- </td>
47
-
48
- <td>
49
- <div class="flex items-center gap-1 whitespace-nowrap">
50
- <span class="text-raketa-foreground/30" title="<%= visibilityOptions.find(opt => opt[0] === item.visibility)[1] %>">
51
- <% if (item.visibility === 'public') { %>
52
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
53
- <path stroke-linecap="round" stroke-linejoin="round" d="M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418" />
54
- </svg>
55
-
56
- <% } %>
57
- <% if (item.visibility === 'private') { %>
58
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="size-4">
59
- <path d="M8.5 4.5a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0ZM10.9 12.006c.11.542-.348.994-.9.994H2c-.553 0-1.01-.452-.902-.994a5.002 5.002 0 0 1 9.803 0ZM14.002 12h-1.59a2.556 2.556 0 0 0-.04-.29 6.476 6.476 0 0 0-1.167-2.603 3.002 3.002 0 0 1 3.633 1.911c.18.522-.283.982-.836.982ZM12 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" />
60
- </svg>
61
- <% } %>
62
- <% if (item.visibility === 'unlisted') { %>
63
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="size-4">
64
- <path fill-rule="evenodd" d="M3.28 2.22a.75.75 0 0 0-1.06 1.06l10.5 10.5a.75.75 0 1 0 1.06-1.06l-1.322-1.323a7.012 7.012 0 0 0 2.16-3.11.87.87 0 0 0 0-.567A7.003 7.003 0 0 0 4.82 3.76l-1.54-1.54Zm3.196 3.195 1.135 1.136A1.502 1.502 0 0 1 9.45 8.389l1.136 1.135a3 3 0 0 0-4.109-4.109Z" clip-rule="evenodd" />
65
- <path d="m7.812 10.994 1.816 1.816A7.003 7.003 0 0 1 1.38 8.28a.87.87 0 0 1 0-.566 6.985 6.985 0 0 1 1.113-2.039l2.513 2.513a3 3 0 0 0 2.806 2.806Z" />
66
- </svg>
67
- <% } %>
68
- <% if (item.visibility === 'protected') { %>
69
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="size-4">
70
- <path fill-rule="evenodd" d="M8 1a3.5 3.5 0 0 0-3.5 3.5V7A1.5 1.5 0 0 0 3 8.5v5A1.5 1.5 0 0 0 4.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 11.5 7V4.5A3.5 3.5 0 0 0 8 1Zm2 6V4.5a2 2 0 1 0-4 0V7h4Z" clip-rule="evenodd" />
71
- </svg>
72
- <% } %>
73
- </span>
74
-
75
- <%= visibilityOptions.find(opt => opt[0] === item.visibility)[1] %>
76
- </div>
77
- </td>
78
-
79
- <td>
80
- <div class="body-3 text-raketa-foreground/50">
81
- <div class="flex items-center gap-1 mb-0.5">
82
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4 text-raketa-foreground">
83
- <path stroke-linecap="round" stroke-linejoin="round" d="M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
84
- </svg>
85
- <time data-pretty-datetime datetime="<%= item.updatedAt %>"><%= utils.formattedDateTime(item.updatedAt) %></time>
86
- </div>
87
-
88
- <div class="flex items-center gap-1" title="<%= item.changes[0]?.operatorMeta?.name %>">
89
- <% if (item.changes[0]?.operatorMeta?.avatar) { %>
90
- <img src="<%= item.changes[0]?.operatorMeta?.avatar %>" class="size-4 rounded-full" alt="<%= item.changes[0]?.operatorMeta?.name %>">
91
- <% } else { %>
92
- <div class="size-4 rounded-full"></div>
93
- <% } %>
94
- <%= item.changes[0]?.operatorMeta?.name %>
95
- </div>
96
- </div>
97
- </td>
98
-
99
- <td>
100
- <div class="flex flex-wrap items-center gap-1">
101
- <% Object.keys(_context.locales).forEach(key => { %>
102
- <% const { name, _code, flag} = _context.locales[key] %>
103
- <% if (key === _context.locale) { %>
104
- <img title="<%= name %>" src="<%= flag %>" alt="<%= name %>" class="size-6 rounded-full border dark:border-neutral-700" />
105
- <% } else if (item.translations[key]) { %>
106
- <a href="<%= `/${key}/${_context.resourceConfig.resourceTypePlural}/${item.translations[key].id}` %>">
107
- <img title="<%= name %>" src="<%= flag %>" alt="<%= name %>" class="size-6 rounded-full border dark:border-neutral-700" />
108
- </a>
109
- <% } else { %>
110
- <a href="<%= `/${_context.locale}/${_context.resourceConfig.resourceTypePlural}/${item.id}/translations/new?target_locale=${key}` %>">
111
- <img title="<%= name %>" src="<%= flag %>" alt="<%= name %>" class="<%= [" transition-all ease-in-out duration-300 size-6 rounded-full border hover:opacity-100 dark:border-neutral-700", key === _context.locale ? "opacity-100" : "opacity-10"].join(" ") %>" />
112
- </a>
113
- <% } %>
114
- <% }); %>
115
- </div>
116
- </td>
117
- </tr>
118
- <% }); %>
119
- </tbody>
120
- </table>
121
-
122
- <%- pagination(items.pagination, _context) %>
123
- </div>
124
-
125
- <div data-sidebar="1" class="search-sidebar <%= Object.keys(_context.query).some(k => k.startsWith('f:')) ? '' : 'hidden' %>">
126
- <span class="heading-2">Search by</span>
127
-
128
- <form action="<%= `/${_context.locale}/${_context.resourceConfig.resourceTypePlural}` %>" method="GET" class="form mt-4">
129
- <input type="hidden" name="order_direction" value="<%= _context.query.order_direction %>" />
130
- <input type="hidden" name="order_by" value="<%= _context.query.order_by %>" />
131
-
132
- <div class="mb-4">
133
- <label for="keyword" class="font-semibold hover:cursor-pointer body-3">Keyword</label>
134
- <input type="text" name="f:keyword" value="<%= _context.query["f:keyword"] %>" />
135
- </div>
136
-
137
- <%- include('./../_shared/_visibility_search_input.ejs') %>
138
-
139
- <div class="mb-4">
140
- <label for="widget" class="font-semibold hover:cursor-pointer body-3">Widget</label>
141
- <select name="f:widget" data-widget-filter data-current-value="<%= _context.query['f:widget'] || '' %>">
142
- <option value="">All widgets</option>
143
- </select>
144
- </div>
145
-
146
- <div class="mb-4">
147
- <label for="widget_keyword" class="font-semibold hover:cursor-pointer body-3">Widget text keyword</label>
148
- <input type="text" name="f:widget_keyword" value="<%= _context.query["f:widget_keyword"] %>" />
149
- </div>
150
-
151
- <div class="mb-4">
152
- <label for="last_updated_from" class="font-semibold hover:cursor-pointer body-3">Last Updated from</label>
153
- <input type="datetime-local" name="f:last_updated_from" value="<%= _context.query["f:last_updated_from"] %>" />
154
- </div>
155
-
156
- <div class="mb-4">
157
- <label for="last_updated_to" class="font-semibold hover:cursor-pointer body-3">Last Updated to</label>
158
- <input type="datetime-local" name="f:last_updated_to" value="<%= _context.query["f:last_updated_to"] %>" />
159
- </div>
160
-
161
- <%- include('./../_shared/_translations_search_input.ejs') %>
162
-
163
- <div class="mb-4">
164
- <label for="" class="font-semibold hover:cursor-pointer body-3">Tags</label>
165
- <div class="checkbox-group mb-4">
166
- <% tags.forEach((item,idx)=> { %>
167
- <div class="flex items-center gap-1">
168
- <% if (utils.includedInCollection(item.id, _context.query["f:tags"])) { %>
169
- <input type="checkbox" name="f:tags" id='tag-<%= item.id %>' checked value="<%= item.id %>" class="hover:cursor-pointer">
170
- <% } else { %>
171
- <input type="checkbox" name="f:tags" id='tag-<%= item.id %>' value="<%= item.id %>" class="hover:cursor-pointer">
172
- <% } %>
173
- <label for='tag-<%= item.id %>' class="body-2 hover:cursor-pointer"><%= item.name %></label>
174
- </div>
175
- <% }); %>
176
- </div>
177
- </div>
178
-
179
- <div class="btn-toolbar">
180
- <button type="submit" class="btn-primary">Search</button>
181
- <%- include('./_shared/_export_button.ejs') %>
182
- <a href="<%= `/${_context.locale}/${_context.resourceConfig.resourceTypePlural}` %>" class="btn-text">Clear search</a>
183
- </div>
184
- </form>
185
- </div>
@@ -1,18 +0,0 @@
1
- <div class="actions-toolbar justify-end">
2
- <a href="/remote/login?redirect_to=/<%= translation.translationLocale %>/admin/<%= _context.resourceConfig.resourceType %>-revisions/<%= translation.revisionId %>/builder" class="btn-text has-icon">
3
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
4
- <path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125" />
5
- </svg>
6
-
7
- Update Content
8
- </a>
9
-
10
- <a href="<%= `/${translation.translationLocale}/${_context.resourceConfig.resourceType}_revisions/${translation.revisionId}/general/edit` %>" class="btn-text has-icon">
11
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
12
- <path stroke-linecap="round" stroke-linejoin="round" d="M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 0 1 1.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.559.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.894.149c-.424.07-.764.383-.929.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 0 1-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.398.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 0 1-.12-1.45l.527-.737c.25-.35.272-.806.108-1.204-.165-.397-.506-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.108-1.204l-.526-.738a1.125 1.125 0 0 1 .12-1.45l.773-.773a1.125 1.125 0 0 1 1.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894Z" />
13
- <path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
14
- </svg>
15
-
16
- Update Settings
17
- </a>
18
- </div>
@@ -1,75 +0,0 @@
1
- <div class="page-wrapper">
2
- <div class="page-title flex flex-col items-start">
3
- <h1 class="heading-1">
4
- <span class="opacity-50">Translate from <%= _context.locales[_context.locale].name %> / </span>
5
- <%= blueprint.title %>
6
- </h1>
7
- </div>
8
-
9
- <div class="grid gap-4 md:grid-cols-3">
10
- <% form_for({ resource }, errors, (f) => { %>
11
- <form action="<%= `/${_context.locale}/${_context.resourceConfig.resourceTypePlural}/${blueprint.id}/translations` %>" method="post" class="form">
12
- <h6>Available languages:</h6>
13
- <% if (targetLocale) { %>
14
- <input type="hidden" name="resource[languages][]" value="<%= targetLocale %>">
15
- <% } %>
16
- <div class="checkbox-group !max-h-fit mb-3">
17
- <% Object.entries(_context.locales).forEach(([key, locale]) => {
18
- const isExistingTranslation = resource.translations[key];
19
- const isCurrentLocale = key === _context.locale;
20
- const wasSelected = Array.isArray(resource.languages) && resource.languages.includes(key);
21
- const isChecked = isExistingTranslation || isCurrentLocale || key === targetLocale || wasSelected;
22
- const isDisabled = isExistingTranslation || isCurrentLocale || key === targetLocale;
23
- %>
24
- <% if(!isCurrentLocale) { %>
25
- <label class="<%= isDisabled && key !== targetLocale ? 'opacity-50' : '' %>">
26
- <input type="<%= isCurrentLocale ? 'hidden' : 'checkbox' %>" name="resource[languages][]" value="<%= key %>" <%= isChecked ? 'checked' : '' %> <%= isDisabled ? 'disabled' : '' %>>
27
- <%= locale.name %>
28
- </label>
29
- <% } %>
30
- <% }) %>
31
- </div>
32
-
33
- <% if (errors?.resource && targetLocale) { %>
34
- <div>
35
- <% if (targetLocale !== _context.locale) { %>
36
- <p class="text-sm text-red-600 font-medium mb-1">
37
- Failed to create <%= _context.locales[targetLocale].name %> translation.
38
- </p>
39
- <% } %>
40
- <% Object.entries(errors.resource).forEach(([errorKey, error]) => { %>
41
- <p class="text-sm text-red-600 font-medium mb-3"> Reason is <%= errorKey %>: <%= error %></p>
42
- <% }) %>
43
- </div>
44
- <% } %>
45
-
46
- <div class="form-actions">
47
- <div class="btn-toolbar">
48
- <%- f.submit('Initiate translations', { class: 'btn-primary' }) %>
49
- <a href="<%= `/${_context.locale}/${_context.resourceConfig.resourceTypePlural}/${blueprint.id}` %>" class="btn-secondary">Cancel</a>
50
- </div>
51
- </div>
52
- </form>
53
- <% }) %>
54
-
55
- <div>
56
- <div class="help">
57
- <div class="flex items-center gap-1 mb-2">
58
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
59
- <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" />
60
- </svg>
61
-
62
- <h3 class="heading-3">Translating pages</h3>
63
- </div>
64
-
65
- <div class="markdown">
66
- <ol>
67
- <li>Select multiple locales to initiate bulk translations.</li>
68
- <li>A private copy of the page will be automatically created for each selected language, with a new revision opened to facilitate the translation process.</li>
69
- <li>On the next screen you'll see a list with quick links to transalte settings and widgets</li>
70
- </ol>
71
- </div>
72
- </div>
73
- </div>
74
- </div>
75
- </div>