Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions languages/en_GB/custom-pages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"custom-pages": "Custom Pages",
"intro": "Define and customise your new routes here.",
"add-content-info": "You can add content to your new routes from <a href=\"%1/admin/extend/widgets\">Extend &rarr; Widgets</a>.",
"navigation-info": "You can add your new route to the site navigation from <a href=\"%1/admin/general/navigation\">General &rarr; Navigation</a> and select \"Custom Route\".",
"homepage-info": "If you wish to set a custom page as your homepage, go to <a href=\"%1/admin/settings/general#home-page\">General &rarr; Homepage</a> and select \"Custom\".",
"page-title": "Page Title",
"path-to-page": "Path to Page",
"restrict-groups": "Restrict access to groups (leave blank for public):",
"saved": "Custom pages saved and activated",
"area-header": "%1 Header",
"area-footer": "%1 Footer",
"area-sidebar": "%1 Sidebar",
"area-content": "%1 Content"
}
15 changes: 15 additions & 0 deletions languages/he/custom-pages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"custom-pages": "דפים מותאמים אישית",
"intro": "כאן ניתן להגדיר ולהתאים אישית נתיבים חדשים.",
"add-content-info": "ניתן להוסיף תוכן לנתיבים החדשים מתוך <a href=\"%1/admin/extend/widgets\">הרחבה &larr; רכיבים</a>.",
"navigation-info": "ניתן להוסיף את הנתיב החדש לניווט האתר מתוך <a href=\"%1/admin/general/navigation\">כללי &larr; ניווט</a> ולבחור באפשרות \"נתיב מותאם אישית\".",
"homepage-info": "אם ברצונך להגדיר דף מותאם אישית כדף הבית, גש אל <a href=\"%1/admin/settings/general#home-page\">כללי &larr; דף הבית</a> ובחר באפשרות \"מותאם אישית\".",
"page-title": "כותרת הדף",
"path-to-page": "נתיב לדף",
"restrict-groups": "הגבל גישה לקבוצות (השאר ריק לכלל הציבור):",
"saved": "הדפים המותאמים אישית נשמרו והופעלו",
"area-header": "כותרת עליונה של %1",
"area-footer": "כותרת תחתונה של %1",
"area-sidebar": "סרגל צד של %1",
"area-content": "תוכן של %1"
}
12 changes: 6 additions & 6 deletions library.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async function renderAdmin(req, res) {
getGroupList(),
]);
res.render('admin/plugins/custom-pages', {
title: 'Custom Pages',
title: '[[custom-pages:custom-pages]]',
pages: pages,
groups: groups,
});
Expand Down Expand Up @@ -135,22 +135,22 @@ plugin.setWidgetAreas = async function (areas) {
if (data.hasOwnProperty(d)) {
areas = areas.concat([
{
name: data[d].name + ' Header',
name: '[[custom-pages:area-header, ' + data[d].name + ']]',
template: data[d].route + '.tpl',
location: 'header',
},
{
name: data[d].name + ' Footer',
name: '[[custom-pages:area-footer, ' + data[d].name + ']]',
template: data[d].route + '.tpl',
location: 'footer',
},
{
name: data[d].name + ' Sidebar',
name: '[[custom-pages:area-sidebar, ' + data[d].name + ']]',
template: data[d].route + '.tpl',
location: 'sidebar',
},
{
name: data[d].name + ' Content',
name: '[[custom-pages:area-content, ' + data[d].name + ']]',
template: data[d].route + '.tpl',
location: 'content',
},
Expand All @@ -164,7 +164,7 @@ plugin.addAdminNavigation = async function (header) {
header.plugins.push({
route: '/plugins/custom-pages',
icon: 'fa-mobile',
name: 'Custom Pages',
name: '[[custom-pages:custom-pages]]',
});
return header;
};
Expand Down
4 changes: 3 additions & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@
"modules": {
"../admin/plugins/custom-pages.js": "static/lib/admin.js"
},
"templates": "./templates"
"templates": "./templates",
"languages": "languages",
"defaultLang": "en_GB"
}
2 changes: 1 addition & 1 deletion static/lib/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ define('admin/plugins/custom-pages', ['alerts'], function (alerts) {
});

socket.emit('admin.settings.saveCustomPages', arr, function () {
alerts.success('Custom pages saved and activated');
alerts.success('[[custom-pages:saved]]');
});
});
};
Expand Down
26 changes: 13 additions & 13 deletions templates/admin/plugins/custom-pages.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="acp-page-container">
<div component="settings/main/header" class="row border-bottom py-2 m-0 sticky-top acp-page-main-header align-items-center">
<div class="col-12 col-md-8 px-0 mb-1 mb-md-0">
<h4 class="fw-bold tracking-tight mb-0">{title}</h4>
<h4 class="fw-bold tracking-tight mb-0">[[custom-pages:custom-pages]]</h4>
</div>
<div class="col-12 col-md-4 px-0 px-md-3 d-flex gap-1">
<button id="add" class="btn btn-light btn-sm fw-semibold ff-secondary w-100 text-center text-nowrap"><i class="fa fa-plus text-primary"></i> [[admin/admin:add]]</button>
Expand All @@ -12,16 +12,16 @@
<div class="row m-0">
<div id="spy-container" class="col-12 px-0 mb-4" tabindex="0">
<p class="lead">
Define and customise your new routes here.
[[custom-pages:intro]]
</p>
<p>
You can add content to your new routes from <a href="{config.relative_path}/admin/extend/widgets">Extend &rarr; Widgets</a>.
[[custom-pages:add-content-info, {config.relative_path}]]
</p>
<p>
You can add your new route to the site navigation from <a href="{config.relative_path}/admin/general/navigation">General &rarr; Navigation</a> and select "Custom Route".
[[custom-pages:navigation-info, {config.relative_path}]]
</p>
<p>
If you wish to set a custom page as your homepage, go to <a href="{config.relative_path}/admin/settings/general#home-page">General &rarr; Homepage</a> and select "Custom".
[[custom-pages:homepage-info, {config.relative_path}]]
</p>

