summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2018-12-16 22:21:16 +0200
committerLauri Ojansivu <x@xet7.org>2018-12-16 22:21:16 +0200
commitf1ed6304a4c3bfcd1c778b0c43cafe6808829286 (patch)
tree5c2ecf6231e906c1dc54b6777b345281d14a9483
parenta42d9871bd420ba0647a590ad2a131822455a905 (diff)
downloadwekan-f1ed6304a4c3bfcd1c778b0c43cafe6808829286.tar.gz
wekan-f1ed6304a4c3bfcd1c778b0c43cafe6808829286.tar.bz2
wekan-f1ed6304a4c3bfcd1c778b0c43cafe6808829286.zip
- Admin Panel / Layout / Custom HTML after <body> start, and Custom HTML before </body> end.
In progress, does not work yet. Thanks to xet7 !
-rw-r--r--client/components/boards/boardBody.jade2
-rw-r--r--client/components/settings/settingBody.jade6
-rw-r--r--client/components/settings/settingBody.js4
-rw-r--r--i18n/en.i18n.json4
-rw-r--r--models/settings.js8
-rw-r--r--server/migrations.js24
-rw-r--r--server/publications/settings.js2
7 files changed, 48 insertions, 2 deletions
diff --git a/client/components/boards/boardBody.jade b/client/components/boards/boardBody.jade
index 9e4b9c61..4631f999 100644
--- a/client/components/boards/boardBody.jade
+++ b/client/components/boards/boardBody.jade
@@ -12,6 +12,7 @@ template(name="board")
+spinner
template(name="boardBody")
+ | {{currentSetting.customHTMLafterBodyStart}}
.board-wrapper(class=currentBoard.colorClass)
+sidebar
.board-canvas.js-swimlanes.js-perfect-scrollbar(
@@ -27,6 +28,7 @@ template(name="boardBody")
+listsGroup
if isViewCalendar
+calendarView
+ | {{currentSetting.customHTMLbeforeBodyEnd}}
template(name="calendarView")
.calendar-view.swimlane
diff --git a/client/components/settings/settingBody.jade b/client/components/settings/settingBody.jade
index bc6e0f50..153649fc 100644
--- a/client/components/settings/settingBody.jade
+++ b/client/components/settings/settingBody.jade
@@ -145,5 +145,11 @@ template(name='layoutSettings')
.title {{_ 'custom-product-name'}}
.form-group
input.form-control#product-name(type="text", placeholder="Wekan" value="{{currentSetting.productName}}")
+ li.layout-form
+ .title {{_ 'add-custom-html-after-body-start'}}
+ textarea#customHTMLafterBodyStart.form-control= currentSetting.customHTMLafterBodyStart
+ li.layout-form
+ .title {{_ 'add-custom-html-before-body-end'}}
+ textarea#customHTMLbeforeBodyEnd.form-control= currentSetting.customHTMLbeforeBodyEnd
li
button.js-save-layout.primary {{_ 'save'}}
diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js
index ba5b4f47..4f07c84c 100644
--- a/client/components/settings/settingBody.js
+++ b/client/components/settings/settingBody.js
@@ -140,6 +140,8 @@ BlazeComponent.extendComponent({
const productName = $('#product-name').val().trim();
const hideLogoChange = ($('input[name=hideLogo]:checked').val() === 'true');
+ const customHTMLafterBodyStart = $('#customHTMLafterBodyStart').val().trim();
+ const customHTMLbeforeBodyEnd = $('#customHTMLbeforeBodyEnd').val().trim();
try {
@@ -147,6 +149,8 @@ BlazeComponent.extendComponent({
$set: {
productName,
hideLogo: hideLogoChange,
+ customHTMLafterBodyStart,
+ customHTMLbeforeBodyEnd,
},
});
} catch (e) {
diff --git a/i18n/en.i18n.json b/i18n/en.i18n.json
index 0c3cc465..5aa04e97 100644
--- a/i18n/en.i18n.json
+++ b/i18n/en.i18n.json
@@ -618,5 +618,7 @@
"authentication-type": "Authentication type",
"custom-product-name": "Custom Product Name",
"layout": "Layout",
- "hide-logo": "Hide Logo"
+ "hide-logo": "Hide Logo",
+ "add-custom-html-after-body-start": "Add Custom HTML after <body> start",
+ "add-custom-html-before-body-end": "Add Custom HTML before </body> end"
}
diff --git a/models/settings.js b/models/settings.js
index 5db57cd8..bfd844b0 100644
--- a/models/settings.js
+++ b/models/settings.js
@@ -32,6 +32,14 @@ Settings.attachSchema(new SimpleSchema({
type: String,
optional: true,
},
+ customHTMLafterBodyStart: {
+ type: String,
+ optional: true,
+ },
+ customHTMLbeforeBodyEnd: {
+ type: String,
+ optional: true,
+ },
hideLogo: {
type: Boolean,
optional: true,
diff --git a/server/migrations.js b/server/migrations.js
index 56d2858d..2512b40c 100644
--- a/server/migrations.js
+++ b/server/migrations.js
@@ -374,3 +374,27 @@ Migrations.add('add-hide-logo', () => {
},
}, noValidateMulti);
});
+
+Migrations.add('add-custom-html-after-body-start', () => {
+ Settings.update({
+ customHTMLafterBodyStart: {
+ $exists: false,
+ },
+ }, {
+ $set: {
+ customHTMLafterBodyStart:'',
+ },
+ }, noValidateMulti);
+});
+
+Migrations.add('add-custom-html-before-body-end', () => {
+ Settings.update({
+ customHTMLbeforeBodyEnd: {
+ $exists: false,
+ },
+ }, {
+ $set: {
+ customHTMLbeforeBodyEnd:'',
+ },
+ }, noValidateMulti);
+});
diff --git a/server/publications/settings.js b/server/publications/settings.js
index d2690439..573a79b4 100644
--- a/server/publications/settings.js
+++ b/server/publications/settings.js
@@ -1,5 +1,5 @@
Meteor.publish('setting', () => {
- return Settings.find({}, {fields:{disableRegistration: 1, productName: 1, hideLogo: 1}});
+ return Settings.find({}, {fields:{disableRegistration: 1, productName: 1, hideLogo: 1, customHTMLafterBodyStart: 1, customHTMLbeforeBodyEnd: 1}});
});
Meteor.publish('mailServer', function () {