summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrés Manelli <andresmanelli@gmail.com>2018-02-01 13:10:30 -0300
committerAndrés Manelli <andresmanelli@gmail.com>2018-02-01 14:24:21 -0300
commit3414cb84ad8ac800e23bbda6ce12822f40d1bd19 (patch)
tree955615a45ed3bcc7577cac6ee05caa57a3183f7a
parent42bc905c16d1c01cbf24f773d2d5224ccdbeba78 (diff)
downloadwekan-3414cb84ad8ac800e23bbda6ce12822f40d1bd19.tar.gz
wekan-3414cb84ad8ac800e23bbda6ce12822f40d1bd19.tar.bz2
wekan-3414cb84ad8ac800e23bbda6ce12822f40d1bd19.zip
Add ability to edit swimlane name
-rw-r--r--client/components/swimlanes/swimlaneHeader.jade15
-rw-r--r--client/components/swimlanes/swimlaneHeader.js16
-rw-r--r--client/components/swimlanes/swimlanes.jade5
3 files changed, 32 insertions, 4 deletions
diff --git a/client/components/swimlanes/swimlaneHeader.jade b/client/components/swimlanes/swimlaneHeader.jade
new file mode 100644
index 00000000..17eb3ea4
--- /dev/null
+++ b/client/components/swimlanes/swimlaneHeader.jade
@@ -0,0 +1,15 @@
+template(name="swimlaneHeader")
+ .swimlane-header-wrap
+ +inlinedForm
+ +editSwimlaneTitleForm
+ else
+ .swimlane-header(
+ class="{{#if currentUser.isBoardMember}}js-open-inlined-form is-editable{{/if}}")
+ = title
+
+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
diff --git a/client/components/swimlanes/swimlaneHeader.js b/client/components/swimlanes/swimlaneHeader.js
new file mode 100644
index 00000000..b3f93536
--- /dev/null
+++ b/client/components/swimlanes/swimlaneHeader.js
@@ -0,0 +1,16 @@
+BlazeComponent.extendComponent({
+ editTitle(evt) {
+ evt.preventDefault();
+ const newTitle = this.childComponents('inlinedForm')[0].getValue().trim();
+ const swimlane = this.currentData();
+ if (newTitle) {
+ swimlane.rename(newTitle.trim());
+ }
+ },
+
+ events() {
+ return [{
+ submit: this.editTitle,
+ }];
+ },
+}).register('swimlaneHeader');
diff --git a/client/components/swimlanes/swimlanes.jade b/client/components/swimlanes/swimlanes.jade
index 765f6d49..6fc24d4c 100644
--- a/client/components/swimlanes/swimlanes.jade
+++ b/client/components/swimlanes/swimlanes.jade
@@ -1,8 +1,6 @@
template(name="swimlane")
.swimlane.js-lists
- .swimlane-header-wrap
- .swimlane-header
- = title
+ +swimlaneHeader
if isMiniScreen
if currentList
+list(currentList)
@@ -17,7 +15,6 @@ template(name="swimlane")
if currentCardIsInThisList _id ../_id
+cardDetails(currentCard)
if currentUser.isBoardMember
- +addListForm
+addListAndSwimlaneForm
template(name="listsGroup")