<div id="custom-pages">
Expand All @@ -30,17 +30,17 @@
<form>
<span class="float-end"><i class="fa fa-times pointer"></i></span>
<div class="mb-3">
<label>Page Title
<input type="text" class="form-control" name="name" value="{pages.name}" placeholder="Page Title" />
<label>[[custom-pages:page-title]]
<input type="text" class="form-control" name="name" value="{pages.name}" placeholder="[[custom-pages:page-title]]" />
</label>

<label>Path to Page
<label>[[custom-pages:path-to-page]]
<input type="text" class="form-control" name="route" value="{pages.route}" placeholder="/my-page" />
</label>
</div>

<div>
<label class="form-label">Restrict access to groups (leave blank for public):</label>
<label class="form-label">[[custom-pages:restrict-groups]]</label>
</div>
<input type="text" class="form-control groups-list" name="groups" value="{pages.groups}" placeholder="" />
</form>
Expand All @@ -55,17 +55,17 @@
<form>
<span class="float-end"><i class="fa fa-times pointer"></i></span>
<div class="mb-3">
<label>Page Title
<input type="text" class="form-control" name="name" value="" placeholder="Page Title" />
<label>[[custom-pages:page-title]]
<input type="text" class="form-control" name="name" value="" placeholder="[[custom-pages:page-title]]" />
</label>

<label>Path to Page
<label>[[custom-pages:path-to-page]]
<input type="text" class="form-control" name="route" value="" placeholder="/my-page" />
</label>
</div>

<div>
<label class="form-label">Restrict access to groups (leave blank for public):</label>
<label class="form-label">[[custom-pages:restrict-groups]]</label>
</div>
<input type="text" class="form-control groups-list" name="groups" value="" placeholder="" />
</form>
Expand Down