summaryrefslogtreecommitdiffstats
path: root/client/components/cards
diff options
context:
space:
mode:
Diffstat (limited to 'client/components/cards')
-rw-r--r--client/components/cards/details.jade4
-rw-r--r--client/components/cards/events.js61
-rw-r--r--client/components/cards/minicard.jade27
-rw-r--r--client/components/cards/minicard.js14
4 files changed, 43 insertions, 63 deletions
diff --git a/client/components/cards/details.jade b/client/components/cards/details.jade
index b77c3961..4e8fd8c0 100644
--- a/client/components/cards/details.jade
+++ b/client/components/cards/details.jade
@@ -4,7 +4,7 @@ template(name="cardDetails")
.card-detail-cover(style="background-image: url({{ card.cover.url }})")
.card-detail-header(class="{{#if currentUser.isBoardMember}}editable{{/if}}")
a.js-close-card-detail
- i.fa.fa-times
+ i.fa.fa-times-thin
h2.card-detail-title.js-card-title= title
p.card-detail-list.js-move-card
| {{_ 'in-list'}}
@@ -25,7 +25,7 @@ template(name="cardDetails")
if currentUser.isBoardMember
h3 Description
+inlinedForm(classNames="js-card-description")
- i.fa.fa-times.js-close-inlined-form
+ a.fa.fa-times-thin.js-close-inlined-form
+editor(autofocus=true)
= description
button(type="submit") {{_ 'edit'}}
diff --git a/client/components/cards/events.js b/client/components/cards/events.js
index 9c270e8d..21d628df 100644
--- a/client/components/cards/events.js
+++ b/client/components/cards/events.js
@@ -1,64 +1,3 @@
-// Template.cards.events({
-// // 'click .js-cancel': function(event, t) {
-// // var composer = t.$('.card-composer');
-
-// // // Keep the old value in memory to display it again next time
-// // var inputCacheKey = "addCard-" + this.listId;
-// // var oldValue = composer.find('.js-card-title').val();
-// // InputsCache.set(inputCacheKey, oldValue);
-
-// // // add composer hide class
-// // composer.addClass('hide');
-// // composer.find('.js-card-title').val('');
-
-// // // remove hide open link class
-// // $('.js-open-card-composer').removeClass('hide');
-// // },
-// 'submit': function(evt, tpl) {
-// evt.preventDefault();
-// var textarea = $(evt.currentTarget).find('textarea');
-// var title = textarea.val();
-// var lastCard = tpl.find('.js-minicard:last-child');
-// var sort;
-// if (lastCard === null) {
-// sort = 0;
-// } else {
-// sort = Blaze.getData(lastCard).sort + 1;
-// }
-// // debugger
-
-// // Clear the form in-memory cache
-// // var inputCacheKey = "addCard-" + this.listId;
-// // InputsCache.set(inputCacheKey, '');
-
-// // title trim if not empty then
-// if ($.trim(title)) {
-// Cards.insert({
-// title: title,
-// listId: Template.currentData().listId,
-// boardId: Template.currentData().board._id,
-// sort: sort
-// }, function(err, _id) {
-// // In case the filter is active we need to add the newly
-// // inserted card in the list of exceptions -- cards that are
-// // not filtered. Otherwise the card will disappear instantly.
-// // See https://github.com/libreboard/libreboard/issues/80
-// Filter.addException(_id);
-// });
-
-// // empty and focus.
-// textarea.val('').focus();
-
-// // focus complete then scroll top
-// Utils.Scroll(tpl.find('.js-minicards')).top(1000, true);
-// }
-// }
-// });
-
-// Template.cards.events({
-// 'click .member': Popup.open('cardMember')
-// });
-
Template.cardMemberPopup.events({
'click .js-remove-member': function() {
Cards.update(this.cardId, {$pull: {members: this.userId}});
diff --git a/client/components/cards/minicard.jade b/client/components/cards/minicard.jade
new file mode 100644
index 00000000..e1176264
--- /dev/null
+++ b/client/components/cards/minicard.jade
@@ -0,0 +1,27 @@
+template(name="minicard")
+ .minicard.card.js-minicard(
+ class="{{#if isSelected}}is-selected{{/if}}")
+ a.minicard-details.clearfix.show(href=absoluteUrl)
+ if cover
+ .minicard-cover.js-card-cover(style="background-image: url({{cover.url}});")
+ if labels
+ .minicard-labels
+ each labels
+ .minicard-label(class="card-label-{{color}}" title="{{name}}")
+ .minicard-title= title
+ if members
+ .minicard-members.js-minicard-members
+ each members
+ +userAvatar(userId=this size="small" cardId="{{../_id}}")
+ .badges
+ if comments.count
+ .badge(title="{{_ 'card-comments-title' comments.count }}")
+ span.badge-icon.icon-sm.fa.fa-comment-o
+ .badge-text= comments.count
+ if description
+ .badge.badge-state-image-only(title=description)
+ span.badge-icon.icon-sm.fa.fa-align-left
+ if attachments.count
+ .badge
+ span.badge-icon.icon-sm.fa.fa-paperclip
+ span.badge-text= attachments.count
diff --git a/client/components/cards/minicard.js b/client/components/cards/minicard.js
new file mode 100644
index 00000000..b339580b
--- /dev/null
+++ b/client/components/cards/minicard.js
@@ -0,0 +1,14 @@
+// Template.cards.events({
+// 'click .member': Popup.open('cardMember')
+// });
+
+
+BlazeComponent.extendComponent({
+ template: function() {
+ return 'minicard';
+ },
+
+ isSelected: function() {
+ return Session.equals('currentCard', this.currentData()._id);
+ }
+}).register('minicard');