@raketa-cloud/admin 0.0.52 → 0.0.54
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/HonoAdapter.js +5 -0
- package/src/handlers/DashboardsHandler.js +9 -0
- package/src/handlers/article_revisions/CodeHandler.js +1 -1
- package/src/handlers/article_revisions/GeneralHandler.js +1 -1
- package/src/handlers/article_revisions/MetaHandler.js +1 -1
- package/src/handlers/article_revisions/TagHandler.js +1 -1
- package/src/handlers/article_revisions/VisualHandler.js +1 -1
- package/src/handlers/event_revisions/CodeHandler.js +1 -1
- package/src/handlers/event_revisions/GeneralHandler.js +1 -1
- package/src/handlers/event_revisions/MetaHandler.js +1 -1
- package/src/handlers/event_revisions/TagHandler.js +1 -1
- package/src/handlers/event_revisions/VisualHandler.js +1 -1
- package/src/handlers/page_revisions/CodeHandler.js +1 -1
- package/src/handlers/page_revisions/GeneralHandler.js +1 -1
- package/src/handlers/page_revisions/MetaHandler.js +1 -1
- package/src/handlers/page_revisions/TagHandler.js +1 -1
- package/src/handlers/page_revisions/VisualHandler.js +1 -1
- package/src/routeStandard.js +17 -0
- package/src/setupAuthentication.js +1 -1
- package/src/tests/handlers/DashboardsHandler.test/index.test.js +17 -0
- package/src/tests/handlers/article_revisions/CodesHandler.test/update.test.js +1 -1
- package/src/tests/handlers/article_revisions/GeneralHandler.test/update.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/update.test.js +1 -1
- package/src/tests/handlers/article_revisions/VisualHandler.test.test/update.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/update.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/update.test.js +1 -1
- package/src/tests/handlers/event_revisions/VisualHandler.test.test/update.test.js +1 -1
- package/src/tests/handlers/page_revisions/CodesHandler.test/update.test.js +1 -1
- package/src/tests/handlers/page_revisions/GeneralHandler.test/update.test.js +1 -1
- package/src/tests/handlers/page_revisions/MetaHandler.test/update.test.js +1 -1
- package/src/tests/handlers/page_revisions/TagHandler.test/update.test.js +1 -1
- package/src/tests/handlers/page_revisions/VisualHandler.test.test/update.test.js +1 -1
- package/src/views/article_revisions/_nav.ejs +4 -0
- package/src/views/articles/_shared/_title.ejs +11 -0
- package/src/views/articles/_shared/_toolbar.ejs +2 -2
- package/src/views/articles/index.ejs +4 -2
- package/src/views/articles/show.ejs +18 -20
- package/src/views/dashboard/index.ejs +5 -0
- package/src/views/event_revisions/_nav.ejs +4 -0
- package/src/views/events/_shared/_title.ejs +12 -0
- package/src/views/events/_shared/_toolbar.ejs +2 -2
- package/src/views/events/index.ejs +4 -2
- package/src/views/events/show.ejs +18 -20
- package/src/views/page_revisions/_nav.ejs +4 -0
- package/src/views/pages/_shared/_title.ejs +12 -0
- package/src/views/pages/_shared/_toolbar.ejs +2 -2
- package/src/views/pages/index.ejs +4 -2
- package/src/views/pages/show.ejs +18 -20
package/package.json
CHANGED
package/src/HonoAdapter.js
CHANGED
|
@@ -43,6 +43,10 @@ export default class HonoAdapter extends Adapter {
|
|
|
43
43
|
cookie_key: "cms-starter-slim",
|
|
44
44
|
},
|
|
45
45
|
});
|
|
46
|
+
|
|
47
|
+
router.get("/", (c) => {
|
|
48
|
+
return c.redirect("/en");
|
|
49
|
+
});
|
|
46
50
|
}
|
|
47
51
|
|
|
48
52
|
setGlobalContext(globalCtx) {
|
|
@@ -116,6 +120,7 @@ export default class HonoAdapter extends Adapter {
|
|
|
116
120
|
},
|
|
117
121
|
resourceConfig: resourceConfig,
|
|
118
122
|
adminJwt: ctx.authentication.token,
|
|
123
|
+
remoteConfig: { ...this.globalConfig.remoteConfig },
|
|
119
124
|
};
|
|
120
125
|
|
|
121
126
|
ctx.logger.info(
|
|
@@ -64,7 +64,7 @@ const update = async (ctx) => {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
return {
|
|
67
|
-
redirect: `/${ctx.locale}/${ctx.resourceConfig.articleType}_revisions/${revision.id}/codes/edit`,
|
|
67
|
+
redirect: `/${ctx.locale}/${ctx.resourceConfig.articleType}_revisions/${revision.id}/codes/edit?success=1`,
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
70
|
|
|
@@ -66,7 +66,7 @@ const update = async (ctx) => {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
return {
|
|
69
|
-
redirect: `/${ctx.locale}/${ctx.resourceConfig.articleType}_revisions/${revision.id}/general/edit`,
|
|
69
|
+
redirect: `/${ctx.locale}/${ctx.resourceConfig.articleType}_revisions/${revision.id}/general/edit?success=1`,
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
72
|
|
|
@@ -64,7 +64,7 @@ const update = async (ctx) => {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
return {
|
|
67
|
-
redirect: `/${ctx.locale}/${ctx.resourceConfig.articleType}_revisions/${revision.id}/meta/edit`,
|
|
67
|
+
redirect: `/${ctx.locale}/${ctx.resourceConfig.articleType}_revisions/${revision.id}/meta/edit?success=1`,
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
70
|
|
|
@@ -73,7 +73,7 @@ const update = async (ctx) => {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
return {
|
|
76
|
-
redirect: `/${ctx.locale}/${ctx.resourceConfig.articleType}_revisions/${revision.id}/tags/edit`,
|
|
76
|
+
redirect: `/${ctx.locale}/${ctx.resourceConfig.articleType}_revisions/${revision.id}/tags/edit?success=1`,
|
|
77
77
|
};
|
|
78
78
|
};
|
|
79
79
|
|
|
@@ -64,7 +64,7 @@ const update = async (ctx) => {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
return {
|
|
67
|
-
redirect: `/${ctx.locale}/${ctx.resourceConfig.articleType}_revisions/${revision.id}/visuals/edit`,
|
|
67
|
+
redirect: `/${ctx.locale}/${ctx.resourceConfig.articleType}_revisions/${revision.id}/visuals/edit?success=1`,
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
70
|
|
|
@@ -62,7 +62,7 @@ const update = async (ctx) => {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
return {
|
|
65
|
-
redirect: `/${ctx.locale}/${ctx.resourceConfig.eventType}_revisions/${revision.id}/codes/edit`,
|
|
65
|
+
redirect: `/${ctx.locale}/${ctx.resourceConfig.eventType}_revisions/${revision.id}/codes/edit?success=1`,
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
68
|
|
|
@@ -64,7 +64,7 @@ const update = async (ctx) => {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
return {
|
|
67
|
-
redirect: `/${ctx.locale}/${ctx.resourceConfig.eventType}_revisions/${revision.id}/general/edit`,
|
|
67
|
+
redirect: `/${ctx.locale}/${ctx.resourceConfig.eventType}_revisions/${revision.id}/general/edit?success=1`,
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
70
|
|
|
@@ -62,7 +62,7 @@ const update = async (ctx) => {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
return {
|
|
65
|
-
redirect: `/${ctx.locale}/${ctx.resourceConfig.eventType}_revisions/${revision.id}/meta/edit`,
|
|
65
|
+
redirect: `/${ctx.locale}/${ctx.resourceConfig.eventType}_revisions/${revision.id}/meta/edit?success=1`,
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
68
|
|
|
@@ -71,7 +71,7 @@ const update = async (ctx) => {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
return {
|
|
74
|
-
redirect: `/${ctx.locale}/${ctx.resourceConfig.eventType}_revisions/${revision.id}/tags/edit`,
|
|
74
|
+
redirect: `/${ctx.locale}/${ctx.resourceConfig.eventType}_revisions/${revision.id}/tags/edit?success=1`,
|
|
75
75
|
};
|
|
76
76
|
};
|
|
77
77
|
|
|
@@ -62,7 +62,7 @@ const update = async (ctx) => {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
return {
|
|
65
|
-
redirect: `/${ctx.locale}/${ctx.resourceConfig.eventType}_revisions/${revision.id}/visuals/edit`,
|
|
65
|
+
redirect: `/${ctx.locale}/${ctx.resourceConfig.eventType}_revisions/${revision.id}/visuals/edit?success=1`,
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
68
|
|
|
@@ -47,7 +47,7 @@ const update = async (ctx) => {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
return {
|
|
50
|
-
redirect: `/${ctx.locale}/${ctx.resourceConfig.pageType}_revisions/${revision.id}/codes/edit`,
|
|
50
|
+
redirect: `/${ctx.locale}/${ctx.resourceConfig.pageType}_revisions/${revision.id}/codes/edit?success=1`,
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
53
|
|
|
@@ -49,7 +49,7 @@ const update = async (ctx) => {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
return {
|
|
52
|
-
redirect: `/${ctx.locale}/${ctx.resourceConfig.pageType}_revisions/${revision.id}/general/edit`,
|
|
52
|
+
redirect: `/${ctx.locale}/${ctx.resourceConfig.pageType}_revisions/${revision.id}/general/edit?success=1`,
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
55
|
|
|
@@ -47,7 +47,7 @@ const update = async (ctx) => {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
return {
|
|
50
|
-
redirect: `/${ctx.locale}/${ctx.resourceConfig.pageType}_revisions/${revision.id}/meta/edit`,
|
|
50
|
+
redirect: `/${ctx.locale}/${ctx.resourceConfig.pageType}_revisions/${revision.id}/meta/edit?success=1`,
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
53
|
|
|
@@ -59,7 +59,7 @@ const update = async (ctx) => {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
return {
|
|
62
|
-
redirect: `/${ctx.locale}/${ctx.resourceConfig.pageType}_revisions/${revision.id}/tags/edit`,
|
|
62
|
+
redirect: `/${ctx.locale}/${ctx.resourceConfig.pageType}_revisions/${revision.id}/tags/edit?success=1`,
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
65
|
|
|
@@ -48,7 +48,7 @@ const update = async (ctx) => {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
return {
|
|
51
|
-
redirect: `/${ctx.locale}/${ctx.resourceConfig.pageType}_revisions/${revision.id}/visuals/edit`,
|
|
51
|
+
redirect: `/${ctx.locale}/${ctx.resourceConfig.pageType}_revisions/${revision.id}/visuals/edit?success=1`,
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
54
|
|
package/src/routeStandard.js
CHANGED
|
@@ -5,8 +5,25 @@ import routeArticlesModule from "./routeArticlesModule";
|
|
|
5
5
|
import routeEventsModule from "./routeEventsModule";
|
|
6
6
|
import RedirectsHandler from "./handlers/RedirectsHandler";
|
|
7
7
|
import TagsHandler from "./handlers/TagsHandler";
|
|
8
|
+
import DashboardsHandler from "./handlers/DashboardsHandler";
|
|
8
9
|
|
|
9
10
|
function routeStandard(adapter) {
|
|
11
|
+
adapter.routeCollection(
|
|
12
|
+
[
|
|
13
|
+
[
|
|
14
|
+
"GET",
|
|
15
|
+
"",
|
|
16
|
+
"dashboard",
|
|
17
|
+
"dashboard",
|
|
18
|
+
"index",
|
|
19
|
+
DashboardsHandler.index,
|
|
20
|
+
undefined,
|
|
21
|
+
undefined,
|
|
22
|
+
],
|
|
23
|
+
],
|
|
24
|
+
{}
|
|
25
|
+
);
|
|
26
|
+
|
|
10
27
|
routeCollection(adapter, "redirects", RedirectsHandler);
|
|
11
28
|
routeCollection(adapter, "tags", TagsHandler);
|
|
12
29
|
routeSettings(adapter);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import DashboardsHandler from "../../../handlers/DashboardsHandler";
|
|
2
|
+
|
|
3
|
+
describe("Redirects", () => {
|
|
4
|
+
function buildCtx() {
|
|
5
|
+
return {};
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
test("index", async () => {
|
|
9
|
+
const ctx = buildCtx();
|
|
10
|
+
|
|
11
|
+
const result = await DashboardsHandler.index(ctx);
|
|
12
|
+
|
|
13
|
+
expect(result).toEqual({
|
|
14
|
+
assigns: {},
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<% if (_context.query?.success) { %>
|
|
2
|
+
<div class="mb-6 text-emerald-600">Settings saved successfully.</div>
|
|
3
|
+
<% } %>
|
|
4
|
+
|
|
1
5
|
<%
|
|
2
6
|
const activeClass = "relative top-0.5 px-4 border-b-2 border-raketa-primary pb-4";
|
|
3
7
|
const inactiveClass = "relative top-0.5 px-4 border-b-2 border-transparent pb-4";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<h1 class="heading-1 flex items-center gap-2">
|
|
2
|
+
<%= resource.title %>
|
|
3
|
+
|
|
4
|
+
<% if (resource.visibility !== "private") { %>
|
|
5
|
+
<a href="<%= _context.remoteConfig.resourceUrl(resource, _context.resourceConfig.articleType, _context.locale) %>" target="_blank">
|
|
6
|
+
<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">
|
|
7
|
+
<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" />
|
|
8
|
+
</svg>
|
|
9
|
+
</a>
|
|
10
|
+
<% } %>
|
|
11
|
+
</h1>
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<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" />
|
|
20
20
|
</svg>
|
|
21
21
|
|
|
22
|
-
Clone <%= _context.resourceConfig.articleType %>
|
|
22
|
+
Clone <%= Inflector.humanize(Inflector.downcase(_context.resourceConfig.articleType)) %>
|
|
23
23
|
</button>
|
|
24
24
|
</form>
|
|
25
25
|
|
|
@@ -28,6 +28,6 @@
|
|
|
28
28
|
<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" />
|
|
29
29
|
</svg>
|
|
30
30
|
|
|
31
|
-
Delete <%= _context.resourceConfig.articleType %>
|
|
31
|
+
Delete <%= Inflector.humanize(Inflector.downcase(_context.resourceConfig.articleType)) %>
|
|
32
32
|
</a>
|
|
33
33
|
</div>
|
|
@@ -36,11 +36,13 @@
|
|
|
36
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
37
|
<% } %>
|
|
38
38
|
|
|
39
|
+
<% if (item.visibility !== "private") { %>
|
|
39
40
|
<div class="mt-1">
|
|
40
|
-
<a href="<%=
|
|
41
|
-
|
|
41
|
+
<a href="<%= _context.remoteConfig.resourceUrl(item, _context.resourceConfig.articleType, _context.locale) %>" class="body-3 text-raketa-foreground/50" target="_blank">
|
|
42
|
+
<%= _context.remoteConfig.resourcePath(item, _context.resourceConfig.articleType, _context.locale) %>
|
|
42
43
|
</a>
|
|
43
44
|
</div>
|
|
45
|
+
<% } %>
|
|
44
46
|
</td>
|
|
45
47
|
|
|
46
48
|
<td>
|
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
<div class="page-wrapper">
|
|
2
2
|
<div class="page-title">
|
|
3
|
-
|
|
4
|
-
<h1 class="heading-1"><%= resource.title %></h1>
|
|
5
|
-
<div class="flex flex-wrap items-center gap-1">
|
|
6
|
-
<% Object.keys(_context.locales).forEach(key => { %>
|
|
7
|
-
<% const { name, _code, flag} = _context.locales[key] %>
|
|
8
|
-
<% if (key === _context.locale) { %>
|
|
9
|
-
<img title="<%= name %>" src="<%= flag %>" alt="<%= name %>" class="size-6 rounded-full border dark:border-neutral-700" />
|
|
10
|
-
<% } else if (resource.translations[key]) { %>
|
|
11
|
-
<a href="<%= `/${key}/${_context.resourceConfig.articleTypePlural}/${resource.translations[key].id}` %>">
|
|
12
|
-
<img title="<%= name %>" src="<%= flag %>" alt="<%= name %>" class="size-6 rounded-full border dark:border-neutral-700" />
|
|
13
|
-
</a>
|
|
14
|
-
<% } else { %>
|
|
15
|
-
<a href="<%= `/${_context.locale}/${_context.resourceConfig.articleTypePlural}/${resource.id}/translations/new?target_locale=${key}` %>">
|
|
16
|
-
<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(" ") %>" />
|
|
17
|
-
</a>
|
|
18
|
-
<% } %>
|
|
19
|
-
<% }); %>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
|
|
3
|
+
<%- render_partial('./_shared/_title.ejs') %>
|
|
23
4
|
<%- render_partial('./_shared/_toolbar.ejs') %>
|
|
24
5
|
</div>
|
|
25
6
|
|
|
7
|
+
<div class="flex flex-wrap items-center gap-1 mb-6 -my-4">
|
|
8
|
+
<% Object.keys(_context.locales).forEach(key => { %>
|
|
9
|
+
<% const { name, _code, flag} = _context.locales[key] %>
|
|
10
|
+
<% if (key === _context.locale) { %>
|
|
11
|
+
<img title="<%= name %>" src="<%= flag %>" alt="<%= name %>" class="size-6 rounded-full border dark:border-neutral-700" />
|
|
12
|
+
<% } else if (resource.translations[key]) { %>
|
|
13
|
+
<a href="<%= `/${key}/${_context.resourceConfig.articleTypePlural}/${resource.translations[key].id}` %>">
|
|
14
|
+
<img title="<%= name %>" src="<%= flag %>" alt="<%= name %>" class="size-6 rounded-full border dark:border-neutral-700" />
|
|
15
|
+
</a>
|
|
16
|
+
<% } else { %>
|
|
17
|
+
<a href="<%= `/${_context.locale}/${_context.resourceConfig.articleTypePlural}/${resource.id}/translations/new?target_locale=${key}` %>">
|
|
18
|
+
<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(" ") %>" />
|
|
19
|
+
</a>
|
|
20
|
+
<% } %>
|
|
21
|
+
<% }); %>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
26
24
|
<% if (revisions.length) { %>
|
|
27
25
|
<div class="pb-8">
|
|
28
26
|
<h4 class="pb-4 heading-3 flex items-center gap-2">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<% if (_context.query?.success) { %>
|
|
2
|
+
<div class="mb-6 text-emerald-600">Settings saved successfully.</div>
|
|
3
|
+
<% } %>
|
|
4
|
+
|
|
1
5
|
<%
|
|
2
6
|
const activeClass = "relative top-0.5 px-4 border-b-2 border-raketa-primary pb-4";
|
|
3
7
|
const inactiveClass = "relative top-0.5 px-4 border-b-2 border-transparent pb-4";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<h1 class="heading-1 flex items-center gap-2">
|
|
2
|
+
<%= resource.title %>
|
|
3
|
+
|
|
4
|
+
<% if (resource.visibility !== "private") { %>
|
|
5
|
+
<a href="<%= _context.remoteConfig.resourceUrl(resource, _context.resourceConfig.eventType, _context.locale) %>" target="_blank">
|
|
6
|
+
<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">
|
|
7
|
+
<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" />
|
|
8
|
+
</svg>
|
|
9
|
+
</a>
|
|
10
|
+
<% } %>
|
|
11
|
+
</h1>
|
|
12
|
+
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<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" />
|
|
20
20
|
</svg>
|
|
21
21
|
|
|
22
|
-
Clone <%= _context.resourceConfig.eventType %>
|
|
22
|
+
Clone <%= Inflector.humanize(Inflector.downcase(_context.resourceConfig.eventType)) %>
|
|
23
23
|
</button>
|
|
24
24
|
</form>
|
|
25
25
|
|
|
@@ -28,6 +28,6 @@
|
|
|
28
28
|
<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" />
|
|
29
29
|
</svg>
|
|
30
30
|
|
|
31
|
-
Delete <%= _context.resourceConfig.eventType %>
|
|
31
|
+
Delete <%= Inflector.humanize(Inflector.downcase(_context.resourceConfig.eventType)) %>
|
|
32
32
|
</a>
|
|
33
33
|
</div>
|
|
@@ -36,11 +36,13 @@
|
|
|
36
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
37
|
<% } %>
|
|
38
38
|
|
|
39
|
+
<% if (item.visibility !== "private") { %>
|
|
39
40
|
<div class="mt-1">
|
|
40
|
-
<a href="<%=
|
|
41
|
-
|
|
41
|
+
<a href="<%= _context.remoteConfig.resourceUrl(item, _context.resourceConfig.eventType, _context.locale) %>" class="body-3 text-raketa-foreground/50" target="_blank">
|
|
42
|
+
<%= _context.remoteConfig.resourcePath(item, _context.resourceConfig.eventType, _context.locale) %>
|
|
42
43
|
</a>
|
|
43
44
|
</div>
|
|
45
|
+
<% } %>
|
|
44
46
|
</td>
|
|
45
47
|
|
|
46
48
|
<td>
|
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
<div class="page-wrapper">
|
|
2
2
|
<div class="page-title">
|
|
3
|
-
|
|
4
|
-
<h1 class="heading-1"><%= resource.title %></h1>
|
|
5
|
-
<div class="flex flex-wrap items-center gap-1">
|
|
6
|
-
<% Object.keys(_context.locales).forEach(key => { %>
|
|
7
|
-
<% const { name, _code, flag} = _context.locales[key] %>
|
|
8
|
-
<% if (key === _context.locale) { %>
|
|
9
|
-
<img title="<%= name %>" src="<%= flag %>" alt="<%= name %>" class="size-6 rounded-full border dark:border-neutral-700" />
|
|
10
|
-
<% } else if (resource.translations[key]) { %>
|
|
11
|
-
<a href="<%= `/${key}/${_context.resourceConfig.eventTypePlural}/${resource.translations[key].id}` %>">
|
|
12
|
-
<img title="<%= name %>" src="<%= flag %>" alt="<%= name %>" class="size-6 rounded-full border dark:border-neutral-700" />
|
|
13
|
-
</a>
|
|
14
|
-
<% } else { %>
|
|
15
|
-
<a href="<%= `/${_context.locale}/${_context.resourceConfig.eventTypePlural}/${resource.id}/translations/new?target_locale=${key}` %>">
|
|
16
|
-
<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(" ") %>" />
|
|
17
|
-
</a>
|
|
18
|
-
<% } %>
|
|
19
|
-
<% }); %>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
|
|
3
|
+
<%- render_partial('./_shared/_title.ejs') %>
|
|
23
4
|
<%- render_partial('./_shared/_toolbar.ejs') %>
|
|
24
5
|
</div>
|
|
25
6
|
|
|
7
|
+
<div class="flex flex-wrap items-center gap-1 mb-6 -mt-4">
|
|
8
|
+
<% Object.keys(_context.locales).forEach(key => { %>
|
|
9
|
+
<% const { name, _code, flag} = _context.locales[key] %>
|
|
10
|
+
<% if (key === _context.locale) { %>
|
|
11
|
+
<img title="<%= name %>" src="<%= flag %>" alt="<%= name %>" class="size-6 rounded-full border dark:border-neutral-700" />
|
|
12
|
+
<% } else if (resource.translations[key]) { %>
|
|
13
|
+
<a href="<%= `/${key}/${_context.resourceConfig.eventTypePlural}/${resource.translations[key].id}` %>">
|
|
14
|
+
<img title="<%= name %>" src="<%= flag %>" alt="<%= name %>" class="size-6 rounded-full border dark:border-neutral-700" />
|
|
15
|
+
</a>
|
|
16
|
+
<% } else { %>
|
|
17
|
+
<a href="<%= `/${_context.locale}/${_context.resourceConfig.eventTypePlural}/${resource.id}/translations/new?target_locale=${key}` %>">
|
|
18
|
+
<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(" ") %>" />
|
|
19
|
+
</a>
|
|
20
|
+
<% } %>
|
|
21
|
+
<% }); %>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
26
24
|
<% if (revisions.length) { %>
|
|
27
25
|
<div class="pb-8">
|
|
28
26
|
<h4 class="pb-4 heading-3 flex items-center gap-2">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<% if (_context.query?.success) { %>
|
|
2
|
+
<div class="mb-6 text-emerald-600">Settings saved successfully.</div>
|
|
3
|
+
<% } %>
|
|
4
|
+
|
|
1
5
|
<%
|
|
2
6
|
const activeClass = "relative top-0.5 px-4 border-b-2 border-raketa-primary pb-4";
|
|
3
7
|
const inactiveClass = "relative top-0.5 px-4 border-b-2 border-transparent pb-4";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<h1 class="heading-1 flex items-center gap-2">
|
|
2
|
+
<%= resource.title %>
|
|
3
|
+
|
|
4
|
+
<% if (resource.visibility !== "private") { %>
|
|
5
|
+
<a href="<%= _context.remoteConfig.resourceUrl(resource, _context.resourceConfig.pageType, _context.locale) %>" target="_blank">
|
|
6
|
+
<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">
|
|
7
|
+
<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" />
|
|
8
|
+
</svg>
|
|
9
|
+
</a>
|
|
10
|
+
<% } %>
|
|
11
|
+
</h1>
|
|
12
|
+
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<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" />
|
|
20
20
|
</svg>
|
|
21
21
|
|
|
22
|
-
Clone <%= _context.resourceConfig.pageType %>
|
|
22
|
+
Clone <%= Inflector.humanize(Inflector.downcase(_context.resourceConfig.pageType)) %>
|
|
23
23
|
</button>
|
|
24
24
|
</form>
|
|
25
25
|
|
|
@@ -28,6 +28,6 @@
|
|
|
28
28
|
<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" />
|
|
29
29
|
</svg>
|
|
30
30
|
|
|
31
|
-
Delete <%= _context.resourceConfig.pageType %>
|
|
31
|
+
Delete <%= Inflector.humanize(Inflector.downcase(_context.resourceConfig.pageType)) %>
|
|
32
32
|
</a>
|
|
33
33
|
</div>
|
|
@@ -36,11 +36,13 @@
|
|
|
36
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
37
|
<% } %>
|
|
38
38
|
|
|
39
|
+
<% if (item.visibility !== "private") { %>
|
|
39
40
|
<div class="mt-1">
|
|
40
|
-
<a href="<%=
|
|
41
|
-
|
|
41
|
+
<a href="<%= _context.remoteConfig.resourceUrl(item, _context.resourceConfig.pageType, _context.locale) %>" class="body-3 text-raketa-foreground/50" target="_blank">
|
|
42
|
+
<%= _context.remoteConfig.resourcePath(item, _context.resourceConfig.pageType, _context.locale) %>
|
|
42
43
|
</a>
|
|
43
44
|
</div>
|
|
45
|
+
<% } %>
|
|
44
46
|
</td>
|
|
45
47
|
|
|
46
48
|
<td>
|
package/src/views/pages/show.ejs
CHANGED
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
<div class="page-wrapper">
|
|
2
2
|
<div class="page-title">
|
|
3
|
-
|
|
4
|
-
<h1 class="heading-1"><%= resource.title %></h1>
|
|
5
|
-
<div class="flex flex-wrap items-center gap-1">
|
|
6
|
-
<% Object.keys(_context.locales).forEach(key => { %>
|
|
7
|
-
<% const { name, _code, flag} = _context.locales[key] %>
|
|
8
|
-
<% if (key === _context.locale) { %>
|
|
9
|
-
<img title="<%= name %>" src="<%= flag %>" alt="<%= name %>" class="size-6 rounded-full border dark:border-neutral-700" />
|
|
10
|
-
<% } else if (resource.translations[key]) { %>
|
|
11
|
-
<a href="<%= `/${key}/${_context.resourceConfig.pageTypePlural}/${resource.translations[key].id}` %>">
|
|
12
|
-
<img title="<%= name %>" src="<%= flag %>" alt="<%= name %>" class="size-6 rounded-full border dark:border-neutral-700" />
|
|
13
|
-
</a>
|
|
14
|
-
<% } else { %>
|
|
15
|
-
<a href="<%= `/${_context.locale}/${_context.resourceConfig.pageTypePlural}/${resource.id}/translations/new?target_locale=${key}` %>">
|
|
16
|
-
<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(" ") %>" />
|
|
17
|
-
</a>
|
|
18
|
-
<% } %>
|
|
19
|
-
<% }); %>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
|
|
3
|
+
<%- render_partial('./_shared/_title.ejs') %>
|
|
23
4
|
<%- render_partial('./_shared/_toolbar.ejs') %>
|
|
24
5
|
</div>
|
|
25
6
|
|
|
7
|
+
<div class="flex flex-wrap items-center gap-1 mb-6 -mt-4">
|
|
8
|
+
<% Object.keys(_context.locales).forEach(key => { %>
|
|
9
|
+
<% const { name, _code, flag} = _context.locales[key] %>
|
|
10
|
+
<% if (key === _context.locale) { %>
|
|
11
|
+
<img title="<%= name %>" src="<%= flag %>" alt="<%= name %>" class="size-6 rounded-full border dark:border-neutral-700" />
|
|
12
|
+
<% } else if (resource.translations[key]) { %>
|
|
13
|
+
<a href="<%= `/${key}/${_context.resourceConfig.pageTypePlural}/${resource.translations[key].id}` %>">
|
|
14
|
+
<img title="<%= name %>" src="<%= flag %>" alt="<%= name %>" class="size-6 rounded-full border dark:border-neutral-700" />
|
|
15
|
+
</a>
|
|
16
|
+
<% } else { %>
|
|
17
|
+
<a href="<%= `/${_context.locale}/${_context.resourceConfig.pageTypePlural}/${resource.id}/translations/new?target_locale=${key}` %>">
|
|
18
|
+
<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(" ") %>" />
|
|
19
|
+
</a>
|
|
20
|
+
<% } %>
|
|
21
|
+
<% }); %>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
26
24
|
<% if (revisions.length) { %>
|
|
27
25
|
<div class="pb-8">
|
|
28
26
|
<h4 class="pb-4 heading-3 flex items-center gap-2">
|