mirror of
https://github.com/wekan/wekan.git
synced 2026-02-23 16:34:06 +01:00
add listWidths to user profile
This commit is contained in:
parent
f33ea5baf0
commit
f2e4a280d7
6 changed files with 114 additions and 15 deletions
|
|
@ -179,6 +179,9 @@
|
|||
#js-wip-limit-edit div {
|
||||
float: left;
|
||||
}
|
||||
#js-list-width-edit .list-width-error {
|
||||
display: none;
|
||||
}
|
||||
@media screen and (max-width: 800px) {
|
||||
.mini-list {
|
||||
flex: 0 0 60px;
|
||||
|
|
|
|||
|
|
@ -62,6 +62,11 @@ template(name="listActionPopup")
|
|||
i.fa.fa-arrow-down
|
||||
| {{_ 'add-card-to-bottom-of-list'}}
|
||||
hr
|
||||
ul.pop-over-list
|
||||
li
|
||||
a.js-set-list-width
|
||||
i.fa.fa-arrows-h
|
||||
| {{_ 'set-list-width'}}
|
||||
ul.pop-over-list
|
||||
li
|
||||
a.js-toggle-watch-list
|
||||
|
|
@ -156,6 +161,19 @@ template(name="wipLimitErrorPopup")
|
|||
p {{_ 'wipLimitErrorPopup-dialog-pt2'}}
|
||||
button.full.js-back-view(type="submit") {{_ 'cancel'}}
|
||||
|
||||
template(name="setListWidthPopup")
|
||||
#js-list-width-edit
|
||||
label {{_ 'set-list-width-value'}}
|
||||
p
|
||||
input.list-width-value(type="number" value="{{ listWidthValue }}" min="100" max="800")
|
||||
input.list-width-apply(type="submit" value="{{_ 'apply'}}")
|
||||
input.list-width-error
|
||||
|
||||
template(name="listWidthErrorPopup")
|
||||
.list-width-invalid
|
||||
p {{_ 'list-width-error-message'}}
|
||||
button.full.js-back-view(type="submit") {{_ 'cancel'}}
|
||||
|
||||
template(name="setListColorPopup")
|
||||
form.edit-label
|
||||
.palette-colors: each colors
|
||||
|
|
|
|||
|
|
@ -151,6 +151,7 @@ Template.listActionPopup.events({
|
|||
});
|
||||
Popup.back();
|
||||
},
|
||||
'click .js-set-list-width': Popup.open('setListWidth'),
|
||||
'click .js-set-color-list': Popup.open('setListColor'),
|
||||
'click .js-select-cards'() {
|
||||
const cardIds = this.allCards().map(card => card._id);
|
||||
|
|
@ -319,3 +320,41 @@ BlazeComponent.extendComponent({
|
|||
];
|
||||
},
|
||||
}).register('setListColorPopup');
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
applyListWidth() {
|
||||
const list = Template.currentData();
|
||||
const board = list.boardId;
|
||||
const width = parseInt(
|
||||
Template.instance()
|
||||
.$('.list-width-value')
|
||||
.val(),
|
||||
10,
|
||||
);
|
||||
|
||||
// FIXME(mark-i-m): where do we put constants?
|
||||
if (width < 100 || !width) {
|
||||
Template.instance()
|
||||
.$('.list-width-error')
|
||||
.click();
|
||||
} else {
|
||||
Meteor.call('applyListWidth', board, list._id, width);
|
||||
Popup.back();
|
||||
}
|
||||
},
|
||||
|
||||
listWidthValue() {
|
||||
const list = Template.currentData();
|
||||
const board = list.boardId;
|
||||
return Meteor.user().getListWidth(board, list._id);
|
||||
},
|
||||
|
||||
events() {
|
||||
return [
|
||||
{
|
||||
'click .list-width-apply': this.applyListWidth,
|
||||
'click .list-width-error': Popup.open('listWidthError'),
|
||||
},
|
||||
];
|
||||
},
|
||||
}).register('setListWidthPopup');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue