mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
Optimize for mobile web, show single list per page with navigate bar
This commit is contained in:
parent
162b15c0cd
commit
c31d7455f7
15 changed files with 189 additions and 34 deletions
|
@ -21,12 +21,21 @@ template(name="boardBody")
|
||||||
if showOverlay.get
|
if showOverlay.get
|
||||||
.board-overlay
|
.board-overlay
|
||||||
.lists.js-lists
|
.lists.js-lists
|
||||||
each currentBoard.lists
|
if isMiniScreen
|
||||||
+list(this)
|
if currentList
|
||||||
if currentCardIsInThisList
|
+list(currentList)
|
||||||
+cardDetails(currentCard)
|
else
|
||||||
if canSeeAddList
|
each currentBoard.lists
|
||||||
+addListForm
|
+miniList(this)
|
||||||
|
if currentUser.isBoardMember
|
||||||
|
+addListForm
|
||||||
|
else
|
||||||
|
each currentBoard.lists
|
||||||
|
+list(this)
|
||||||
|
if currentCardIsInThisList
|
||||||
|
+cardDetails(currentCard)
|
||||||
|
if currentUser.isBoardMember
|
||||||
|
+addListForm
|
||||||
|
|
||||||
template(name="addListForm")
|
template(name="addListForm")
|
||||||
.list.js-list.list-composer.js-list-composer
|
.list.js-list.list-composer.js-list-composer
|
||||||
|
|
|
@ -43,3 +43,18 @@ position()
|
||||||
.open-minicard-composer,
|
.open-minicard-composer,
|
||||||
.minicard-wrapper.is-checked
|
.minicard-wrapper.is-checked
|
||||||
display: none
|
display: none
|
||||||
|
|
||||||
|
@media screen and (max-width: 800px)
|
||||||
|
.board-wrapper
|
||||||
|
|
||||||
|
.board-canvas
|
||||||
|
|
||||||
|
.lists
|
||||||
|
align-items: flex-start
|
||||||
|
display: flex
|
||||||
|
flex-direction: column
|
||||||
|
margin: 0
|
||||||
|
padding: 0 40px 0px 0
|
||||||
|
overflow-x: hidden
|
||||||
|
overflow-y: auto
|
||||||
|
position: cover
|
||||||
|
|
|
@ -67,6 +67,9 @@ setBoardColor(color)
|
||||||
background: color
|
background: color
|
||||||
color: white
|
color: white
|
||||||
|
|
||||||
|
&#header ul li.current, &#header-quick-access ul li.current
|
||||||
|
border-bottom: 4px solid lighten(color, 20%)
|
||||||
|
|
||||||
.board-color-nephritis
|
.board-color-nephritis
|
||||||
setBoardColor(#27AE60)
|
setBoardColor(#27AE60)
|
||||||
|
|
||||||
|
|
|
@ -58,10 +58,6 @@ BlazeComponent.extendComponent({
|
||||||
return user && user.hasStarred(boardId);
|
return user && user.hasStarred(boardId);
|
||||||
},
|
},
|
||||||
|
|
||||||
isMiniScreen() {
|
|
||||||
return Utils.isMiniScreen();
|
|
||||||
},
|
|
||||||
|
|
||||||
// Only show the star counter if the number of star is greater than 2
|
// Only show the star counter if the number of star is greater than 2
|
||||||
showStarCounter() {
|
showStarCounter() {
|
||||||
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
||||||
|
|
|
@ -2,3 +2,7 @@ template(name='list')
|
||||||
.list.js-list(id="js-list-{{_id}}")
|
.list.js-list(id="js-list-{{_id}}")
|
||||||
+listHeader
|
+listHeader
|
||||||
+listBody
|
+listBody
|
||||||
|
|
||||||
|
template(name='miniList')
|
||||||
|
a.mini-list.js-select-list.js-list(id="js-list-{{_id}}")
|
||||||
|
+listHeader
|
||||||
|
|
|
@ -114,3 +114,10 @@ BlazeComponent.extendComponent({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
}).register('list');
|
}).register('list');
|
||||||
|
|
||||||
|
Template.miniList.events({
|
||||||
|
'click .js-select-list'() {
|
||||||
|
const listId = this._id;
|
||||||
|
Session.set('currentList', listId);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
|
@ -53,6 +53,9 @@
|
||||||
&.ui-sortable-handle
|
&.ui-sortable-handle
|
||||||
cursor: grab
|
cursor: grab
|
||||||
|
|
||||||
|
.list-header-left-icon
|
||||||
|
display: none
|
||||||
|
|
||||||
.list-header-name
|
.list-header-name
|
||||||
display: inline
|
display: inline
|
||||||
font-size: 16px
|
font-size: 16px
|
||||||
|
@ -135,3 +138,49 @@
|
||||||
|
|
||||||
div
|
div
|
||||||
float: left
|
float: left
|
||||||
|
|
||||||
|
@media screen and (max-width: 800px)
|
||||||
|
.mini-list
|
||||||
|
flex: 0 0 60px
|
||||||
|
height: 60px
|
||||||
|
width: 100%
|
||||||
|
border-left: 0px
|
||||||
|
border-bottom: 1px solid darken(white, 20%)
|
||||||
|
|
||||||
|
.list
|
||||||
|
display: block
|
||||||
|
width: 100%
|
||||||
|
border-left: 0px
|
||||||
|
|
||||||
|
&.ui-sortable-helper
|
||||||
|
flex: 0 0 60px
|
||||||
|
height: 60px
|
||||||
|
width: 100%
|
||||||
|
border-left: 0px
|
||||||
|
border-bottom: 1px solid darken(white, 20%)
|
||||||
|
|
||||||
|
.list-header.ui-sortable-handle
|
||||||
|
cursor: grabbing
|
||||||
|
|
||||||
|
&.placeholder
|
||||||
|
flex: 0 0 60px
|
||||||
|
height: 60px
|
||||||
|
width: 100%
|
||||||
|
border-left: 0px
|
||||||
|
border-bottom: 1px solid darken(white, 20%)
|
||||||
|
|
||||||
|
.list-header
|
||||||
|
|
||||||
|
.list-header-left-icon
|
||||||
|
display: inline
|
||||||
|
padding: 7px
|
||||||
|
padding-right: 27px
|
||||||
|
margin-top: 1px
|
||||||
|
top: -@padding
|
||||||
|
left: -@padding
|
||||||
|
|
||||||
|
.list-header-menu-icon
|
||||||
|
position: absolute
|
||||||
|
padding: 7px
|
||||||
|
top: -@padding
|
||||||
|
right: 17px
|
||||||
|
|
|
@ -3,19 +3,33 @@ template(name="listHeader")
|
||||||
+inlinedForm
|
+inlinedForm
|
||||||
+editListTitleForm
|
+editListTitleForm
|
||||||
else
|
else
|
||||||
|
if isMiniScreen
|
||||||
|
if currentList
|
||||||
|
a.list-header-left-icon.fa.fa-angle-left.js-unselect-list
|
||||||
h2.list-header-name(
|
h2.list-header-name(
|
||||||
class="{{#if currentUser.isBoardMember}}js-open-inlined-form is-editable{{/if}}")
|
class="{{#if currentUser.isBoardMember}}js-open-inlined-form is-editable{{/if}}")
|
||||||
= title
|
= title
|
||||||
if wipLimit.enabled
|
if wipLimit.enabled
|
||||||
| (
|
| (
|
||||||
span(class="{{#if reachedWipLimit}}highlight{{/if}}") {{cards.count}}
|
span(class="{{#if reachedWipLimit}}highlight{{/if}}") {{cards.count}}
|
||||||
|/#{wipLimit.value})
|
|/#{wipLimit.value})
|
||||||
|
|
||||||
if showCardsCountForList cards.count
|
if showCardsCountForList cards.count
|
||||||
= cards.count
|
= cards.count
|
||||||
span.lowercase
|
span.lowercase
|
||||||
| {{_ 'cards'}}
|
| {{_ 'cards'}}
|
||||||
if currentUser.isBoardMember
|
if isMiniScreen
|
||||||
|
if currentList
|
||||||
|
if isWatching
|
||||||
|
i.list-header-watch-icon.fa.fa-eye
|
||||||
|
div.list-header-menu
|
||||||
|
unless currentUser.isCommentOnly
|
||||||
|
if canSeeAddCard
|
||||||
|
a.js-add-card.fa.fa-plus.list-header-plus-icon
|
||||||
|
a.fa.fa-navicon.js-open-list-menu
|
||||||
|
else
|
||||||
|
a.list-header-menu-icon.fa.fa-angle-right.js-select-list
|
||||||
|
else if currentUser.isBoardMember
|
||||||
if isWatching
|
if isWatching
|
||||||
i.list-header-watch-icon.fa.fa-eye
|
i.list-header-watch-icon.fa.fa-eye
|
||||||
div.list-header-menu
|
div.list-header-menu
|
||||||
|
@ -80,8 +94,8 @@ template(name="setWipLimitPopup")
|
||||||
#js-wip-limit-edit
|
#js-wip-limit-edit
|
||||||
label {{_ 'set-wip-limit-value'}}
|
label {{_ 'set-wip-limit-value'}}
|
||||||
ul.pop-over-list
|
ul.pop-over-list
|
||||||
li: a.js-enable-wip-limit {{_ 'enable-wip-limit'}}
|
li: a.js-enable-wip-limit {{_ 'enable-wip-limit'}}
|
||||||
if isWipLimitEnabled
|
if isWipLimitEnabled
|
||||||
i.fa.fa-check
|
i.fa.fa-check
|
||||||
if isWipLimitEnabled
|
if isWipLimitEnabled
|
||||||
p
|
p
|
||||||
|
@ -92,7 +106,7 @@ template(name="setWipLimitPopup")
|
||||||
.soft-wip-limit
|
.soft-wip-limit
|
||||||
.materialCheckBox(class="{{#if isWipLimitSoft}}is-checked{{/if}}")
|
.materialCheckBox(class="{{#if isWipLimitSoft}}is-checked{{/if}}")
|
||||||
label {{_ 'soft-wip-limit'}}
|
label {{_ 'soft-wip-limit'}}
|
||||||
|
|
||||||
template(name="wipLimitErrorPopup")
|
template(name="wipLimitErrorPopup")
|
||||||
.wip-limit-invalid
|
.wip-limit-invalid
|
||||||
p {{_ 'wipLimitErrorPopup-dialog-pt1'}}
|
p {{_ 'wipLimitErrorPopup-dialog-pt1'}}
|
||||||
|
|
|
@ -41,6 +41,9 @@ BlazeComponent.extendComponent({
|
||||||
position: 'top',
|
position: 'top',
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
'click .js-unselect-list'() {
|
||||||
|
Session.set('currentList', null);
|
||||||
|
},
|
||||||
submit: this.editTitle,
|
submit: this.editTitle,
|
||||||
}];
|
}];
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,19 +7,31 @@ template(name="header")
|
||||||
unless isSandstorm
|
unless isSandstorm
|
||||||
if currentUser
|
if currentUser
|
||||||
#header-quick-access(class=currentBoard.colorClass)
|
#header-quick-access(class=currentBoard.colorClass)
|
||||||
ul
|
if isMiniScreen
|
||||||
li
|
ul
|
||||||
a(href="{{pathFor 'home'}}")
|
li
|
||||||
span.fa.fa-home
|
a(href="{{pathFor 'home'}}")
|
||||||
| {{_ 'all-boards'}}
|
span.fa.fa-home
|
||||||
each currentUser.starredBoards
|
|
||||||
li.separator -
|
|
||||||
li(class="{{#if $.Session.equals 'currentBoard' _id}}current{{/if}}")
|
|
||||||
a(href="{{pathFor 'board' id=_id slug=slug}}")
|
|
||||||
= title
|
|
||||||
else
|
|
||||||
li.current {{_ 'quick-access-description'}}
|
|
||||||
|
|
||||||
|
if currentList
|
||||||
|
each currentBoard.lists
|
||||||
|
li(class="{{#if $.Session.equals 'currentList' _id}}current{{/if}}")
|
||||||
|
a.js-select-list
|
||||||
|
= title
|
||||||
|
#header-new-board-icon
|
||||||
|
else
|
||||||
|
ul
|
||||||
|
li
|
||||||
|
a(href="{{pathFor 'home'}}")
|
||||||
|
span.fa.fa-home
|
||||||
|
| {{_ 'all-boards'}}
|
||||||
|
each currentUser.starredBoards
|
||||||
|
li.separator -
|
||||||
|
li(class="{{#if $.Session.equals 'currentBoard' _id}}current{{/if}}")
|
||||||
|
a(href="{{pathFor 'board' id=_id slug=slug}}")
|
||||||
|
= title
|
||||||
|
else
|
||||||
|
li.current {{_ 'quick-access-description'}}
|
||||||
|
|
||||||
a#header-new-board-icon.js-create-board
|
a#header-new-board-icon.js-create-board
|
||||||
i.fa.fa-plus(title="Create a new board")
|
i.fa.fa-plus(title="Create a new board")
|
||||||
|
|
|
@ -28,4 +28,8 @@ Template.header.events({
|
||||||
'click .js-close-announcement'() {
|
'click .js-close-announcement'() {
|
||||||
$('.announcement').hide();
|
$('.announcement').hide();
|
||||||
},
|
},
|
||||||
|
'click .js-select-list'() {
|
||||||
|
Session.set('currentList', this._id);
|
||||||
|
Session.set('currentCard', null);
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -191,11 +191,33 @@
|
||||||
bottom: 0px
|
bottom: 0px
|
||||||
|
|
||||||
ul
|
ul
|
||||||
width: calc(100% - 150px)
|
width: calc(100% - 60px)
|
||||||
overflow: ellipsis
|
overflow: ellipsis
|
||||||
|
padding: 10px
|
||||||
|
margin: -10px
|
||||||
|
|
||||||
li
|
li
|
||||||
height: 28px
|
height: 100%
|
||||||
|
padding: 12px 0px
|
||||||
|
margin: -10px 0px
|
||||||
|
|
||||||
|
a
|
||||||
|
height: 100%
|
||||||
|
padding: 12px 10px
|
||||||
|
margin: -10px 0px
|
||||||
|
|
||||||
|
.fa-home
|
||||||
|
font-size: 26px
|
||||||
|
margin-top: -2px
|
||||||
|
|
||||||
|
#header-new-board-icon
|
||||||
|
display: none
|
||||||
|
|
||||||
|
#header-user-bar
|
||||||
|
position: absolute
|
||||||
|
right: 0px
|
||||||
|
padding: 10px
|
||||||
|
margin: -10px
|
||||||
|
|
||||||
.announcement,
|
.announcement,
|
||||||
.offline-warning
|
.offline-warning
|
||||||
|
|
|
@ -3,10 +3,11 @@ template(name="headerUserBar")
|
||||||
a.header-user-bar-name.js-open-header-member-menu
|
a.header-user-bar-name.js-open-header-member-menu
|
||||||
.header-user-bar-avatar
|
.header-user-bar-avatar
|
||||||
+userAvatar(userId=currentUser._id)
|
+userAvatar(userId=currentUser._id)
|
||||||
if currentUser.profile.fullname
|
unless isMiniScreen
|
||||||
= currentUser.profile.fullname
|
if currentUser.profile.fullname
|
||||||
else
|
= currentUser.profile.fullname
|
||||||
= currentUser.username
|
else
|
||||||
|
= currentUser.username
|
||||||
|
|
||||||
template(name="memberMenuPopup")
|
template(name="memberMenuPopup")
|
||||||
ul.pop-over-list
|
ul.pop-over-list
|
||||||
|
|
|
@ -16,6 +16,17 @@ Blaze.registerHelper('currentCard', () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Blaze.registerHelper('currentList', () => {
|
||||||
|
const listId = Session.get('currentList');
|
||||||
|
if (listId) {
|
||||||
|
return Lists.findOne(listId);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Blaze.registerHelper('getUser', (userId) => Users.findOne(userId));
|
Blaze.registerHelper('getUser', (userId) => Users.findOne(userId));
|
||||||
|
|
||||||
Blaze.registerHelper('concat', (...args) => args.slice(0, -1).join(''));
|
Blaze.registerHelper('concat', (...args) => args.slice(0, -1).join(''));
|
||||||
|
|
||||||
|
Blaze.registerHelper('isMiniScreen', () => Utils.isMiniScreen());
|
||||||
|
|
|
@ -8,6 +8,7 @@ FlowRouter.route('/', {
|
||||||
triggersEnter: [AccountsTemplates.ensureSignedIn],
|
triggersEnter: [AccountsTemplates.ensureSignedIn],
|
||||||
action() {
|
action() {
|
||||||
Session.set('currentBoard', null);
|
Session.set('currentBoard', null);
|
||||||
|
Session.set('currentList', null);
|
||||||
Session.set('currentCard', null);
|
Session.set('currentCard', null);
|
||||||
|
|
||||||
Filter.reset();
|
Filter.reset();
|
||||||
|
@ -88,6 +89,7 @@ FlowRouter.route('/import/:source', {
|
||||||
Session.set('fromBoard', Session.get('currentBoard'));
|
Session.set('fromBoard', Session.get('currentBoard'));
|
||||||
}
|
}
|
||||||
Session.set('currentBoard', null);
|
Session.set('currentBoard', null);
|
||||||
|
Session.set('currentList', null);
|
||||||
Session.set('currentCard', null);
|
Session.set('currentCard', null);
|
||||||
Session.set('importSource', params.source);
|
Session.set('importSource', params.source);
|
||||||
|
|
||||||
|
@ -106,6 +108,7 @@ FlowRouter.route('/setting', {
|
||||||
AccountsTemplates.ensureSignedIn,
|
AccountsTemplates.ensureSignedIn,
|
||||||
() => {
|
() => {
|
||||||
Session.set('currentBoard', null);
|
Session.set('currentBoard', null);
|
||||||
|
Session.set('currentList', null);
|
||||||
Session.set('currentCard', null);
|
Session.set('currentCard', null);
|
||||||
|
|
||||||
Filter.reset();
|
Filter.reset();
|
||||||
|
@ -126,6 +129,7 @@ FlowRouter.route('/information', {
|
||||||
AccountsTemplates.ensureSignedIn,
|
AccountsTemplates.ensureSignedIn,
|
||||||
() => {
|
() => {
|
||||||
Session.set('currentBoard', null);
|
Session.set('currentBoard', null);
|
||||||
|
Session.set('currentList', null);
|
||||||
Session.set('currentCard', null);
|
Session.set('currentCard', null);
|
||||||
|
|
||||||
Filter.reset();
|
Filter.reset();
|
||||||
|
@ -146,6 +150,7 @@ FlowRouter.route('/people', {
|
||||||
AccountsTemplates.ensureSignedIn,
|
AccountsTemplates.ensureSignedIn,
|
||||||
() => {
|
() => {
|
||||||
Session.set('currentBoard', null);
|
Session.set('currentBoard', null);
|
||||||
|
Session.set('currentList', null);
|
||||||
Session.set('currentCard', null);
|
Session.set('currentCard', null);
|
||||||
|
|
||||||
Filter.reset();
|
Filter.reset();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue