@raketa-cloud/admin 1.0.0 → 1.0.2
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/cloud/ArticleRevisions.js +2 -2
- package/src/cloud/Articles.js +3 -3
- package/src/cloud/EventRevisions.js +2 -2
- package/src/cloud/Events.js +8 -3
- package/src/handlers/article_revisions/CodeHandler.js +3 -3
- package/src/handlers/article_revisions/GeneralHandler.js +3 -3
- package/src/handlers/article_revisions/MetaHandler.js +3 -3
- package/src/handlers/article_revisions/TagHandler.js +3 -3
- package/src/handlers/article_revisions/VisualHandler.js +3 -3
- package/src/handlers/articles/ArticlesHandler.js +2 -2
- package/src/handlers/event_revisions/CodeHandler.js +3 -3
- package/src/handlers/event_revisions/GeneralHandler.js +3 -3
- package/src/handlers/event_revisions/MetaHandler.js +3 -3
- package/src/handlers/event_revisions/TagHandler.js +3 -3
- package/src/handlers/event_revisions/VisualHandler.js +3 -3
- package/src/handlers/events/EventsHandler.js +2 -2
- package/src/helpers/utils.js +19 -0
- package/src/tests/handlers/article_revisions/CodesHandler.test/edit_form.test.js +1 -1
- package/src/tests/handlers/article_revisions/CodesHandler.test/update.test.js +1 -1
- package/src/tests/handlers/article_revisions/GeneralHandler.test/edit_form.test.js +1 -1
- package/src/tests/handlers/article_revisions/GeneralHandler.test/update.test.js +5 -5
- package/src/tests/handlers/article_revisions/MetaHandler.test/edit_form.test.js +1 -1
- package/src/tests/handlers/article_revisions/MetaHandler.test/update.test.js +1 -1
- package/src/tests/handlers/article_revisions/TagHandler.test/edit_form.test.js +1 -1
- package/src/tests/handlers/article_revisions/TagHandler.test/update.test.js +1 -1
- package/src/tests/handlers/article_revisions/VisualHandler.test.test/edit_form.test.js +1 -1
- package/src/tests/handlers/article_revisions/VisualHandler.test.test/update.test.js +1 -1
- package/src/tests/handlers/articles/ArticlesHandler.test/create.test.js +5 -5
- package/src/tests/handlers/event_revisions/CodesHandler.test/edit_form.test.js +1 -1
- package/src/tests/handlers/event_revisions/CodesHandler.test/update.test.js +1 -1
- package/src/tests/handlers/event_revisions/GeneralHandler.test/edit_form.test.js +1 -1
- package/src/tests/handlers/event_revisions/GeneralHandler.test/update.test.js +5 -5
- package/src/tests/handlers/event_revisions/MetaHandler.test/edit_form.test.js +1 -1
- package/src/tests/handlers/event_revisions/MetaHandler.test/update.test.js +1 -1
- package/src/tests/handlers/event_revisions/TagHandler.test/edit_form.test.js +1 -1
- package/src/tests/handlers/event_revisions/TagHandler.test/update.test.js +1 -1
- package/src/tests/handlers/event_revisions/VisualHandler.test.test/edit_form.test.js +1 -1
- package/src/tests/handlers/event_revisions/VisualHandler.test.test/update.test.js +1 -1
- package/src/tests/handlers/events/EventsHandler.test/create.test.js +5 -5
- package/src/utils.js +29 -2
- package/src/views/article_revisions/general/_form.ejs +2 -2
- package/src/views/articles/_form.ejs +2 -2
- package/src/views/articles/_shared/history_table.ejs +2 -2
- package/src/views/articles/index.ejs +4 -4
- package/src/views/articles/show.ejs +2 -2
- package/src/views/event_revisions/general/_form.ejs +2 -2
- package/src/views/events/_form.ejs +2 -2
- package/src/views/events/_shared/history_table.ejs +2 -2
- package/src/views/events/index.ejs +4 -4
- package/src/views/events/show.ejs +2 -2
- package/src/views/layouts/application.ejs +12 -0
- package/src/views/pages/_shared/history_table.ejs +2 -2
- package/src/views/pages/index.ejs +2 -2
- package/src/views/pages/show.ejs +2 -2
- package/src/views/redirects/index.ejs +1 -1
- package/src/views/redirects/show.ejs +2 -2
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { dateToUTCISO8601String } from "../utils";
|
|
2
2
|
import RaketaClient from "./RaketaClient";
|
|
3
3
|
import {
|
|
4
4
|
ArticleRevisionDocument,
|
|
@@ -34,7 +34,7 @@ export default class ArticleRevisions extends RaketaClient {
|
|
|
34
34
|
|
|
35
35
|
formatDates(params) {
|
|
36
36
|
if (params.publishAt) {
|
|
37
|
-
params.publishAt =
|
|
37
|
+
params.publishAt = dateToUTCISO8601String(params.publishAt);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
return { ...params };
|
package/src/cloud/Articles.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDateInput, dateToUTCISO8601String } from "../utils";
|
|
2
2
|
import RaketaClient from "./RaketaClient";
|
|
3
3
|
import {
|
|
4
4
|
ArticleByIdDocument,
|
|
@@ -16,7 +16,7 @@ export default class Articles extends RaketaClient {
|
|
|
16
16
|
defaults() {
|
|
17
17
|
return {
|
|
18
18
|
visibility: "private",
|
|
19
|
-
publishAt:
|
|
19
|
+
publishAt: toDateInput(new Date()),
|
|
20
20
|
settings: {
|
|
21
21
|
layout: "default",
|
|
22
22
|
},
|
|
@@ -28,7 +28,7 @@ export default class Articles extends RaketaClient {
|
|
|
28
28
|
|
|
29
29
|
formatDates(params) {
|
|
30
30
|
if (params.publishAt) {
|
|
31
|
-
params.publishAt =
|
|
31
|
+
params.publishAt = dateToUTCISO8601String(params.publishAt);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
return { ...params };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toUTCISO8601String } from "../utils";
|
|
1
|
+
import { toUTCISO8601String, dateToUTCISO8601String } from "../utils";
|
|
2
2
|
import RaketaClient from "./RaketaClient";
|
|
3
3
|
import {
|
|
4
4
|
CancelEventRevisionScheduleDocument,
|
|
@@ -36,7 +36,7 @@ export default class EventRevisions extends RaketaClient {
|
|
|
36
36
|
|
|
37
37
|
formatDates(params) {
|
|
38
38
|
if (params.publishAt) {
|
|
39
|
-
params.publishAt =
|
|
39
|
+
params.publishAt = dateToUTCISO8601String(params.publishAt);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
if (params.startsAt) {
|
package/src/cloud/Events.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
toDateTimeInput,
|
|
3
|
+
toUTCISO8601String,
|
|
4
|
+
toDateInput,
|
|
5
|
+
dateToUTCISO8601String,
|
|
6
|
+
} from "../utils";
|
|
2
7
|
import RaketaClient from "./RaketaClient";
|
|
3
8
|
import {
|
|
4
9
|
ChangeEventSlugDocument,
|
|
@@ -16,7 +21,7 @@ export default class Events extends RaketaClient {
|
|
|
16
21
|
defaults() {
|
|
17
22
|
return {
|
|
18
23
|
visibility: "private",
|
|
19
|
-
publishAt:
|
|
24
|
+
publishAt: toDateInput(new Date()),
|
|
20
25
|
startsAt: toDateTimeInput(),
|
|
21
26
|
endsAt: toDateTimeInput(),
|
|
22
27
|
settings: {
|
|
@@ -30,7 +35,7 @@ export default class Events extends RaketaClient {
|
|
|
30
35
|
|
|
31
36
|
formatDates(params) {
|
|
32
37
|
if (params.publishAt) {
|
|
33
|
-
params.publishAt =
|
|
38
|
+
params.publishAt = dateToUTCISO8601String(params.publishAt);
|
|
34
39
|
}
|
|
35
40
|
|
|
36
41
|
if (params.startsAt) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDateInput } from "../../utils";
|
|
2
2
|
|
|
3
3
|
const edit_form = async (ctx) => {
|
|
4
4
|
const { parent_id } = ctx.params;
|
|
@@ -16,7 +16,7 @@ const edit_form = async (ctx) => {
|
|
|
16
16
|
assigns: {
|
|
17
17
|
resource: {
|
|
18
18
|
...resource,
|
|
19
|
-
publishAt:
|
|
19
|
+
publishAt: toDateInput(resource.publishAt),
|
|
20
20
|
},
|
|
21
21
|
errors: {},
|
|
22
22
|
_translations: [],
|
|
@@ -53,7 +53,7 @@ const update = async (ctx) => {
|
|
|
53
53
|
assigns: {
|
|
54
54
|
resource: {
|
|
55
55
|
...resource,
|
|
56
|
-
publishAt:
|
|
56
|
+
publishAt: toDateInput(resource.publishAt),
|
|
57
57
|
},
|
|
58
58
|
errors: {
|
|
59
59
|
resource: ctx.client.articleRevisions.formatErrors(errors),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDateInput } from "../../utils";
|
|
2
2
|
|
|
3
3
|
const edit_form = async (ctx) => {
|
|
4
4
|
const { parent_id } = ctx.params;
|
|
@@ -16,7 +16,7 @@ const edit_form = async (ctx) => {
|
|
|
16
16
|
assigns: {
|
|
17
17
|
resource: {
|
|
18
18
|
...resource,
|
|
19
|
-
publishAt:
|
|
19
|
+
publishAt: toDateInput(resource.publishAt),
|
|
20
20
|
},
|
|
21
21
|
visibilityOptions: ctx.client.articles.visibilityOptions(),
|
|
22
22
|
errors: {},
|
|
@@ -54,7 +54,7 @@ const update = async (ctx) => {
|
|
|
54
54
|
assigns: {
|
|
55
55
|
resource: {
|
|
56
56
|
...resource,
|
|
57
|
-
publishAt:
|
|
57
|
+
publishAt: toDateInput(resource.publishAt),
|
|
58
58
|
},
|
|
59
59
|
errors: {
|
|
60
60
|
resource: ctx.client.articleRevisions.formatErrors(errors),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDateInput } from "../../utils";
|
|
2
2
|
|
|
3
3
|
const edit_form = async (ctx) => {
|
|
4
4
|
const { parent_id } = ctx.params;
|
|
@@ -16,7 +16,7 @@ const edit_form = async (ctx) => {
|
|
|
16
16
|
assigns: {
|
|
17
17
|
resource: {
|
|
18
18
|
...resource,
|
|
19
|
-
publishAt:
|
|
19
|
+
publishAt: toDateInput(resource.publishAt),
|
|
20
20
|
},
|
|
21
21
|
errors: {},
|
|
22
22
|
_translations: [],
|
|
@@ -53,7 +53,7 @@ const update = async (ctx) => {
|
|
|
53
53
|
assigns: {
|
|
54
54
|
resource: {
|
|
55
55
|
...resource,
|
|
56
|
-
publishAt:
|
|
56
|
+
publishAt: toDateInput(resource.publishAt),
|
|
57
57
|
},
|
|
58
58
|
errors: {
|
|
59
59
|
resource: ctx.client.articleRevisions.formatErrors(errors),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDateInput } from "../../utils";
|
|
2
2
|
|
|
3
3
|
const edit_form = async (ctx) => {
|
|
4
4
|
const { parent_id } = ctx.params;
|
|
@@ -18,7 +18,7 @@ const edit_form = async (ctx) => {
|
|
|
18
18
|
assigns: {
|
|
19
19
|
resource: {
|
|
20
20
|
...resource,
|
|
21
|
-
publishAt:
|
|
21
|
+
publishAt: toDateInput(resource.publishAt),
|
|
22
22
|
tags: resource.tags.map((t) => t.id),
|
|
23
23
|
},
|
|
24
24
|
tags: tags.list,
|
|
@@ -60,7 +60,7 @@ const update = async (ctx) => {
|
|
|
60
60
|
assigns: {
|
|
61
61
|
resource: {
|
|
62
62
|
...resource,
|
|
63
|
-
publishAt:
|
|
63
|
+
publishAt: toDateInput(resource.publishAt),
|
|
64
64
|
},
|
|
65
65
|
tags: tags.list,
|
|
66
66
|
errors: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDateInput } from "../../utils";
|
|
2
2
|
|
|
3
3
|
const edit_form = async (ctx) => {
|
|
4
4
|
const { parent_id } = ctx.params;
|
|
@@ -16,7 +16,7 @@ const edit_form = async (ctx) => {
|
|
|
16
16
|
assigns: {
|
|
17
17
|
resource: {
|
|
18
18
|
...resource,
|
|
19
|
-
publishAt:
|
|
19
|
+
publishAt: toDateInput(resource.publishAt),
|
|
20
20
|
},
|
|
21
21
|
errors: {},
|
|
22
22
|
_translations: [],
|
|
@@ -53,7 +53,7 @@ const update = async (ctx) => {
|
|
|
53
53
|
assigns: {
|
|
54
54
|
resource: {
|
|
55
55
|
...resource,
|
|
56
|
-
publishAt:
|
|
56
|
+
publishAt: toDateInput(resource.publishAt),
|
|
57
57
|
},
|
|
58
58
|
errors: {
|
|
59
59
|
resource: ctx.client.articleRevisions.formatErrors(errors),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDateInput } from "../../utils";
|
|
2
2
|
|
|
3
3
|
const index = async (ctx) => {
|
|
4
4
|
const items = await ctx.client.articles.list(
|
|
@@ -86,7 +86,7 @@ const create = async (ctx) => {
|
|
|
86
86
|
assigns: {
|
|
87
87
|
resource: {
|
|
88
88
|
...resource,
|
|
89
|
-
publishAt:
|
|
89
|
+
publishAt: toDateInput(resource.publishAt),
|
|
90
90
|
},
|
|
91
91
|
tags: tags.list,
|
|
92
92
|
errors: { resource: ctx.client.articles.formatErrors(errors) },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toDateTimeInput } from "../../utils";
|
|
1
|
+
import { toDateTimeInput, toDateInput } from "../../utils";
|
|
2
2
|
|
|
3
3
|
const edit_form = async (ctx) => {
|
|
4
4
|
const { parent_id } = ctx.params;
|
|
@@ -13,7 +13,7 @@ const edit_form = async (ctx) => {
|
|
|
13
13
|
assigns: {
|
|
14
14
|
resource: {
|
|
15
15
|
...resource,
|
|
16
|
-
publishAt:
|
|
16
|
+
publishAt: toDateInput(resource.publishAt),
|
|
17
17
|
startsAt: toDateTimeInput(resource.startsAt),
|
|
18
18
|
endsAt: toDateTimeInput(resource.endsAt),
|
|
19
19
|
},
|
|
@@ -49,7 +49,7 @@ const update = async (ctx) => {
|
|
|
49
49
|
assigns: {
|
|
50
50
|
resource: {
|
|
51
51
|
...resource,
|
|
52
|
-
publishAt:
|
|
52
|
+
publishAt: toDateInput(resource.publishAt),
|
|
53
53
|
startsAt: toDateTimeInput(resource.startsAt),
|
|
54
54
|
endsAt: toDateTimeInput(resource.endsAt),
|
|
55
55
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toDateTimeInput } from "../../utils";
|
|
1
|
+
import { toDateTimeInput, toDateInput } from "../../utils";
|
|
2
2
|
|
|
3
3
|
const edit_form = async (ctx) => {
|
|
4
4
|
const { parent_id } = ctx.params;
|
|
@@ -13,7 +13,7 @@ const edit_form = async (ctx) => {
|
|
|
13
13
|
assigns: {
|
|
14
14
|
resource: {
|
|
15
15
|
...resource,
|
|
16
|
-
publishAt:
|
|
16
|
+
publishAt: toDateInput(resource.publishAt),
|
|
17
17
|
startsAt: toDateTimeInput(resource.startsAt),
|
|
18
18
|
endsAt: toDateTimeInput(resource.endsAt),
|
|
19
19
|
},
|
|
@@ -50,7 +50,7 @@ const update = async (ctx) => {
|
|
|
50
50
|
assigns: {
|
|
51
51
|
resource: {
|
|
52
52
|
...resource,
|
|
53
|
-
publishAt:
|
|
53
|
+
publishAt: toDateInput(resource.publishAt),
|
|
54
54
|
startsAt: toDateTimeInput(resource.startsAt),
|
|
55
55
|
endsAt: toDateTimeInput(resource.endsAt),
|
|
56
56
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toDateTimeInput } from "../../utils";
|
|
1
|
+
import { toDateTimeInput, toDateInput } from "../../utils";
|
|
2
2
|
|
|
3
3
|
const edit_form = async (ctx) => {
|
|
4
4
|
const { parent_id } = ctx.params;
|
|
@@ -13,7 +13,7 @@ const edit_form = async (ctx) => {
|
|
|
13
13
|
assigns: {
|
|
14
14
|
resource: {
|
|
15
15
|
...resource,
|
|
16
|
-
publishAt:
|
|
16
|
+
publishAt: toDateInput(resource.publishAt),
|
|
17
17
|
startsAt: toDateTimeInput(resource.startsAt),
|
|
18
18
|
endsAt: toDateTimeInput(resource.endsAt),
|
|
19
19
|
},
|
|
@@ -49,7 +49,7 @@ const update = async (ctx) => {
|
|
|
49
49
|
assigns: {
|
|
50
50
|
resource: {
|
|
51
51
|
...resource,
|
|
52
|
-
publishAt:
|
|
52
|
+
publishAt: toDateInput(resource.publishAt),
|
|
53
53
|
startsAt: toDateTimeInput(resource.startsAt),
|
|
54
54
|
endsAt: toDateTimeInput(resource.endsAt),
|
|
55
55
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toDateTimeInput } from "../../utils";
|
|
1
|
+
import { toDateTimeInput, toDateInput } from "../../utils";
|
|
2
2
|
|
|
3
3
|
const edit_form = async (ctx) => {
|
|
4
4
|
const { parent_id } = ctx.params;
|
|
@@ -15,7 +15,7 @@ const edit_form = async (ctx) => {
|
|
|
15
15
|
assigns: {
|
|
16
16
|
resource: {
|
|
17
17
|
...resource,
|
|
18
|
-
publishAt:
|
|
18
|
+
publishAt: toDateInput(resource.publishAt),
|
|
19
19
|
startsAt: toDateTimeInput(resource.startsAt),
|
|
20
20
|
endsAt: toDateTimeInput(resource.endsAt),
|
|
21
21
|
tags: resource.tags.map((t) => t.id),
|
|
@@ -55,7 +55,7 @@ const update = async (ctx) => {
|
|
|
55
55
|
assigns: {
|
|
56
56
|
resource: {
|
|
57
57
|
...resource,
|
|
58
|
-
publishAt:
|
|
58
|
+
publishAt: toDateInput(resource.publishAt),
|
|
59
59
|
startsAt: toDateTimeInput(resource.startsAt),
|
|
60
60
|
endsAt: toDateTimeInput(resource.endsAt),
|
|
61
61
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toDateTimeInput } from "../../utils";
|
|
1
|
+
import { toDateTimeInput, toDateInput } from "../../utils";
|
|
2
2
|
|
|
3
3
|
const edit_form = async (ctx) => {
|
|
4
4
|
const { parent_id } = ctx.params;
|
|
@@ -13,7 +13,7 @@ const edit_form = async (ctx) => {
|
|
|
13
13
|
assigns: {
|
|
14
14
|
resource: {
|
|
15
15
|
...resource,
|
|
16
|
-
publishAt:
|
|
16
|
+
publishAt: toDateInput(resource.publishAt),
|
|
17
17
|
startsAt: toDateTimeInput(resource.startsAt),
|
|
18
18
|
endsAt: toDateTimeInput(resource.endsAt),
|
|
19
19
|
},
|
|
@@ -49,7 +49,7 @@ const update = async (ctx) => {
|
|
|
49
49
|
assigns: {
|
|
50
50
|
resource: {
|
|
51
51
|
...resource,
|
|
52
|
-
publishAt:
|
|
52
|
+
publishAt: toDateInput(resource.publishAt),
|
|
53
53
|
startsAt: toDateTimeInput(resource.startsAt),
|
|
54
54
|
endsAt: toDateTimeInput(resource.endsAt),
|
|
55
55
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toDateTimeInput } from "../../utils";
|
|
1
|
+
import { toDateTimeInput, toDateInput } from "../../utils";
|
|
2
2
|
|
|
3
3
|
const index = async (ctx) => {
|
|
4
4
|
const items = await ctx.client.events.list(
|
|
@@ -86,7 +86,7 @@ const create = async (ctx) => {
|
|
|
86
86
|
assigns: {
|
|
87
87
|
resource: {
|
|
88
88
|
...resource,
|
|
89
|
-
publishAt:
|
|
89
|
+
publishAt: toDateInput(resource.publishAt),
|
|
90
90
|
startsAt: toDateTimeInput(resource.startsAt),
|
|
91
91
|
endsAt: toDateTimeInput(resource.endsAt),
|
|
92
92
|
},
|
package/src/helpers/utils.js
CHANGED
|
@@ -16,6 +16,25 @@ function includedInCollection(value, collection) {
|
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
function formattedDateTime(dateTimeString) {
|
|
20
|
+
return new Date(dateTimeString).toLocaleString("en-GB", {
|
|
21
|
+
dateStyle: "short",
|
|
22
|
+
timeStyle: "short",
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function formattedDate(dateTimeString) {
|
|
27
|
+
if (!dateTimeString) {
|
|
28
|
+
return "";
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return new Date(dateTimeString).toLocaleString("en-GB", {
|
|
32
|
+
dateStyle: "short",
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
19
36
|
export default {
|
|
20
37
|
includedInCollection,
|
|
38
|
+
formattedDate,
|
|
39
|
+
formattedDateTime,
|
|
21
40
|
};
|
|
@@ -30,7 +30,7 @@ describe("Article revision general settings", () => {
|
|
|
30
30
|
title: "Updated title",
|
|
31
31
|
slug: "/updated-url",
|
|
32
32
|
visibility: "protected",
|
|
33
|
-
publishAt: "2024-08-
|
|
33
|
+
publishAt: "2024-08-30",
|
|
34
34
|
settings: {
|
|
35
35
|
credentials: {
|
|
36
36
|
user: "user",
|
|
@@ -59,7 +59,7 @@ describe("Article revision general settings", () => {
|
|
|
59
59
|
slug: updateSettings.slug,
|
|
60
60
|
title: updateSettings.title,
|
|
61
61
|
visibility: updateSettings.visibility,
|
|
62
|
-
publishAt: "2024-08-
|
|
62
|
+
publishAt: "2024-08-30T00:00:00Z",
|
|
63
63
|
widgets: revision.widgets,
|
|
64
64
|
tags: revision.tags.map((t) => t.id),
|
|
65
65
|
categories: revision.categories.map((c) => c.id),
|
|
@@ -81,7 +81,7 @@ describe("Article revision general settings", () => {
|
|
|
81
81
|
title: "Updated title",
|
|
82
82
|
slug: "/updated-url",
|
|
83
83
|
visibility: "protected",
|
|
84
|
-
publishAt: "2024-08-
|
|
84
|
+
publishAt: "2024-08-30",
|
|
85
85
|
settings: {
|
|
86
86
|
credentials: {
|
|
87
87
|
user: "user",
|
|
@@ -110,7 +110,7 @@ describe("Article revision general settings", () => {
|
|
|
110
110
|
slug: updateSettings.slug,
|
|
111
111
|
title: updateSettings.title,
|
|
112
112
|
visibility: updateSettings.visibility,
|
|
113
|
-
publishAt: "2024-08-
|
|
113
|
+
publishAt: "2024-08-30T00:00:00Z",
|
|
114
114
|
widgets: revision.widgets,
|
|
115
115
|
tags: revision.tags.map((t) => t.id),
|
|
116
116
|
categories: revision.categories.map((c) => c.id),
|
|
@@ -127,7 +127,7 @@ describe("Article revision general settings", () => {
|
|
|
127
127
|
slug: updateSettings.slug,
|
|
128
128
|
title: updateSettings.title,
|
|
129
129
|
visibility: updateSettings.visibility,
|
|
130
|
-
publishAt: "2024-08-
|
|
130
|
+
publishAt: "2024-08-30",
|
|
131
131
|
settings: {
|
|
132
132
|
...revision.settings,
|
|
133
133
|
...updateSettings.settings,
|
|
@@ -28,7 +28,7 @@ describe("Articles Handler", () => {
|
|
|
28
28
|
title: "Article title",
|
|
29
29
|
slug: "url",
|
|
30
30
|
visibility: "public",
|
|
31
|
-
publishAt: "2024-10-
|
|
31
|
+
publishAt: "2024-10-10",
|
|
32
32
|
settings: {
|
|
33
33
|
layout: "default",
|
|
34
34
|
meta: {
|
|
@@ -57,7 +57,7 @@ describe("Articles Handler", () => {
|
|
|
57
57
|
title: params.title,
|
|
58
58
|
slug: params.slug,
|
|
59
59
|
visibility: params.visibility,
|
|
60
|
-
publishAt: "2024-10-
|
|
60
|
+
publishAt: "2024-10-10T00:00:00Z",
|
|
61
61
|
settings: {
|
|
62
62
|
layout: params.settings.layout,
|
|
63
63
|
meta: {
|
|
@@ -88,7 +88,7 @@ describe("Articles Handler", () => {
|
|
|
88
88
|
const params = {
|
|
89
89
|
title: "Article title",
|
|
90
90
|
slug: "",
|
|
91
|
-
publishAt: "2024-10-
|
|
91
|
+
publishAt: "2024-10-10",
|
|
92
92
|
visibility: "public",
|
|
93
93
|
settings: {
|
|
94
94
|
layout: "default",
|
|
@@ -126,7 +126,7 @@ describe("Articles Handler", () => {
|
|
|
126
126
|
title: params.title,
|
|
127
127
|
slug: "",
|
|
128
128
|
visibility: params.visibility,
|
|
129
|
-
publishAt: "2024-10-
|
|
129
|
+
publishAt: "2024-10-10T00:00:00Z",
|
|
130
130
|
settings: {
|
|
131
131
|
layout: params.settings.layout,
|
|
132
132
|
meta: {
|
|
@@ -151,7 +151,7 @@ describe("Articles Handler", () => {
|
|
|
151
151
|
assigns: {
|
|
152
152
|
resource: {
|
|
153
153
|
...params,
|
|
154
|
-
publishAt: "2024-10-
|
|
154
|
+
publishAt: "2024-10-10",
|
|
155
155
|
settings: {
|
|
156
156
|
...params.settings,
|
|
157
157
|
meta: {
|
|
@@ -30,7 +30,7 @@ describe("Event revision general settings", () => {
|
|
|
30
30
|
title: "Updated title",
|
|
31
31
|
slug: "/updated-url",
|
|
32
32
|
visibility: "protected",
|
|
33
|
-
publishAt: "2024-08-
|
|
33
|
+
publishAt: "2024-08-30",
|
|
34
34
|
startsAt: "2024-08-30T19:10",
|
|
35
35
|
endsAt: "2024-08-30T19:15",
|
|
36
36
|
settings: {
|
|
@@ -61,7 +61,7 @@ describe("Event revision general settings", () => {
|
|
|
61
61
|
slug: updateSettings.slug,
|
|
62
62
|
title: updateSettings.title,
|
|
63
63
|
visibility: updateSettings.visibility,
|
|
64
|
-
publishAt: "2024-08-
|
|
64
|
+
publishAt: "2024-08-30T00:00:00Z",
|
|
65
65
|
startsAt: "2024-08-30T19:10:00Z",
|
|
66
66
|
endsAt: "2024-08-30T19:15:00Z",
|
|
67
67
|
widgets: revision.widgets,
|
|
@@ -85,7 +85,7 @@ describe("Event revision general settings", () => {
|
|
|
85
85
|
title: "Updated title",
|
|
86
86
|
slug: "/updated-url",
|
|
87
87
|
visibility: "protected",
|
|
88
|
-
publishAt: "2024-08-
|
|
88
|
+
publishAt: "2024-08-30",
|
|
89
89
|
startsAt: "2024-08-30T19:10",
|
|
90
90
|
endsAt: "2024-08-30T19:15",
|
|
91
91
|
settings: {
|
|
@@ -116,7 +116,7 @@ describe("Event revision general settings", () => {
|
|
|
116
116
|
slug: updateSettings.slug,
|
|
117
117
|
title: updateSettings.title,
|
|
118
118
|
visibility: updateSettings.visibility,
|
|
119
|
-
publishAt: "2024-08-
|
|
119
|
+
publishAt: "2024-08-30T00:00:00Z",
|
|
120
120
|
startsAt: "2024-08-30T19:10:00Z",
|
|
121
121
|
endsAt: "2024-08-30T19:15:00Z",
|
|
122
122
|
widgets: revision.widgets,
|
|
@@ -139,7 +139,7 @@ describe("Event revision general settings", () => {
|
|
|
139
139
|
...revision.settings,
|
|
140
140
|
...updateSettings.settings,
|
|
141
141
|
},
|
|
142
|
-
publishAt: "2024-08-
|
|
142
|
+
publishAt: "2024-08-30",
|
|
143
143
|
startsAt: "2024-08-30T19:10:00",
|
|
144
144
|
endsAt: "2024-08-30T19:15:00",
|
|
145
145
|
},
|
|
@@ -129,7 +129,7 @@ describe("Event revision tags settings", () => {
|
|
|
129
129
|
assigns: {
|
|
130
130
|
resource: {
|
|
131
131
|
...revision,
|
|
132
|
-
publishAt: "2024-10-
|
|
132
|
+
publishAt: "2024-10-10",
|
|
133
133
|
startsAt: "2024-10-10T07:05:00",
|
|
134
134
|
endsAt: "2024-10-10T07:15:00",
|
|
135
135
|
tags: updateSettings.tags,
|
|
@@ -120,7 +120,7 @@ describe("Event revision visuals settings", () => {
|
|
|
120
120
|
assigns: {
|
|
121
121
|
resource: {
|
|
122
122
|
...revision,
|
|
123
|
-
publishAt: "2024-10-
|
|
123
|
+
publishAt: "2024-10-10",
|
|
124
124
|
startsAt: "2024-10-10T07:05:00",
|
|
125
125
|
endsAt: "2024-10-10T07:10:00",
|
|
126
126
|
settings: {
|
|
@@ -28,7 +28,7 @@ describe("Events Handler", () => {
|
|
|
28
28
|
title: "event title",
|
|
29
29
|
slug: "url",
|
|
30
30
|
visibility: "public",
|
|
31
|
-
publishAt: "2024-10-
|
|
31
|
+
publishAt: "2024-10-10",
|
|
32
32
|
startsAt: "2024-10-10T06:50",
|
|
33
33
|
endsAt: "2024-10-10T06:59",
|
|
34
34
|
settings: {
|
|
@@ -59,7 +59,7 @@ describe("Events Handler", () => {
|
|
|
59
59
|
title: params.title,
|
|
60
60
|
slug: params.slug,
|
|
61
61
|
visibility: params.visibility,
|
|
62
|
-
publishAt: "2024-10-
|
|
62
|
+
publishAt: "2024-10-10T00:00:00Z",
|
|
63
63
|
startsAt: "2024-10-10T06:50:00Z",
|
|
64
64
|
endsAt: "2024-10-10T06:59:00Z",
|
|
65
65
|
settings: {
|
|
@@ -87,7 +87,7 @@ describe("Events Handler", () => {
|
|
|
87
87
|
const params = {
|
|
88
88
|
title: "event title",
|
|
89
89
|
slug: "",
|
|
90
|
-
publishAt: "2024-10-
|
|
90
|
+
publishAt: "2024-10-10",
|
|
91
91
|
startsAt: "2024-10-10T06:50",
|
|
92
92
|
endsAt: "2024-10-10T06:59",
|
|
93
93
|
visibility: "public",
|
|
@@ -127,7 +127,7 @@ describe("Events Handler", () => {
|
|
|
127
127
|
title: params.title,
|
|
128
128
|
slug: "",
|
|
129
129
|
visibility: params.visibility,
|
|
130
|
-
publishAt: "2024-10-
|
|
130
|
+
publishAt: "2024-10-10T00:00:00Z",
|
|
131
131
|
startsAt: "2024-10-10T06:50:00Z",
|
|
132
132
|
endsAt: "2024-10-10T06:59:00Z",
|
|
133
133
|
settings: {
|
|
@@ -149,7 +149,7 @@ describe("Events Handler", () => {
|
|
|
149
149
|
assigns: {
|
|
150
150
|
resource: {
|
|
151
151
|
...params,
|
|
152
|
-
publishAt: "2024-10-
|
|
152
|
+
publishAt: "2024-10-10",
|
|
153
153
|
startsAt: "2024-10-10T06:50:00",
|
|
154
154
|
endsAt: "2024-10-10T06:59:00",
|
|
155
155
|
settings: {
|
package/src/utils.js
CHANGED
|
@@ -1,8 +1,35 @@
|
|
|
1
|
-
export function toUTCISO8601String(
|
|
1
|
+
export function toUTCISO8601String(inputDateTime) {
|
|
2
2
|
// The format coming from the datetie-local input is YYYY-mm-ddTHH:MM
|
|
3
3
|
// e.g. 2024-10-10T14:25
|
|
4
4
|
// Currently we will just use that as a UTC value and show some explanation in the UI!
|
|
5
|
-
return `${
|
|
5
|
+
return `${inputDateTime}:00Z`;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function dateToUTCISO8601String(inputDate) {
|
|
9
|
+
// The format coming from the datetie-local input is YYYY-mm-ddTHH:MM
|
|
10
|
+
// e.g. 2024-10-10
|
|
11
|
+
// Currently we will just use that as a UTC value and show some explanation in the UI!
|
|
12
|
+
return `${inputDate}T00:00:00Z`;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function toDateInput(initialDate = null) {
|
|
16
|
+
if (typeof initialDate === "string") {
|
|
17
|
+
// The case where it comes from the DB it is in UTC. We are going to directly feed it to the
|
|
18
|
+
// datetime-local input and add explanations in the UI!
|
|
19
|
+
return initialDate.slice(0, 10);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Directly use the current time for to feed the datetime-local input.
|
|
23
|
+
// show UI hints that this is going to be used as UTC time.
|
|
24
|
+
const now = new Date();
|
|
25
|
+
|
|
26
|
+
return [
|
|
27
|
+
now.getFullYear(),
|
|
28
|
+
"-",
|
|
29
|
+
(now.getMonth() + 1).toString().padStart(2, "0"),
|
|
30
|
+
"-",
|
|
31
|
+
now.getDate().toString().padStart(2, "0"),
|
|
32
|
+
].join("");
|
|
6
33
|
}
|
|
7
34
|
|
|
8
35
|
export function toDateTimeInput(initialDate = null) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<form action="<%= `/${_context.locale}/${_context.resourceConfig.articleType}_revisions/${resource.id}/general` %>" method="POST" class="form">
|
|
3
3
|
<%- f.field('resource.title', { required: true }) %>
|
|
4
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: '
|
|
5
|
+
<%- f.field('resource.publishAt', { required: true, type: 'date', label: `${Inflector.capitalize(_context.resourceConfig.articleType)} post date` }) %>
|
|
6
6
|
<%- f.field('resource.visibility', { as: 'select', required: true, options: visibilityOptions }) %>
|
|
7
7
|
|
|
8
8
|
<%- include('../../_shared/_credentials_input.ejs', { f, visibilityFieldId: "f_resource_visibility"}) %>
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
</div>
|
|
15
15
|
</div>
|
|
16
16
|
</form>
|
|
17
|
-
<% }) %>
|
|
17
|
+
<% }) %>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
<%- f.field('resource.title', { required: true }) %>
|
|
6
6
|
<%- f.field('resource.slug', { label: "URL", required: true, hint: "Only lowercase letters, numbers and dash allowed. Ex: celebrate-friday-13" }) %>
|
|
7
|
-
<%- f.field('resource.publishAt', { required: true, type: '
|
|
7
|
+
<%- f.field('resource.publishAt', { required: true, type: 'date', label: `${Inflector.capitalize(_context.resourceConfig.articleType)} post date` }) %>
|
|
8
8
|
<%- f.field('resource.visibility', { as: 'select', required: true, options: visibilityOptions }) %>
|
|
9
9
|
|
|
10
10
|
<%- include('../_shared/_credentials_input.ejs', { f, visibilityFieldId: "f_resource_visibility"}) %>
|
|
@@ -42,4 +42,4 @@
|
|
|
42
42
|
<% } %>
|
|
43
43
|
</div>
|
|
44
44
|
</form>
|
|
45
|
-
<% }) %>
|
|
45
|
+
<% }) %>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<td class="whitespace-nowrap">
|
|
26
26
|
<div class="body-3 text-raketa-foreground/50">
|
|
27
27
|
<div class="flex items-center gap-1">
|
|
28
|
-
<time data-pretty-datetime datetime="<%= change.insertedAt %>"><%= change.insertedAt %></time>
|
|
28
|
+
<time data-pretty-datetime datetime="<%= change.insertedAt %>"><%= utils.formattedDateTime(change.insertedAt) %></time>
|
|
29
29
|
</div>
|
|
30
30
|
</div>
|
|
31
31
|
</td>
|
|
@@ -65,4 +65,4 @@
|
|
|
65
65
|
<% if (!skipPagination) { %>
|
|
66
66
|
<%- pagination(changes.pagination, _context) %>
|
|
67
67
|
<% } %>
|
|
68
|
-
</div>
|
|
68
|
+
</div>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<tr>
|
|
21
21
|
<th><%- sort_button("Title", "title", _context) %></th>
|
|
22
22
|
<th>Visibility</th>
|
|
23
|
-
<th><%- sort_button(
|
|
23
|
+
<th><%- sort_button(`${Inflector.capitalize(_context.resourceConfig.articleType)} post date`, "publish_at", _context) %></th>
|
|
24
24
|
<th><%- sort_button("Last change", "updated_at", _context) %></th>
|
|
25
25
|
<th>Translations</th>
|
|
26
26
|
</tr>
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
</td>
|
|
48
48
|
|
|
49
49
|
<td>
|
|
50
|
-
<div class="flex
|
|
50
|
+
<div class="flex items-center gap-1 whitespace-nowrap">
|
|
51
51
|
<span class="text-raketa-foreground/30" title="<%= visibilityOptions.find(opt => opt[0] === item.visibility)[1] %>">
|
|
52
52
|
<% if (item.visibility === 'public') { %>
|
|
53
53
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
</td>
|
|
79
79
|
|
|
80
80
|
<td>
|
|
81
|
-
<time data-pretty-
|
|
81
|
+
<time data-pretty-date datetime="<%= item.publishAt %>"><%= utils.formattedDate(item.publishAt) %></time>
|
|
82
82
|
</td>
|
|
83
83
|
|
|
84
84
|
<td>
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
<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">
|
|
88
88
|
<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" />
|
|
89
89
|
</svg>
|
|
90
|
-
<time data-pretty-datetime datetime="<%= item.updatedAt %>"><%= item.updatedAt %></time>
|
|
90
|
+
<time data-pretty-datetime datetime="<%= item.updatedAt %>"><%= utils.formattedDateTime(item.updatedAt) %></time>
|
|
91
91
|
</div>
|
|
92
92
|
|
|
93
93
|
<div class="flex items-center gap-1" title="<%= item.changes[0]?.operatorMeta?.name %>">
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
<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" />
|
|
104
104
|
</svg>
|
|
105
105
|
|
|
106
|
-
<time data-pretty-datetime datetime="<%= revision.insertedAt %>"><%= revision.insertedAt %></time>
|
|
106
|
+
<time data-pretty-datetime datetime="<%= revision.insertedAt %>"><%= utils.formattedDateTime(revision.insertedAt) %></time>
|
|
107
107
|
</div>
|
|
108
108
|
</div>
|
|
109
109
|
</td>
|
|
@@ -231,4 +231,4 @@
|
|
|
231
231
|
Full page history
|
|
232
232
|
</a>
|
|
233
233
|
</div>
|
|
234
|
-
</div>
|
|
234
|
+
</div>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<form action="<%= `/${_context.locale}/${_context.resourceConfig.eventType}_revisions/${resource.id}/general` %>" method="POST" class="form">
|
|
3
3
|
<%- f.field('resource.title', { required: true }) %>
|
|
4
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: '
|
|
5
|
+
<%- f.field('resource.publishAt', { required: true, type: 'date', label: `${Inflector.capitalize(_context.resourceConfig.eventType)} post date` }) %>
|
|
6
6
|
<%- f.field('resource.startsAt', { required: true, type: 'datetime-local', label: 'Starts at (UTC)' }) %>
|
|
7
7
|
<%- f.field('resource.endsAt', { required: true, type: 'datetime-local', label: 'Ends at (UTC)' }) %>
|
|
8
8
|
<%- f.field('resource.visibility', { as: 'select', required: true, options: visibilityOptions }) %>
|
|
@@ -16,4 +16,4 @@
|
|
|
16
16
|
</div>
|
|
17
17
|
</div>
|
|
18
18
|
</form>
|
|
19
|
-
<% }) %>
|
|
19
|
+
<% }) %>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
<%- f.field('resource.title', { required: true }) %>
|
|
6
6
|
<%- f.field('resource.slug', { label: "URL", required: true, hint: "Only lowercase letters, numbers and dash allowed. Ex: celebrate-friday-13" }) %>
|
|
7
|
-
<%- f.field('resource.publishAt', { required: true, type: '
|
|
7
|
+
<%- f.field('resource.publishAt', { required: true, type: 'date', label: `${Inflector.capitalize(_context.resourceConfig.eventType)} post date` }) %>
|
|
8
8
|
<%- f.field('resource.startsAt', { required: true, type: 'datetime-local', label: 'Starts at (UTC)' }) %>
|
|
9
9
|
<%- f.field('resource.endsAt', { required: true, type: 'datetime-local', label: 'Ends at (UTC)' }) %>
|
|
10
10
|
<%- f.field('resource.visibility', { as: 'select', required: true, options: visibilityOptions }) %>
|
|
@@ -44,4 +44,4 @@
|
|
|
44
44
|
<% } %>
|
|
45
45
|
</div>
|
|
46
46
|
</form>
|
|
47
|
-
<% }) %>
|
|
47
|
+
<% }) %>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<td class="whitespace-nowrap">
|
|
26
26
|
<div class="body-3 text-raketa-foreground/50">
|
|
27
27
|
<div class="flex items-center gap-1">
|
|
28
|
-
<time data-pretty-datetime datetime="<%= change.insertedAt %>"><%= change.insertedAt %></time>
|
|
28
|
+
<time data-pretty-datetime datetime="<%= change.insertedAt %>"><%= utils.formattedDateTime(change.insertedAt) %></time>
|
|
29
29
|
</div>
|
|
30
30
|
</div>
|
|
31
31
|
</td>
|
|
@@ -65,4 +65,4 @@
|
|
|
65
65
|
<% if (!skipPagination) { %>
|
|
66
66
|
<%- pagination(changes.pagination, _context) %>
|
|
67
67
|
<% } %>
|
|
68
|
-
</div>
|
|
68
|
+
</div>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<tr>
|
|
21
21
|
<th><%- sort_button("Title", "title", _context) %></th>
|
|
22
22
|
<th>Visibility</th>
|
|
23
|
-
<th><%- sort_button(
|
|
23
|
+
<th><%- sort_button(`${Inflector.capitalize(_context.resourceConfig.eventType)} post date`, "publish_at", _context) %></th>
|
|
24
24
|
<th><%- sort_button("Last change", "updated_at", _context) %></th>
|
|
25
25
|
<th>Translations</th>
|
|
26
26
|
</tr>
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
</td>
|
|
48
48
|
|
|
49
49
|
<td>
|
|
50
|
-
<div class="flex
|
|
50
|
+
<div class="flex items-center gap-1 whitespace-nowrap">
|
|
51
51
|
<span class="text-raketa-foreground/30" title="<%= visibilityOptions.find(opt => opt[0] === item.visibility)[1] %>">
|
|
52
52
|
<% if (item.visibility === 'public') { %>
|
|
53
53
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
</td>
|
|
79
79
|
|
|
80
80
|
<td>
|
|
81
|
-
<time data-pretty-
|
|
81
|
+
<time data-pretty-date datetime="<%= item.publishAt %>"><%= utils.formattedDate(item.publishAt) %></time>
|
|
82
82
|
</td>
|
|
83
83
|
|
|
84
84
|
<td>
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
<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">
|
|
88
88
|
<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" />
|
|
89
89
|
</svg>
|
|
90
|
-
<time data-pretty-datetime datetime="<%= item.updatedAt %>"><%= item.updatedAt %></time>
|
|
90
|
+
<time data-pretty-datetime datetime="<%= item.updatedAt %>"><%= utils.formattedDateTime(item.updatedAt) %></time>
|
|
91
91
|
</div>
|
|
92
92
|
|
|
93
93
|
<div class="flex items-center gap-1" title="<%= item.changes[0]?.operatorMeta?.name %>">
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
<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" />
|
|
104
104
|
</svg>
|
|
105
105
|
|
|
106
|
-
<time data-pretty-datetime datetime="<%= revision.insertedAt %>"><%= revision.insertedAt %></time>
|
|
106
|
+
<time data-pretty-datetime datetime="<%= revision.insertedAt %>"><%= utils.formattedDateTime(revision.insertedAt) %></time>
|
|
107
107
|
</div>
|
|
108
108
|
</div>
|
|
109
109
|
</td>
|
|
@@ -231,4 +231,4 @@
|
|
|
231
231
|
Full page history
|
|
232
232
|
</a>
|
|
233
233
|
</div>
|
|
234
|
-
</div>
|
|
234
|
+
</div>
|
|
@@ -218,6 +218,14 @@
|
|
|
218
218
|
})
|
|
219
219
|
})
|
|
220
220
|
|
|
221
|
+
document.querySelectorAll('time[data-pretty-date]').forEach(item => {
|
|
222
|
+
const dateStr = item.getAttribute("datetime");
|
|
223
|
+
|
|
224
|
+
item.innerText = new Date(dateStr).toLocaleString('en-GB', {
|
|
225
|
+
dateStyle: "short"
|
|
226
|
+
})
|
|
227
|
+
})
|
|
228
|
+
|
|
221
229
|
document.querySelectorAll('time[data-pretty-expiration-time]').forEach(item => {
|
|
222
230
|
const dateStr = item.getAttribute("datetime");
|
|
223
231
|
|
|
@@ -259,6 +267,10 @@
|
|
|
259
267
|
form.setAttribute('data-changed', 1);
|
|
260
268
|
});
|
|
261
269
|
});
|
|
270
|
+
|
|
271
|
+
form.addEventListener('submit', () => {
|
|
272
|
+
form.removeAttribute('data-changed');
|
|
273
|
+
})
|
|
262
274
|
});
|
|
263
275
|
|
|
264
276
|
window.addEventListener('beforeunload', (e) => {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<td class="whitespace-nowrap">
|
|
26
26
|
<div class="body-3 text-raketa-foreground/50">
|
|
27
27
|
<div class="flex items-center gap-1">
|
|
28
|
-
<time data-pretty-datetime datetime="<%= change.insertedAt %>"><%= change.insertedAt %></time>
|
|
28
|
+
<time data-pretty-datetime datetime="<%= change.insertedAt %>"><%= utils.formattedDateTime(change.insertedAt) %></time>
|
|
29
29
|
</div>
|
|
30
30
|
</div>
|
|
31
31
|
</td>
|
|
@@ -65,4 +65,4 @@
|
|
|
65
65
|
<% if (!skipPagination) { %>
|
|
66
66
|
<%- pagination(changes.pagination, _context) %>
|
|
67
67
|
<% } %>
|
|
68
|
-
</div>
|
|
68
|
+
</div>
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
</td>
|
|
47
47
|
|
|
48
48
|
<td>
|
|
49
|
-
<div class="flex
|
|
49
|
+
<div class="flex items-center gap-1 whitespace-nowrap">
|
|
50
50
|
<span class="text-raketa-foreground/30" title="<%= visibilityOptions.find(opt => opt[0] === item.visibility)[1] %>">
|
|
51
51
|
<% if (item.visibility === 'public') { %>
|
|
52
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">
|
|
@@ -82,7 +82,7 @@
|
|
|
82
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
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
84
|
</svg>
|
|
85
|
-
<time data-pretty-datetime datetime="<%= item.updatedAt %>"><%= item.updatedAt %></time>
|
|
85
|
+
<time data-pretty-datetime datetime="<%= item.updatedAt %>"><%= utils.formattedDateTime(item.updatedAt) %></time>
|
|
86
86
|
</div>
|
|
87
87
|
|
|
88
88
|
<div class="flex items-center gap-1" title="<%= item.changes[0]?.operatorMeta?.name %>">
|
package/src/views/pages/show.ejs
CHANGED
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
<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" />
|
|
105
105
|
</svg>
|
|
106
106
|
|
|
107
|
-
<time data-pretty-datetime datetime="<%= revision.insertedAt %>"><%= revision.insertedAt %></time>
|
|
107
|
+
<time data-pretty-datetime datetime="<%= revision.insertedAt %>"><%= utils.formattedDateTime(revision.insertedAt) %></time>
|
|
108
108
|
</div>
|
|
109
109
|
</div>
|
|
110
110
|
</td>
|
|
@@ -232,4 +232,4 @@
|
|
|
232
232
|
Full page history
|
|
233
233
|
</a>
|
|
234
234
|
</div>
|
|
235
|
-
</div>
|
|
235
|
+
</div>
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
<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" />
|
|
55
55
|
</svg>
|
|
56
56
|
|
|
57
|
-
<time data-pretty-datetime datetime="<%= item.updatedAt %>"><%= item.updatedAt %></time>
|
|
57
|
+
<time data-pretty-datetime datetime="<%= item.updatedAt %>"><%= utils.formattedDateTime(item.updatedAt) %></time>
|
|
58
58
|
</div>
|
|
59
59
|
</td>
|
|
60
60
|
<td class="actions">
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
</tr>
|
|
30
30
|
<tr>
|
|
31
31
|
<th class="w-1 whitespace-nowrap">Updated at</th>
|
|
32
|
-
<time data-pretty-datetime datetime="<%= item.updatedAt %>"><%= item.updatedAt %></time>
|
|
32
|
+
<time data-pretty-datetime datetime="<%= item.updatedAt %>"><%= utils.formattedDateTime(item.updatedAt) %></time>
|
|
33
33
|
</tr>
|
|
34
34
|
</tbody>
|
|
35
35
|
</table>
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
<td><%= item.version %></td>
|
|
53
53
|
<td><%= item.title %></td>
|
|
54
54
|
<td><%= item.operatorMeta.name %></td>
|
|
55
|
-
<td><time data-pretty-datetime datetime="<%= item.insertedAt %>"><%= item.insertedAt %></time></td>
|
|
55
|
+
<td><time data-pretty-datetime datetime="<%= item.insertedAt %>"><%= utils.formattedDateTime(item.insertedAt) %></time></td>
|
|
56
56
|
</tr>
|
|
57
57
|
<% }) %>
|
|
58
58
|
</tbody>
|