swimlane-view: have the swimlane header horizontal

This allows to use the header as a separator between swimlanes.

This will be most useful when we can set the background color of these
headers.
This commit is contained in:
Benjamin Tissoires 2019-01-24 12:09:23 +01:00
parent 5fa0821e07
commit dd88eb4cc1
5 changed files with 33 additions and 61 deletions

View file

@ -23,6 +23,8 @@ template(name="boardBody")
if isViewSwimlanes if isViewSwimlanes
each currentBoard.swimlanes each currentBoard.swimlanes
+swimlane(this) +swimlane(this)
if currentUser.isBoardMember
+addSwimlaneForm
if isViewLists if isViewLists
+listsGroup +listsGroup
if isViewCalendar if isViewCalendar

View file

@ -10,7 +10,6 @@
// transparent, because that won't work during a list drag. // transparent, because that won't work during a list drag.
background: darken(white, 13%) background: darken(white, 13%)
border-left: 1px solid darken(white, 20%) border-left: 1px solid darken(white, 20%)
border-bottom: 1px solid #CCC
padding: 0 padding: 0
float: left float: left

View file

@ -1,21 +1,22 @@
template(name="swimlane") template(name="swimlane")
.swimlane.js-lists.js-swimlane .swimlane.js-lists.js-swimlane
+swimlaneHeader +swimlaneHeader
if isMiniScreen .swimlane.list-group.js-lists
if currentList if isMiniScreen
+list(currentList) if currentList
+list(currentList)
else
each currentBoard.lists
+miniList(this)
if currentUser.isBoardMember
+addListForm
else else
each currentBoard.lists each currentBoard.lists
+miniList(this) +list(this)
if currentCardIsInThisList _id ../_id
+cardDetails(currentCard)
if currentUser.isBoardMember if currentUser.isBoardMember
+addListForm +addListForm
else
each currentBoard.lists
+list(this)
if currentCardIsInThisList _id ../_id
+cardDetails(currentCard)
if currentUser.isBoardMember
+addListAndSwimlaneForm
template(name="listsGroup") template(name="listsGroup")
.swimlane.list-group.js-lists .swimlane.list-group.js-lists
@ -35,19 +36,8 @@ template(name="listsGroup")
if currentUser.isBoardMember if currentUser.isBoardMember
+addListForm +addListForm
template(name="addListAndSwimlaneForm") template(name="addSwimlaneForm")
.list.list-composer.js-list-composer .list.list-composer.js-list-composer
.list-header
+inlinedForm(autoclose=false)
input.list-name-input.full-line(type="text" placeholder="{{_ 'add-list'}}"
autocomplete="off" autofocus)
.edit-controls.clearfix
button.primary.confirm(type="submit") {{_ 'save'}}
a.fa.fa-times-thin.js-close-inlined-form
else
a.open-list-composer.js-open-inlined-form
i.fa.fa-plus
| {{_ 'add-list'}}
.list-header .list-header
+inlinedForm(autoclose=false) +inlinedForm(autoclose=false)
input.swimlane-name-input.full-line(type="text" placeholder="{{_ 'add-swimlane'}}" input.swimlane-name-input.full-line(type="text" placeholder="{{_ 'add-swimlane'}}"

View file

@ -185,37 +185,22 @@ BlazeComponent.extendComponent({
return [{ return [{
submit(evt) { submit(evt) {
evt.preventDefault(); evt.preventDefault();
let titleInput = this.find('.list-name-input'); let titleInput = this.find('.swimlane-name-input');
if (titleInput) { const title = titleInput.value.trim();
const title = titleInput.value.trim(); if (title) {
if (title) { Swimlanes.insert({
Lists.insert({ title,
title, boardId: Session.get('currentBoard'),
boardId: Session.get('currentBoard'), sort: $('.swimlane').length,
sort: $('.list').length, });
});
titleInput.value = ''; titleInput.value = '';
titleInput.focus(); titleInput.focus();
}
} else {
titleInput = this.find('.swimlane-name-input');
const title = titleInput.value.trim();
if (title) {
Swimlanes.insert({
title,
boardId: Session.get('currentBoard'),
sort: $('.swimlane').length,
});
titleInput.value = '';
titleInput.focus();
}
} }
}, },
}]; }];
}, },
}).register('addListAndSwimlaneForm'); }).register('addSwimlaneForm');
Template.swimlane.helpers({ Template.swimlane.helpers({
canSeeAddList() { canSeeAddList() {

View file

@ -5,7 +5,7 @@
// transparent, because that won't work during a swimlane drag. // transparent, because that won't work during a swimlane drag.
background: darken(white, 13%) background: darken(white, 13%)
display: flex display: flex
flex-direction: row flex-direction: column
overflow: 0; overflow: 0;
max-height: 100% max-height: 100%
@ -27,20 +27,15 @@
.swimlane-header-wrap .swimlane-header-wrap
display: flex; display: flex;
flex-direction: row; flex-direction: row;
flex: 0 0 50px; flex: 0 0 24px;
padding-bottom: 30px; background-color: #ccc;
border-bottom: 1px solid #CCC
.swimlane-header .swimlane-header
-ms-writing-mode: tb-rl;
writing-mode: vertical-rl;
transform: rotate(180deg);
font-size: 14px; font-size: 14px;
line-height: 50px; padding: 5px 5px
margin-top: 50px;
font-weight: bold; font-weight: bold;
min-height: 9px; min-height: 9px;
width: 50px; width: 100%;
overflow: hidden; overflow: hidden;
-o-text-overflow: ellipsis; -o-text-overflow: ellipsis;
text-overflow: ellipsis; text-overflow: ellipsis;
@ -49,7 +44,8 @@
.swimlane-header-menu .swimlane-header-menu
position: absolute position: absolute
padding: 20px 20px padding: 5px 5px
.list-group .list-group
flex-direction: row
height: 100% height: 100%