@raketa-cloud/admin 0.0.90 → 0.0.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/handlers/article_revisions/PublishesHandler.js +2 -1
- package/src/handlers/event_revisions/PublishesHandler.js +2 -1
- package/src/handlers/page_revisions/PublishesHandler.js +2 -1
- package/src/tests/handlers/article_revisions/PublishesHandler.test/create.test.js +8 -0
- package/src/tests/handlers/article_revisions/PublishesHandler.test/create_form.test.js +1 -0
- package/src/tests/handlers/event_revisions/PublishesHandler.test/create.test.js +8 -0
- package/src/tests/handlers/event_revisions/PublishesHandler.test/create_form.test.js +1 -0
- package/src/tests/handlers/page_revisions/PublishesHandler.test/create.test.js +8 -0
- package/src/tests/handlers/page_revisions/PublishesHandler.test/create_form.test.js +1 -0
- package/src/views/article_revisions/publishes/_form.ejs +30 -3
- package/src/views/articles/_shared/_revision_toolbar.ejs +9 -9
- package/src/views/event_revisions/publishes/_form.ejs +37 -3
- package/src/views/events/_shared/_revision_toolbar.ejs +9 -9
- package/src/views/page_revisions/publishes/_form.ejs +36 -3
- package/src/views/pages/_shared/_revision_toolbar.ejs +9 -9
package/package.json
CHANGED
|
@@ -18,6 +18,7 @@ const create_form = async (ctx) => {
|
|
|
18
18
|
visibility: revision.visibility,
|
|
19
19
|
username: revision.settings?.credentials?.user,
|
|
20
20
|
password: revision.settings?.credentials?.password,
|
|
21
|
+
type: "now",
|
|
21
22
|
},
|
|
22
23
|
visibilityOptions: ctx.client.articles.visibilityOptions(),
|
|
23
24
|
errors: {},
|
|
@@ -49,7 +50,7 @@ function publishArticleParams(
|
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
async function publishRevision(ctx, revision, publishing) {
|
|
52
|
-
if (publishing.mergeAt) {
|
|
53
|
+
if (publishing.mergeAt && publishing.type === "later") {
|
|
53
54
|
return await ctx.client.articleRevisions.schedule(
|
|
54
55
|
revision.id,
|
|
55
56
|
ctx.locale,
|
|
@@ -15,6 +15,7 @@ const create_form = async (ctx) => {
|
|
|
15
15
|
visibility: revision.visibility,
|
|
16
16
|
username: revision.settings?.credentials?.user,
|
|
17
17
|
password: revision.settings?.credentials?.password,
|
|
18
|
+
type: "now",
|
|
18
19
|
},
|
|
19
20
|
visibilityOptions: ctx.client.events.visibilityOptions(),
|
|
20
21
|
errors: {},
|
|
@@ -46,7 +47,7 @@ function publishEventParams(
|
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
async function publishRevision(ctx, revision, publishing) {
|
|
49
|
-
if (publishing.mergeAt) {
|
|
50
|
+
if (publishing.mergeAt && publishing.type === "later") {
|
|
50
51
|
return await ctx.client.eventRevisions.schedule(
|
|
51
52
|
revision.id,
|
|
52
53
|
ctx.locale,
|
|
@@ -15,6 +15,7 @@ const create_form = async (ctx) => {
|
|
|
15
15
|
visibility: revision.visibility,
|
|
16
16
|
username: revision.settings?.credentials?.user,
|
|
17
17
|
password: revision.settings?.credentials?.password,
|
|
18
|
+
type: "now",
|
|
18
19
|
},
|
|
19
20
|
visibilityOptions: ctx.client.pages.visibilityOptions(),
|
|
20
21
|
errors: {},
|
|
@@ -46,7 +47,7 @@ function publishPageParams(
|
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
async function publishRevision(ctx, revision, publishing) {
|
|
49
|
-
if (publishing.mergeAt) {
|
|
50
|
+
if (publishing.mergeAt && publishing.type === "later") {
|
|
50
51
|
return await ctx.client.pageRevisions.schedule(
|
|
51
52
|
revision.id,
|
|
52
53
|
ctx.locale,
|
|
@@ -29,6 +29,7 @@ describe("Publish article revision", () => {
|
|
|
29
29
|
visibility: "protected",
|
|
30
30
|
username: "admin",
|
|
31
31
|
password: "admin123!@#",
|
|
32
|
+
type: "now",
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
const ctx = buildCtx(revision, {
|
|
@@ -86,6 +87,7 @@ describe("Publish article revision", () => {
|
|
|
86
87
|
title: "A new revision!",
|
|
87
88
|
description: "Nice!",
|
|
88
89
|
visibility: "public",
|
|
90
|
+
type: "now",
|
|
89
91
|
};
|
|
90
92
|
|
|
91
93
|
const ctx = buildCtx(revision, {
|
|
@@ -128,6 +130,7 @@ describe("Publish article revision", () => {
|
|
|
128
130
|
visibility: publishing.visibility,
|
|
129
131
|
username: publishing.username,
|
|
130
132
|
password: publishing.password,
|
|
133
|
+
type: publishing.type,
|
|
131
134
|
},
|
|
132
135
|
visibilityOptions: ctx.client.articles.visibilityOptions(),
|
|
133
136
|
errors: {
|
|
@@ -149,6 +152,7 @@ describe("Publish article revision", () => {
|
|
|
149
152
|
visibility: "protected",
|
|
150
153
|
username: "admin",
|
|
151
154
|
password: "admin123!@#",
|
|
155
|
+
type: "later",
|
|
152
156
|
};
|
|
153
157
|
|
|
154
158
|
const ctx = buildCtx(revision, {
|
|
@@ -204,6 +208,7 @@ describe("Publish article revision", () => {
|
|
|
204
208
|
title: "A new revision!",
|
|
205
209
|
description: "Nice!",
|
|
206
210
|
visibility: "public",
|
|
211
|
+
type: "later",
|
|
207
212
|
};
|
|
208
213
|
|
|
209
214
|
const ctx = buildCtx(revision, {
|
|
@@ -249,6 +254,7 @@ describe("Publish article revision", () => {
|
|
|
249
254
|
visibility: publishing.visibility,
|
|
250
255
|
username: publishing.username,
|
|
251
256
|
password: publishing.password,
|
|
257
|
+
type: publishing.type,
|
|
252
258
|
},
|
|
253
259
|
visibilityOptions: ctx.client.articles.visibilityOptions(),
|
|
254
260
|
articleErrors: {
|
|
@@ -267,6 +273,7 @@ describe("Publish article revision", () => {
|
|
|
267
273
|
title: "A new revision!",
|
|
268
274
|
description: "Nice!",
|
|
269
275
|
visibility: "public",
|
|
276
|
+
type: "later",
|
|
270
277
|
};
|
|
271
278
|
|
|
272
279
|
const ctx = buildCtx(revision, {
|
|
@@ -312,6 +319,7 @@ describe("Publish article revision", () => {
|
|
|
312
319
|
visibility: publishing.visibility,
|
|
313
320
|
username: publishing.username,
|
|
314
321
|
password: publishing.password,
|
|
322
|
+
type: publishing.type,
|
|
315
323
|
},
|
|
316
324
|
visibilityOptions: ctx.client.articles.visibilityOptions(),
|
|
317
325
|
errors: {
|
|
@@ -37,6 +37,7 @@ describe("Publish article revision", () => {
|
|
|
37
37
|
visibility: revision.visibility,
|
|
38
38
|
username: revision.settings?.credentials?.user,
|
|
39
39
|
password: revision.settings?.credentials?.password,
|
|
40
|
+
type: "now",
|
|
40
41
|
},
|
|
41
42
|
visibilityOptions: ctx.client.articles.visibilityOptions(),
|
|
42
43
|
errors: {},
|
|
@@ -29,6 +29,7 @@ describe("Publish event revision", () => {
|
|
|
29
29
|
visibility: "protected",
|
|
30
30
|
username: "admin",
|
|
31
31
|
password: "admin123!@#",
|
|
32
|
+
type: "now",
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
const ctx = buildCtx(revision, {
|
|
@@ -86,6 +87,7 @@ describe("Publish event revision", () => {
|
|
|
86
87
|
title: "A new revision!",
|
|
87
88
|
description: "Nice!",
|
|
88
89
|
visibility: "public",
|
|
90
|
+
type: "now",
|
|
89
91
|
};
|
|
90
92
|
|
|
91
93
|
const ctx = buildCtx(revision, {
|
|
@@ -128,6 +130,7 @@ describe("Publish event revision", () => {
|
|
|
128
130
|
visibility: publishing.visibility,
|
|
129
131
|
username: publishing.username,
|
|
130
132
|
password: publishing.password,
|
|
133
|
+
type: publishing.type,
|
|
131
134
|
},
|
|
132
135
|
visibilityOptions: ctx.client.events.visibilityOptions(),
|
|
133
136
|
errors: {
|
|
@@ -149,6 +152,7 @@ describe("Publish event revision", () => {
|
|
|
149
152
|
visibility: "protected",
|
|
150
153
|
username: "admin",
|
|
151
154
|
password: "admin123!@#",
|
|
155
|
+
type: "later",
|
|
152
156
|
};
|
|
153
157
|
|
|
154
158
|
const ctx = buildCtx(revision, {
|
|
@@ -204,6 +208,7 @@ describe("Publish event revision", () => {
|
|
|
204
208
|
title: "A new revision!",
|
|
205
209
|
description: "Nice!",
|
|
206
210
|
visibility: "public",
|
|
211
|
+
type: "later",
|
|
207
212
|
};
|
|
208
213
|
|
|
209
214
|
const ctx = buildCtx(revision, {
|
|
@@ -249,6 +254,7 @@ describe("Publish event revision", () => {
|
|
|
249
254
|
visibility: publishing.visibility,
|
|
250
255
|
username: publishing.username,
|
|
251
256
|
password: publishing.password,
|
|
257
|
+
type: publishing.type,
|
|
252
258
|
},
|
|
253
259
|
visibilityOptions: ctx.client.events.visibilityOptions(),
|
|
254
260
|
eventErrors: {
|
|
@@ -267,6 +273,7 @@ describe("Publish event revision", () => {
|
|
|
267
273
|
title: "A new revision!",
|
|
268
274
|
description: "Nice!",
|
|
269
275
|
visibility: "public",
|
|
276
|
+
type: "later",
|
|
270
277
|
};
|
|
271
278
|
|
|
272
279
|
const ctx = buildCtx(revision, {
|
|
@@ -312,6 +319,7 @@ describe("Publish event revision", () => {
|
|
|
312
319
|
visibility: publishing.visibility,
|
|
313
320
|
username: publishing.username,
|
|
314
321
|
password: publishing.password,
|
|
322
|
+
type: publishing.type,
|
|
315
323
|
},
|
|
316
324
|
visibilityOptions: ctx.client.events.visibilityOptions(),
|
|
317
325
|
errors: {
|
|
@@ -37,6 +37,7 @@ describe("Publish event revision", () => {
|
|
|
37
37
|
visibility: revision.visibility,
|
|
38
38
|
username: revision.settings?.credentials?.user,
|
|
39
39
|
password: revision.settings?.credentials?.password,
|
|
40
|
+
type: "now",
|
|
40
41
|
},
|
|
41
42
|
visibilityOptions: ctx.client.events.visibilityOptions(),
|
|
42
43
|
errors: {},
|
|
@@ -29,6 +29,7 @@ describe("Publish page revision", () => {
|
|
|
29
29
|
visibility: "protected",
|
|
30
30
|
username: "admin",
|
|
31
31
|
password: "admin123!@#",
|
|
32
|
+
type: "now",
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
const ctx = buildCtx(revision, {
|
|
@@ -86,6 +87,7 @@ describe("Publish page revision", () => {
|
|
|
86
87
|
title: "A new revision!",
|
|
87
88
|
description: "Nice!",
|
|
88
89
|
visibility: "public",
|
|
90
|
+
type: "now",
|
|
89
91
|
};
|
|
90
92
|
|
|
91
93
|
const ctx = buildCtx(revision, {
|
|
@@ -128,6 +130,7 @@ describe("Publish page revision", () => {
|
|
|
128
130
|
visibility: publishing.visibility,
|
|
129
131
|
username: publishing.username,
|
|
130
132
|
password: publishing.password,
|
|
133
|
+
type: publishing.type,
|
|
131
134
|
},
|
|
132
135
|
visibilityOptions: ctx.client.pages.visibilityOptions(),
|
|
133
136
|
errors: {
|
|
@@ -149,6 +152,7 @@ describe("Publish page revision", () => {
|
|
|
149
152
|
visibility: "protected",
|
|
150
153
|
username: "admin",
|
|
151
154
|
password: "admin123!@#",
|
|
155
|
+
type: "later",
|
|
152
156
|
};
|
|
153
157
|
|
|
154
158
|
const ctx = buildCtx(revision, {
|
|
@@ -204,6 +208,7 @@ describe("Publish page revision", () => {
|
|
|
204
208
|
title: "A new revision!",
|
|
205
209
|
description: "Nice!",
|
|
206
210
|
visibility: "public",
|
|
211
|
+
type: "later",
|
|
207
212
|
};
|
|
208
213
|
|
|
209
214
|
const ctx = buildCtx(revision, {
|
|
@@ -249,6 +254,7 @@ describe("Publish page revision", () => {
|
|
|
249
254
|
visibility: publishing.visibility,
|
|
250
255
|
username: publishing.username,
|
|
251
256
|
password: publishing.password,
|
|
257
|
+
type: publishing.type,
|
|
252
258
|
},
|
|
253
259
|
visibilityOptions: ctx.client.pages.visibilityOptions(),
|
|
254
260
|
pageErrors: {
|
|
@@ -267,6 +273,7 @@ describe("Publish page revision", () => {
|
|
|
267
273
|
title: "A new revision!",
|
|
268
274
|
description: "Nice!",
|
|
269
275
|
visibility: "public",
|
|
276
|
+
type: "later",
|
|
270
277
|
};
|
|
271
278
|
|
|
272
279
|
const ctx = buildCtx(revision, {
|
|
@@ -312,6 +319,7 @@ describe("Publish page revision", () => {
|
|
|
312
319
|
visibility: publishing.visibility,
|
|
313
320
|
username: publishing.username,
|
|
314
321
|
password: publishing.password,
|
|
322
|
+
type: publishing.type,
|
|
315
323
|
},
|
|
316
324
|
visibilityOptions: ctx.client.pages.visibilityOptions(),
|
|
317
325
|
errors: {
|
|
@@ -37,6 +37,7 @@ describe("Publish page revision", () => {
|
|
|
37
37
|
visibility: revision.visibility,
|
|
38
38
|
username: revision.settings?.credentials?.user,
|
|
39
39
|
password: revision.settings?.credentials?.password,
|
|
40
|
+
type: "now",
|
|
40
41
|
},
|
|
41
42
|
visibilityOptions: ctx.client.pages.visibilityOptions(),
|
|
42
43
|
errors: {},
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
<div class="mb-4 text-red-500">A page with this URL already exists</div>
|
|
5
5
|
<% } %>
|
|
6
6
|
|
|
7
|
-
<%- f.field('publishing.
|
|
8
|
-
<%- f.field('publishing.description', { as: "textarea", hint: "Provide optional details" }) %>
|
|
9
|
-
|
|
7
|
+
<%- f.field('publishing.type', { as: 'radio_group', options: [["now", "Publish now"], ["later", "Schedule for a date"]] }) %>
|
|
10
8
|
<%- f.field('publishing.mergeAt', { type: 'datetime-local', label: 'Publish revision at (UTC)' }) %>
|
|
11
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
12
|
<%- f.field('publishing.visibility', { as: 'select', required: true, options: visibilityOptions }) %>
|
|
13
13
|
<%- f.field('publishing.username', { required: true }) %>
|
|
14
14
|
<%- f.field('publishing.password', { required: true }) %>
|
|
@@ -23,6 +23,33 @@
|
|
|
23
23
|
</form>
|
|
24
24
|
<% }) %>
|
|
25
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
|
+
radioGroup.querySelectorAll('input[type="radio"]').forEach(input => {
|
|
34
|
+
if (input.checked) {
|
|
35
|
+
val = input.value
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
return val;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function handleTypeChange(value) {
|
|
42
|
+
const shouldShowMergeAt = value === "later"
|
|
43
|
+
if (shouldShowMergeAt) {
|
|
44
|
+
mergeAtEl.parentNode.classList.remove('hidden')
|
|
45
|
+
} else {
|
|
46
|
+
mergeAtEl.parentNode.classList.add('hidden')
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
typeEl.addEventListener("change", (e) => handleTypeChange(e.target.value))
|
|
50
|
+
handleTypeChange(radioGroupValue(typeEl))
|
|
51
|
+
</script>
|
|
52
|
+
|
|
26
53
|
<script>
|
|
27
54
|
const visibilityEl = document.getElementById("f_publishing_visibility");
|
|
28
55
|
const usernameEl = document.getElementById("f_publishing_username").parentElement;
|
|
@@ -6,6 +6,15 @@
|
|
|
6
6
|
Edit content
|
|
7
7
|
</a>
|
|
8
8
|
|
|
9
|
+
<a href="<%= `/${_context.locale}/${_context.resourceConfig.articleType}_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
|
+
|
|
9
18
|
<a href="<%= `/${_context.locale}/${_context.resourceConfig.articleType}_revisions/${revision.id}/publishes/new` %>" class="btn-text has-icon <%= revision.meta && revision.meta.locked ? 'cursor-not-allowed text-gray-400 pointer-events-none' : '' %>">
|
|
10
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">
|
|
11
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" />
|
|
@@ -22,15 +31,6 @@
|
|
|
22
31
|
</summary>
|
|
23
32
|
|
|
24
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">
|
|
25
|
-
<a href="<%= `/${_context.locale}/${_context.resourceConfig.articleType}_revisions/${revision.id}/general/edit` %>" class="btn-text has-icon <%= revision.meta && revision.meta.locked ? 'cursor-not-allowed text-gray-400 pointer-events-none' : '' %>">
|
|
26
|
-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
|
|
27
|
-
<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" />
|
|
28
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
|
|
29
|
-
</svg>
|
|
30
|
-
|
|
31
|
-
Edit settings
|
|
32
|
-
</a>
|
|
33
|
-
|
|
34
34
|
<a href="/remote/login?redirect_to=/<%= _context.locale %>/admin/<%= _context.resourceConfig.articleType %>-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
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="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" />
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
<div class="mb-4 text-red-500">A page with this URL already exists</div>
|
|
5
5
|
<% } %>
|
|
6
6
|
|
|
7
|
-
<%- f.field('publishing.
|
|
8
|
-
<%- f.field('publishing.description', { as: "textarea", hint: "Provide optional details" }) %>
|
|
9
|
-
|
|
7
|
+
<%- f.field('publishing.type', { as: 'radio_group', options: [["now", "Publish now"], ["later", "Schedule for a date"]] }) %>
|
|
10
8
|
<%- f.field('publishing.mergeAt', { type: 'datetime-local', label: 'Publish revision at (UTC)' }) %>
|
|
11
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
12
|
<%- f.field('publishing.visibility', { as: 'select', required: true, options: visibilityOptions }) %>
|
|
13
13
|
<%- f.field('publishing.username', { required: true }) %>
|
|
14
14
|
<%- f.field('publishing.password', { required: true }) %>
|
|
@@ -23,6 +23,40 @@
|
|
|
23
23
|
</form>
|
|
24
24
|
<% }) %>
|
|
25
25
|
|
|
26
|
+
|
|
27
|
+
<script>
|
|
28
|
+
// Takes care of the publishint time!
|
|
29
|
+
const typeEl = document.getElementById("f_publishing_type")
|
|
30
|
+
const mergeAtEl = document.getElementById("f_publishing_mergeAt")
|
|
31
|
+
|
|
32
|
+
function radioGroupValue(radioGroup) {
|
|
33
|
+
let val = "";
|
|
34
|
+
|
|
35
|
+
radioGroup.querySelectorAll('input[type="radio"]').forEach(input => {
|
|
36
|
+
|
|
37
|
+
if (input.checked) {
|
|
38
|
+
val = input.value
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
return val;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function handleTypeChange(value) {
|
|
47
|
+
const shouldShowMergeAt = value === "later"
|
|
48
|
+
|
|
49
|
+
if (shouldShowMergeAt) {
|
|
50
|
+
mergeAtEl.parentNode.classList.remove('hidden')
|
|
51
|
+
} else {
|
|
52
|
+
mergeAtEl.parentNode.classList.add('hidden')
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
typeEl.addEventListener("change", (e) => handleTypeChange(e.target.value))
|
|
57
|
+
handleTypeChange(radioGroupValue(typeEl))
|
|
58
|
+
</script>
|
|
59
|
+
|
|
26
60
|
<script>
|
|
27
61
|
const visibilityEl = document.getElementById("f_publishing_visibility");
|
|
28
62
|
const usernameEl = document.getElementById("f_publishing_username").parentElement;
|
|
@@ -6,6 +6,15 @@
|
|
|
6
6
|
Edit content
|
|
7
7
|
</a>
|
|
8
8
|
|
|
9
|
+
<a href="<%= `/${_context.locale}/${_context.resourceConfig.eventType}_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
|
+
|
|
9
18
|
<a href="<%= `/${_context.locale}/${_context.resourceConfig.eventType}_revisions/${revision.id}/publishes/new` %>" class="btn-text has-icon <%= revision.meta && revision.meta.locked ? 'cursor-not-allowed text-gray-400 pointer-events-none' : '' %>">
|
|
10
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">
|
|
11
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" />
|
|
@@ -22,15 +31,6 @@
|
|
|
22
31
|
</summary>
|
|
23
32
|
|
|
24
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">
|
|
25
|
-
<a href="<%= `/${_context.locale}/${_context.resourceConfig.eventType}_revisions/${revision.id}/general/edit` %>" class="btn-text has-icon <%= revision.meta && revision.meta.locked ? 'cursor-not-allowed text-gray-400 pointer-events-none' : '' %>">
|
|
26
|
-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
|
|
27
|
-
<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" />
|
|
28
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
|
|
29
|
-
</svg>
|
|
30
|
-
|
|
31
|
-
Edit settings
|
|
32
|
-
</a>
|
|
33
|
-
|
|
34
34
|
<a href="/remote/login?redirect_to=/<%= _context.locale %>/admin/<%= _context.resourceConfig.eventType %>-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
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="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" />
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
<div class="mb-4 text-red-500">A page with this URL already exists</div>
|
|
5
5
|
<% } %>
|
|
6
6
|
|
|
7
|
-
<%- f.field('publishing.
|
|
8
|
-
<%- f.field('publishing.description', { as: "textarea", hint: "Provide optional details" }) %>
|
|
9
|
-
|
|
7
|
+
<%- f.field('publishing.type', { as: 'radio_group', options: [["now", "Publish now"], ["later", "Schedule for a date"]] }) %>
|
|
10
8
|
<%- f.field('publishing.mergeAt', { type: 'datetime-local', label: 'Publish revision at (UTC)' }) %>
|
|
11
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
12
|
<%- f.field('publishing.visibility', { as: 'select', required: true, options: visibilityOptions }) %>
|
|
13
13
|
<%- f.field('publishing.username', { required: true }) %>
|
|
14
14
|
<%- f.field('publishing.password', { required: true }) %>
|
|
@@ -23,6 +23,39 @@
|
|
|
23
23
|
</form>
|
|
24
24
|
<% }) %>
|
|
25
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
|
+
|
|
26
59
|
<script>
|
|
27
60
|
const visibilityEl = document.getElementById("f_publishing_visibility");
|
|
28
61
|
const usernameEl = document.getElementById("f_publishing_username").parentElement;
|
|
@@ -6,6 +6,15 @@
|
|
|
6
6
|
Edit content
|
|
7
7
|
</a>
|
|
8
8
|
|
|
9
|
+
<a href="<%= `/${_context.locale}/${_context.resourceConfig.pageType}_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
|
+
|
|
9
18
|
<a href="<%= `/${_context.locale}/${_context.resourceConfig.pageType}_revisions/${revision.id}/publishes/new` %>" class="btn-text has-icon <%= revision.meta && revision.meta.locked ? 'cursor-not-allowed text-gray-400 pointer-events-none' : '' %>">
|
|
10
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">
|
|
11
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" />
|
|
@@ -22,15 +31,6 @@
|
|
|
22
31
|
</summary>
|
|
23
32
|
|
|
24
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">
|
|
25
|
-
<a href="<%= `/${_context.locale}/${_context.resourceConfig.pageType}_revisions/${revision.id}/general/edit` %>" class="btn-text has-icon <%= revision.meta && revision.meta.locked ? 'cursor-not-allowed text-gray-400 pointer-events-none' : '' %>">
|
|
26
|
-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
|
|
27
|
-
<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" />
|
|
28
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
|
|
29
|
-
</svg>
|
|
30
|
-
|
|
31
|
-
Edit settings
|
|
32
|
-
</a>
|
|
33
|
-
|
|
34
34
|
<a href="/remote/login?redirect_to=/<%= _context.locale %>/admin/<%= _context.resourceConfig.pageType %>-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
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="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" />
|