summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-08-07 18:11:34 +0300
committerLauri Ojansivu <x@xet7.org>2019-08-07 18:11:34 +0300
commitf7e0b837d394d55d66d451c34f43fa8afd357e5b (patch)
tree66501aac3b02ea6d83e6ad1a1b13958c5da56522 /client
parent9e60b414388ec8d5dcb64c638077351b2e2c3bed (diff)
downloadwekan-f7e0b837d394d55d66d451c34f43fa8afd357e5b.tar.gz
wekan-f7e0b837d394d55d66d451c34f43fa8afd357e5b.tar.bz2
wekan-f7e0b837d394d55d66d451c34f43fa8afd357e5b.zip
Hide minicard label text: per user checkbox setting at sidebar.
Thanks to xet7 ! Closes #1466, closes #2561
Diffstat (limited to 'client')
-rw-r--r--client/components/cards/minicard.jade9
-rw-r--r--client/components/cards/minicard.js11
-rw-r--r--client/components/sidebar/sidebar.jade5
-rw-r--r--client/components/sidebar/sidebar.js9
4 files changed, 31 insertions, 3 deletions
diff --git a/client/components/cards/minicard.jade b/client/components/cards/minicard.jade
index f714baae..3806ce41 100644
--- a/client/components/cards/minicard.jade
+++ b/client/components/cards/minicard.jade
@@ -8,9 +8,12 @@ template(name="minicard")
if labels
.minicard-labels
each labels
- span.card-label(class="card-label-{{color}}" title=name)
- +viewer
- = name
+ unless hiddenMinicardLabelText
+ span.card-label(class="card-label-{{color}}" title=name)
+ +viewer
+ = name
+ if hiddenMinicardLabelText
+ .minicard-label(class="card-label-{{color}}" title="{{name}}")
.minicard-title
.handle
.fa.fa-arrows
diff --git a/client/components/cards/minicard.js b/client/components/cards/minicard.js
index 0718c629..4c25c11d 100644
--- a/client/components/cards/minicard.js
+++ b/client/components/cards/minicard.js
@@ -16,6 +16,17 @@ BlazeComponent.extendComponent({
Utils.goBoardId(this.data().linkedId);
},
},
+ {
+ 'click .js-toggle-minicard-label-text'() {
+ Meteor.call('toggleMinicardLabelText');
+ },
+ },
];
},
}).register('minicard');
+
+Template.minicard.helpers({
+ hiddenMinicardLabelText() {
+ return Meteor.user().hasHiddenMinicardLabelText();
+ },
+});
diff --git a/client/components/sidebar/sidebar.jade b/client/components/sidebar/sidebar.jade
index 2b869314..2dfe41b3 100644
--- a/client/components/sidebar/sidebar.jade
+++ b/client/components/sidebar/sidebar.jade
@@ -22,6 +22,11 @@ template(name='homeSidebar')
+membersWidget
hr
+labelsWidget
+ ul#cards.label-text-hidden
+ a.flex.js-toggle-minicard-label-text
+ span {{_ 'hide-minicard-label-text'}}
+ b &nbsp;
+ .materialCheckBox(class="{{#if hiddenMinicardLabelText}}is-checked{{/if}}")
hr
unless currentUser.isNoComments
h3
diff --git a/client/components/sidebar/sidebar.js b/client/components/sidebar/sidebar.js
index 8468595a..8b98fd7e 100644
--- a/client/components/sidebar/sidebar.js
+++ b/client/components/sidebar/sidebar.js
@@ -101,6 +101,9 @@ BlazeComponent.extendComponent({
'click .js-hide-sidebar': this.hide,
'click .js-toggle-sidebar': this.toggle,
'click .js-back-home': this.setView,
+ 'click .js-toggle-minicard-label-text'() {
+ Meteor.call('toggleMinicardLabelText');
+ },
'click .js-shortcuts'() {
FlowRouter.go('shortcuts');
},
@@ -111,6 +114,12 @@ BlazeComponent.extendComponent({
Blaze.registerHelper('Sidebar', () => Sidebar);
+Template.homeSidebar.helpers({
+ hiddenMinicardLabelText() {
+ return Meteor.user().hasHiddenMinicardLabelText();
+ },
+});
+
EscapeActions.register(
'sidebarView',
() => {