Add popup menu and archive action

This commit is contained in:
Andrés Manelli 2018-02-01 14:23:27 -03:00
parent 3414cb84ad
commit 5953fb8a44
7 changed files with 57 additions and 2 deletions

View file

@ -44,6 +44,9 @@ template(name="boardActivities")
if($eq activityType 'archivedList')
| {{_ 'activity-archived' list.title}}.
if($eq activityType 'archivedSwimlane')
| {{_ 'activity-archived' swimlane.title}}.
if($eq activityType 'createBoard')
| {{_ 'activity-created' boardLabel}}.
@ -53,6 +56,9 @@ template(name="boardActivities")
if($eq activityType 'createList')
| {{_ 'activity-added' list.title boardLabel}}.
if($eq activityType 'createSwimlane')
| {{_ 'activity-added' swimlane.title boardLabel}}.
if($eq activityType 'removeList')
| {{_ 'activity-removed' title boardLabel}}.

View file

@ -25,3 +25,14 @@ template(name="archivesSidebar")
= title
else
li.no-items-message {{_ 'no-archived-lists'}}
+tabContent(slug="swimlanes")
ul.archived-lists
each archivedSwimlanes
li.archived-lists-item
if currentUser.isBoardMember
button.js-restore-swimlane
i.fa.fa-undo
= title
else
li.no-items-message {{_ 'no-archived-swimlanes'}}

View file

@ -3,6 +3,7 @@ BlazeComponent.extendComponent({
return [
{ name: TAPi18n.__('cards'), slug: 'cards' },
{ name: TAPi18n.__('lists'), slug: 'lists' },
{ name: TAPi18n.__('swimlanes'), slug: 'swimlanes' },
];
},
@ -20,6 +21,13 @@ BlazeComponent.extendComponent({
});
},
archivedSwimlanes() {
return Swimlanes.find({
archived: true,
boardId: Session.get('currentBoard'),
});
},
cardIsInArchivedList() {
return this.currentData().list().archived;
},
@ -45,6 +53,10 @@ BlazeComponent.extendComponent({
const list = this.currentData();
list.restore();
},
'click .js-restore-swimlane'() {
const swimlane = this.currentData();
swimlane.restore();
},
}];
},
}).register('archivesSidebar');

View file

@ -6,10 +6,18 @@ template(name="swimlaneHeader")
.swimlane-header(
class="{{#if currentUser.isBoardMember}}js-open-inlined-form is-editable{{/if}}")
= title
.swimlane-header-menu
unless currentUser.isCommentOnly
a.fa.fa-navicon.js-open-swimlane-menu
template(name="editSwimlaneTitleForm")
.list-composer
input.list-name-input.full-line(type="text" value=title autofocus)
.edit-controls.clearfix
button.primary.confirm(type="submit") {{_ 'save'}}
a.fa.fa-times-thin.js-close-inlined-form
template(name="swimlaneActionPopup")
unless currentUser.isCommentOnly
ul.pop-over-list
li: a.js-close-swimlane {{_ 'archive-swimlane'}}

View file

@ -10,7 +10,16 @@ BlazeComponent.extendComponent({
events() {
return [{
'click .js-open-swimlane-menu': Popup.open('swimlaneAction'),
submit: this.editTitle,
}];
},
}).register('swimlaneHeader');
Template.swimlaneActionPopup.events({
'click .js-close-swimlane' (evt) {
evt.preventDefault();
this.archive();
Popup.close();
},
});

View file

@ -2,7 +2,7 @@
.swimlane-header-wrap
display: flex;
flex-direction: column;
flex-direction: row;
flex: 0 0 50px;
.swimlane-header
@ -18,3 +18,7 @@
text-overflow: ellipsis;
word-wrap: break-word;
text-align: center;
.swimlane-header-menu
position: absolute
padding: 20px 20px

View file

@ -12,6 +12,7 @@
"act-archivedBoard": "archived __board__",
"act-archivedCard": "archived __card__",
"act-archivedList": "archived __list__",
"act-archivedSwimlane": "archived __swimlane__",
"act-importBoard": "imported __board__",
"act-importCard": "imported __card__",
"act-importList": "imported __list__",
@ -68,6 +69,7 @@
"archive-board": "Archive Board",
"archive-card": "Archive Card",
"archive-list": "Archive List",
"archive-swimlane": "Archive Swimlane",
"archive-selection": "Archive selection",
"archiveBoardPopup-title": "Archive Board?",
"archived-items": "Archived Items",
@ -263,12 +265,14 @@
"list-move-cards": "Move all cards in this list",
"list-select-cards": "Select all cards in this list",
"listActionPopup-title": "List Actions",
"swimlaneActionPopup-title": "Swimlane Actions",
"listImportCardPopup-title": "Import a Trello card",
"listMorePopup-title": "More",
"link-list": "Link to this list",
"list-delete-pop": "All actions will be removed from the activity feed and you won't be able to recover the list. There is no undo.",
"list-delete-suggest-archive": "You can archive a list to remove it from the board and preserve the activity.",
"lists": "Lists",
"swimlanes": "Swimlanes",
"log-out": "Log Out",
"log-in": "Log In",
"loginPopup-title": "Log In",
@ -288,6 +292,7 @@
"name": "Name",
"no-archived-cards": "No archived cards.",
"no-archived-lists": "No archived lists.",
"no-archived-swimlanes": "No archived swimlanes.",
"no-results": "No results",
"normal": "Normal",
"normal-desc": "Can view and edit cards. Can't change settings.",