summaryrefslogtreecommitdiffstats
path: root/client/components
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2018-11-20 02:38:00 +0200
committerLauri Ojansivu <x@xet7.org>2018-11-20 02:38:00 +0200
commitdd6ba152a0b38950f82ec98fbe51fb746c402615 (patch)
tree694988c0e8c06d0c423d41a02b282c7ccc6f51a9 /client/components
parentcb9ced756fb9fd0f731fe194d732f21bcb156578 (diff)
downloadwekan-dd6ba152a0b38950f82ec98fbe51fb746c402615.tar.gz
wekan-dd6ba152a0b38950f82ec98fbe51fb746c402615.tar.bz2
wekan-dd6ba152a0b38950f82ec98fbe51fb746c402615.zip
Admin Panel / Layout: Hide Logo: Yes / No. This does hide Wekan logo on Login page and Board page. Thanks to xet7.
Diffstat (limited to 'client/components')
-rw-r--r--client/components/main/header.jade6
-rw-r--r--client/components/main/header.js5
-rw-r--r--client/components/main/layouts.jade9
-rw-r--r--client/components/main/layouts.js11
-rw-r--r--client/components/settings/settingBody.jade8
-rw-r--r--client/components/settings/settingBody.js10
6 files changed, 43 insertions, 6 deletions
diff --git a/client/components/main/header.jade b/client/components/main/header.jade
index 2751c0cc..e21ce096 100644
--- a/client/components/main/header.jade
+++ b/client/components/main/header.jade
@@ -47,6 +47,7 @@ template(name="header")
+Template.dynamic(template=headerBar)
unless hideLogo
+
//-
On sandstorm, the logo shouldn't be clickable, because we only have one
page/document on it, and we don't want to see the home page containing
@@ -55,8 +56,9 @@ template(name="header")
.wekan-logo
img(src="{{pathFor '/wekan-logo-header.png'}}" alt="Wekan")
else
- a.wekan-logo(href="{{pathFor 'home'}}" title="{{_ 'header-logo-title'}}")
- img(src="{{pathFor '/wekan-logo-header.png'}}" alt="Wekan")
+ unless currentSetting.hideLogo
+ a.wekan-logo(href="{{pathFor 'home'}}" title="{{_ 'header-logo-title'}}")
+ img(src="{{pathFor '/wekan-logo-header.png'}}" alt="Wekan")
if appIsOffline
+offlineWarning
diff --git a/client/components/main/header.js b/client/components/main/header.js
index 7fbc5716..c05b1c3c 100644
--- a/client/components/main/header.js
+++ b/client/components/main/header.js
@@ -1,11 +1,16 @@
Meteor.subscribe('user-admin');
Meteor.subscribe('boards');
+Meteor.subscribe('setting');
Template.header.helpers({
wrappedHeader() {
return !Session.get('currentBoard');
},
+ currentSetting() {
+ return Settings.findOne();
+ },
+
hideLogo() {
return Utils.isMiniScreen() && Session.get('currentBoard');
},
diff --git a/client/components/main/layouts.jade b/client/components/main/layouts.jade
index 68876dc5..e434eaba 100644
--- a/client/components/main/layouts.jade
+++ b/client/components/main/layouts.jade
@@ -14,8 +14,13 @@ head
template(name="userFormsLayout")
section.auth-layout
- h1.at-form-landing-logo
- img(src="{{pathFor '/wekan-logo.png'}}" alt="Wekan")
+ unless currentSetting.hideLogo
+ h1.at-form-landing-logo
+ img(src="{{pathFor '/wekan-logo.png'}}" alt="Wekan")
+ if currentSetting.hideLogo
+ h1
+ br
+ br
section.auth-dialog
+Template.dynamic(template=content)
+connectionMethod
diff --git a/client/components/main/layouts.js b/client/components/main/layouts.js
index 393f890b..d4a9d6d1 100644
--- a/client/components/main/layouts.js
+++ b/client/components/main/layouts.js
@@ -20,7 +20,13 @@ const validator = {
},
};
+Template.userFormsLayout.onCreated(() => {
+ Meteor.subscribe('setting');
+
+});
+
Template.userFormsLayout.onRendered(() => {
+
AccountsTemplates.state.form.keys = new Proxy(AccountsTemplates.state.form.keys, validator);
const i18nTag = navigator.language;
@@ -31,6 +37,11 @@ Template.userFormsLayout.onRendered(() => {
});
Template.userFormsLayout.helpers({
+
+ currentSetting() {
+ return Settings.findOne();
+ },
+
languages() {
return _.map(TAPi18n.getLanguages(), (lang, code) => {
const tag = code;
diff --git a/client/components/settings/settingBody.jade b/client/components/settings/settingBody.jade
index a05be1c6..bc6e0f50 100644
--- a/client/components/settings/settingBody.jade
+++ b/client/components/settings/settingBody.jade
@@ -135,9 +135,15 @@ template(name='announcementSettings')
template(name='layoutSettings')
ul#layout-setting.setting-detail
li.layout-form
+ .title {{_ 'hide-logo'}}
+ .form-group.flex
+ input.form-control#hide-logo(type="radio" name="hideLogo" value="true" checked="{{#if currentSetting.hideLogo}}checked{{/if}}")
+ span {{_ 'yes'}}
+ input.form-control#hide-logo(type="radio" name="hideLogo" value="false" checked="{{#unless currentSetting.hideLogo}}checked{{/unless}}")
+ span {{_ 'no'}}
+ li.layout-form
.title {{_ 'custom-product-name'}}
.form-group
input.form-control#product-name(type="text", placeholder="Wekan" value="{{currentSetting.productName}}")
-
li
button.js-save-layout.primary {{_ 'save'}}
diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js
index 4ad65400..5bebc8d0 100644
--- a/client/components/settings/settingBody.js
+++ b/client/components/settings/settingBody.js
@@ -59,6 +59,9 @@ BlazeComponent.extendComponent({
toggleTLS() {
$('#mail-server-tls').toggleClass('is-checked');
},
+ toggleHideLogo() {
+ $('#hide-logo').toggleClass('is-checked');
+ },
switchMenu(event) {
const target = $(event.target);
if (!target.hasClass('active')) {
@@ -135,11 +138,15 @@ BlazeComponent.extendComponent({
this.setLoading(true);
$('li').removeClass('has-error');
+ const productName = $('#product-name').val().trim();
+ const hideLogoChange = ($('input[name=hideLogo]:checked').val() === 'true');
+
try {
- const productName = $('#product-name').val().trim();
+
Settings.update(Settings.findOne()._id, {
$set: {
productName,
+ hideLogo: hideLogoChange,
},
});
} catch (e) {
@@ -175,6 +182,7 @@ BlazeComponent.extendComponent({
'click button.js-email-invite': this.inviteThroughEmail,
'click button.js-save': this.saveMailServerInfo,
'click button.js-send-smtp-test-email': this.sendSMTPTestEmail,
+ 'click a.js-toggle-hide-logo': this.toggleHideLogo,
'click button.js-save-layout': this.saveLayout,
}];
},