From d7b568f98e0be84c14259cfdbda8dbb320f93abe Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 25 Mar 2016 11:37:26 -0400 Subject: [PATCH] REFACTOR: Remove view from badges-show --- .../controllers/admin-email-incomings.js.es6 | 22 ++-- .../admin/controllers/admin-email-logs.js.es6 | 21 ++-- .../admin/templates/email-received.hbs | 100 ++++++++--------- .../admin/templates/email-rejected.hbs | 102 +++++++++--------- .../admin/templates/email-sent.hbs | 88 +++++++-------- .../admin/templates/email-skipped.hbs | 88 +++++++-------- .../admin/views/admin-email-incomings.js.es6 | 14 --- .../admin/views/admin-email-logs.js.es6 | 14 --- .../admin/views/admin-email-received.js.es6 | 5 - .../admin/views/admin-email-rejected.js.es6 | 5 - .../admin/views/admin-email-sent.js.es6 | 5 - .../admin/views/admin-email-skipped.js.es6 | 5 - .../discourse/components/check-mark.js.es6 | 11 ++ .../discourse/components/load-more.js.es6 | 16 +++ .../discourse/mixins/load-more.js.es6 | 8 ++ .../discourse/templates/badges/show.hbs | 22 ++-- .../discourse/views/badges-show.js.es6 | 11 -- 17 files changed, 272 insertions(+), 265 deletions(-) delete mode 100644 app/assets/javascripts/admin/views/admin-email-incomings.js.es6 delete mode 100644 app/assets/javascripts/admin/views/admin-email-logs.js.es6 delete mode 100644 app/assets/javascripts/admin/views/admin-email-received.js.es6 delete mode 100644 app/assets/javascripts/admin/views/admin-email-rejected.js.es6 delete mode 100644 app/assets/javascripts/admin/views/admin-email-sent.js.es6 delete mode 100644 app/assets/javascripts/admin/views/admin-email-skipped.js.es6 create mode 100644 app/assets/javascripts/discourse/components/check-mark.js.es6 create mode 100644 app/assets/javascripts/discourse/components/load-more.js.es6 delete mode 100644 app/assets/javascripts/discourse/views/badges-show.js.es6 diff --git a/app/assets/javascripts/admin/controllers/admin-email-incomings.js.es6 b/app/assets/javascripts/admin/controllers/admin-email-incomings.js.es6 index deb7f0771..a6acd9af7 100644 --- a/app/assets/javascripts/admin/controllers/admin-email-incomings.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-email-incomings.js.es6 @@ -1,11 +1,21 @@ import IncomingEmail from 'admin/models/incoming-email'; export default Ember.Controller.extend({ - loadMore() { - return IncomingEmail.findAll(this.get("filter"), this.get("model.length")) - .then(incoming => { - if (incoming.length < 50) { this.get("model").set("allLoaded", true); } - this.get("model").addObjects(incoming); - }); + loading: false, + + actions: { + + loadMore() { + if (this.get("loading") || this.get("model.allLoaded")) { return; } + this.set('loading', true); + + IncomingEmail.findAll(this.get("filter"), this.get("model.length")) + .then(incoming => { + if (incoming.length < 50) { this.get("model").set("allLoaded", true); } + this.get("model").addObjects(incoming); + }).finally(() => { + this.set('loading', false); + }); + } } }); diff --git a/app/assets/javascripts/admin/controllers/admin-email-logs.js.es6 b/app/assets/javascripts/admin/controllers/admin-email-logs.js.es6 index 2506a0cd9..44a38dfa3 100644 --- a/app/assets/javascripts/admin/controllers/admin-email-logs.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-email-logs.js.es6 @@ -1,11 +1,20 @@ import EmailLog from 'admin/models/email-log'; export default Ember.Controller.extend({ - loadMore() { - return EmailLog.findAll(this.get("filter"), this.get("model.length")) - .then(logs => { - if (logs.length < 50) { this.get("model").set("allLoaded", true); } - this.get("model").addObjects(logs); - }); + loading: false, + + actions: { + loadMore() { + if (this.get("loading") || this.get("model.allLoaded")) { return; } + + this.set('loading', true); + return EmailLog.findAll(this.get("filter"), this.get("model.length")) + .then(logs => { + if (logs.length < 50) { this.get("model").set("allLoaded", true); } + this.get("model").addObjects(logs); + }).finally(() => { + this.set('loading', false); + }); + } } }); diff --git a/app/assets/javascripts/admin/templates/email-received.hbs b/app/assets/javascripts/admin/templates/email-received.hbs index 95e0cb2dc..e6e3bcbec 100644 --- a/app/assets/javascripts/admin/templates/email-received.hbs +++ b/app/assets/javascripts/admin/templates/email-received.hbs @@ -1,55 +1,57 @@ - - - - - - - +{{#load-more selector=".email-list tr" action="loadMore"}} +
{{i18n 'admin.email.time'}}{{i18n 'admin.email.incoming_emails.from_address'}}{{i18n 'admin.email.incoming_emails.to_addresses'}}{{i18n 'admin.email.incoming_emails.subject'}}
+ + + + + + + + + + + + + + - - - - - - - - - {{#each email in model}} - - - + + + + - - - - {{else}} - - {{/each}} + + + {{else}} + + {{/each}} -
{{i18n 'admin.email.time'}}{{i18n 'admin.email.incoming_emails.from_address'}}{{i18n 'admin.email.incoming_emails.to_addresses'}}{{i18n 'admin.email.incoming_emails.subject'}}
{{i18n 'admin.email.logs.filters.title'}}{{text-field value=filter.from placeholderKey="admin.email.incoming_emails.filters.from_placeholder"}}{{text-field value=filter.to placeholderKey="admin.email.incoming_emails.filters.to_placeholder"}}{{text-field value=filter.subject placeholderKey="admin.email.incoming_emails.filters.subject_placeholder"}}
{{i18n 'admin.email.logs.filters.title'}}{{text-field value=filter.from placeholderKey="admin.email.incoming_emails.filters.from_placeholder"}}{{text-field value=filter.to placeholderKey="admin.email.incoming_emails.filters.to_placeholder"}}{{text-field value=filter.subject placeholderKey="admin.email.incoming_emails.filters.subject_placeholder"}}
{{format-date email.created_at}} -
- {{#if email.user}} - {{#link-to 'adminUser' email.user}} - {{avatar email.user imageSize="tiny"}} - {{email.from_address}} - {{/link-to}} + {{#each email in model}} +
{{format-date email.created_at}} +
+ {{#if email.user}} + {{#link-to 'adminUser' email.user}} + {{avatar email.user imageSize="tiny"}} + {{email.from_address}} + {{/link-to}} + {{else}} + — + {{/if}} +
+
+ {{#each to in email.to_addresses}} +

{{unbound to}}

+ {{/each}} + {{#each cc in email.cc_addresses}} +

{{unbound cc}}

+ {{/each}} +
+ {{#if email.post_url}} + {{email.subject}} {{else}} - — + {{email.subject}} {{/if}} - - - {{#each to in email.to_addresses}} -

{{unbound to}}

- {{/each}} - {{#each cc in email.cc_addresses}} -

{{unbound cc}}

- {{/each}} -
- {{#if email.post_url}} - {{email.subject}} - {{else}} - {{email.subject}} - {{/if}} -
{{i18n 'admin.email.incoming_emails.none'}}
{{i18n 'admin.email.incoming_emails.none'}}
+ +{{/load-more}} -{{conditional-loading-spinner condition=view.loading}} +{{conditional-loading-spinner condition=loading}} diff --git a/app/assets/javascripts/admin/templates/email-rejected.hbs b/app/assets/javascripts/admin/templates/email-rejected.hbs index 3c5f3cba8..664eb7286 100644 --- a/app/assets/javascripts/admin/templates/email-rejected.hbs +++ b/app/assets/javascripts/admin/templates/email-rejected.hbs @@ -1,54 +1,56 @@ - - - - - - - - +{{#load-more selector=".email-list tr" action="loadMore"}} +
{{i18n 'admin.email.time'}}{{i18n 'admin.email.incoming_emails.from_address'}}{{i18n 'admin.email.incoming_emails.to_addresses'}}{{i18n 'admin.email.incoming_emails.subject'}}{{i18n 'admin.email.incoming_emails.error'}}
+ + + + + + + + + + + + + + + + - - - - - - - - + {{#each email in model}} + + + + + + + + {{else}} + + {{/each}} - {{#each email in model}} - - - - - - - - {{else}} - - {{/each}} +
{{i18n 'admin.email.time'}}{{i18n 'admin.email.incoming_emails.from_address'}}{{i18n 'admin.email.incoming_emails.to_addresses'}}{{i18n 'admin.email.incoming_emails.subject'}}{{i18n 'admin.email.incoming_emails.error'}}
{{i18n 'admin.email.logs.filters.title'}}{{text-field value=filter.from placeholderKey="admin.email.incoming_emails.filters.from_placeholder"}}{{text-field value=filter.to placeholderKey="admin.email.incoming_emails.filters.to_placeholder"}}{{text-field value=filter.subject placeholderKey="admin.email.incoming_emails.filters.subject_placeholder"}}{{text-field value=filter.error placeholderKey="admin.email.incoming_emails.filters.error_placeholder"}}
{{i18n 'admin.email.logs.filters.title'}}{{text-field value=filter.from placeholderKey="admin.email.incoming_emails.filters.from_placeholder"}}{{text-field value=filter.to placeholderKey="admin.email.incoming_emails.filters.to_placeholder"}}{{text-field value=filter.subject placeholderKey="admin.email.incoming_emails.filters.subject_placeholder"}}{{text-field value=filter.error placeholderKey="admin.email.incoming_emails.filters.error_placeholder"}}
{{format-date email.created_at}} +
+ {{#if email.user}} + {{#link-to 'adminUser' email.user}} + {{avatar email.user imageSize="tiny"}} + {{email.from_address}} + {{/link-to}} + {{else}} + — + {{/if}} +
+
+ {{#each to in email.to_addresses}} +

{{unbound to}}

+ {{/each}} + {{#each cc in email.cc_addresses}} +

{{unbound cc}}

+ {{/each}} +
{{email.subject}} + {{email.error}} +
{{i18n 'admin.email.incoming_emails.none'}}
{{format-date email.created_at}} -
- {{#if email.user}} - {{#link-to 'adminUser' email.user}} - {{avatar email.user imageSize="tiny"}} - {{email.from_address}} - {{/link-to}} - {{else}} - — - {{/if}} -
-
- {{#each to in email.to_addresses}} -

{{unbound to}}

- {{/each}} - {{#each cc in email.cc_addresses}} -

{{unbound cc}}

- {{/each}} -
{{email.subject}} - {{email.error}} -
{{i18n 'admin.email.incoming_emails.none'}}
+{{/load-more}} - - -{{conditional-loading-spinner condition=view.loading}} +{{conditional-loading-spinner condition=loading}} diff --git a/app/assets/javascripts/admin/templates/email-sent.hbs b/app/assets/javascripts/admin/templates/email-sent.hbs index 2f8785c6f..ca5fb4aaa 100644 --- a/app/assets/javascripts/admin/templates/email-sent.hbs +++ b/app/assets/javascripts/admin/templates/email-sent.hbs @@ -1,47 +1,49 @@ - - - - - - - - +{{#load-more selector=".email-list tr" action="loadMore"}} +
{{i18n 'admin.email.sent_at'}}{{i18n 'admin.email.user'}}{{i18n 'admin.email.to_address'}}{{i18n 'admin.email.email_type'}}{{i18n 'admin.email.reply_key'}}
+ + + + + + + + + + + + + + + + - - - - - - - - + {{#each l in model}} + + + + + + + + {{else}} + + {{/each}} - {{#each l in model}} - - - - - - - - {{else}} - - {{/each}} +
{{i18n 'admin.email.sent_at'}}{{i18n 'admin.email.user'}}{{i18n 'admin.email.to_address'}}{{i18n 'admin.email.email_type'}}{{i18n 'admin.email.reply_key'}}
{{i18n 'admin.email.logs.filters.title'}}{{text-field value=filter.user placeholderKey="admin.email.logs.filters.user_placeholder"}}{{text-field value=filter.address placeholderKey="admin.email.logs.filters.address_placeholder"}}{{text-field value=filter.type placeholderKey="admin.email.logs.filters.type_placeholder"}}{{text-field value=filter.reply_key placeholderKey="admin.email.logs.filters.reply_key_placeholder"}}
{{i18n 'admin.email.logs.filters.title'}}{{text-field value=filter.user placeholderKey="admin.email.logs.filters.user_placeholder"}}{{text-field value=filter.address placeholderKey="admin.email.logs.filters.address_placeholder"}}{{text-field value=filter.type placeholderKey="admin.email.logs.filters.type_placeholder"}}{{text-field value=filter.reply_key placeholderKey="admin.email.logs.filters.reply_key_placeholder"}}
{{format-date l.created_at}} + {{#if l.user}} + {{#link-to 'adminUser' l.user}}{{avatar l.user imageSize="tiny"}}{{/link-to}} + {{#link-to 'adminUser' l.user}}{{l.user.username}}{{/link-to}} + {{else}} + — + {{/if}} + {{l.to_address}}{{l.email_type}} + {{#if l.post_url}} + {{l.reply_key}} + {{else}} + {{l.reply_key}} + {{/if}} +
{{i18n 'admin.email.logs.none'}}
{{format-date l.created_at}} - {{#if l.user}} - {{#link-to 'adminUser' l.user}}{{avatar l.user imageSize="tiny"}}{{/link-to}} - {{#link-to 'adminUser' l.user}}{{l.user.username}}{{/link-to}} - {{else}} - — - {{/if}} - {{l.to_address}}{{l.email_type}} - {{#if l.post_url}} - {{l.reply_key}} - {{else}} - {{l.reply_key}} - {{/if}} -
{{i18n 'admin.email.logs.none'}}
+{{/load-more}} - - -{{conditional-loading-spinner condition=view.loading}} +{{conditional-loading-spinner condition=loading}} diff --git a/app/assets/javascripts/admin/templates/email-skipped.hbs b/app/assets/javascripts/admin/templates/email-skipped.hbs index 6ef487256..9c21c428c 100644 --- a/app/assets/javascripts/admin/templates/email-skipped.hbs +++ b/app/assets/javascripts/admin/templates/email-skipped.hbs @@ -1,47 +1,49 @@ - - - - - - - - +{{#load-more selector=".email-list tr" action="loadMore"}} +
{{i18n 'admin.email.time'}}{{i18n 'admin.email.user'}}{{i18n 'admin.email.to_address'}}{{i18n 'admin.email.email_type'}}{{i18n 'admin.email.skipped_reason'}}
+ + + + + + + + + + + + + + + + - - - - - - - - + {{#each l in model}} + + + + + + + + {{else}} + + {{/each}} - {{#each l in model}} - - - - - - - - {{else}} - - {{/each}} +
{{i18n 'admin.email.time'}}{{i18n 'admin.email.user'}}{{i18n 'admin.email.to_address'}}{{i18n 'admin.email.email_type'}}{{i18n 'admin.email.skipped_reason'}}
{{i18n 'admin.email.logs.filters.title'}}{{text-field value=filter.user placeholderKey="admin.email.logs.filters.user_placeholder"}}{{text-field value=filter.address placeholderKey="admin.email.logs.filters.address_placeholder"}}{{text-field value=filter.type placeholderKey="admin.email.logs.filters.type_placeholder"}}{{text-field value=filter.skipped_reason placeholderKey="admin.email.logs.filters.skipped_reason_placeholder"}}
{{i18n 'admin.email.logs.filters.title'}}{{text-field value=filter.user placeholderKey="admin.email.logs.filters.user_placeholder"}}{{text-field value=filter.address placeholderKey="admin.email.logs.filters.address_placeholder"}}{{text-field value=filter.type placeholderKey="admin.email.logs.filters.type_placeholder"}}{{text-field value=filter.skipped_reason placeholderKey="admin.email.logs.filters.skipped_reason_placeholder"}}
{{format-date l.created_at}} + {{#if l.user}} + {{#link-to 'adminUser' l.user}}{{avatar l.user imageSize="tiny"}}{{/link-to}} + {{#link-to 'adminUser' l.user}}{{l.user.username}}{{/link-to}} + {{else}} + — + {{/if}} + {{l.to_address}}{{l.email_type}} + {{#if l.post_url}} + {{l.skipped_reason}} + {{else}} + {{l.skipped_reason}} + {{/if}} +
{{i18n 'admin.email.logs.none'}}
{{format-date l.created_at}} - {{#if l.user}} - {{#link-to 'adminUser' l.user}}{{avatar l.user imageSize="tiny"}}{{/link-to}} - {{#link-to 'adminUser' l.user}}{{l.user.username}}{{/link-to}} - {{else}} - — - {{/if}} - {{l.to_address}}{{l.email_type}} - {{#if l.post_url}} - {{l.skipped_reason}} - {{else}} - {{l.skipped_reason}} - {{/if}} -
{{i18n 'admin.email.logs.none'}}
+{{/load-more}} - - -{{conditional-loading-spinner condition=view.loading}} +{{conditional-loading-spinner condition=loading}} diff --git a/app/assets/javascripts/admin/views/admin-email-incomings.js.es6 b/app/assets/javascripts/admin/views/admin-email-incomings.js.es6 deleted file mode 100644 index 6360f857b..000000000 --- a/app/assets/javascripts/admin/views/admin-email-incomings.js.es6 +++ /dev/null @@ -1,14 +0,0 @@ -import LoadMore from "discourse/mixins/load-more"; - -export default Ember.View.extend(LoadMore, { - loading: false, - eyelineSelector: ".email-list tr", - - actions: { - loadMore() { - if (this.get("loading") || this.get("model.allLoaded")) { return; } - this.set("loading", true); - return this.get("controller").loadMore().then(() => this.set("loading", false)); - } - } -}); diff --git a/app/assets/javascripts/admin/views/admin-email-logs.js.es6 b/app/assets/javascripts/admin/views/admin-email-logs.js.es6 deleted file mode 100644 index 6360f857b..000000000 --- a/app/assets/javascripts/admin/views/admin-email-logs.js.es6 +++ /dev/null @@ -1,14 +0,0 @@ -import LoadMore from "discourse/mixins/load-more"; - -export default Ember.View.extend(LoadMore, { - loading: false, - eyelineSelector: ".email-list tr", - - actions: { - loadMore() { - if (this.get("loading") || this.get("model.allLoaded")) { return; } - this.set("loading", true); - return this.get("controller").loadMore().then(() => this.set("loading", false)); - } - } -}); diff --git a/app/assets/javascripts/admin/views/admin-email-received.js.es6 b/app/assets/javascripts/admin/views/admin-email-received.js.es6 deleted file mode 100644 index da0d8de15..000000000 --- a/app/assets/javascripts/admin/views/admin-email-received.js.es6 +++ /dev/null @@ -1,5 +0,0 @@ -import AdminEmailIncomingsView from "admin/views/admin-email-incomings"; - -export default AdminEmailIncomingsView.extend({ - templateName: "admin/templates/email-received" -}); diff --git a/app/assets/javascripts/admin/views/admin-email-rejected.js.es6 b/app/assets/javascripts/admin/views/admin-email-rejected.js.es6 deleted file mode 100644 index b89fe8d46..000000000 --- a/app/assets/javascripts/admin/views/admin-email-rejected.js.es6 +++ /dev/null @@ -1,5 +0,0 @@ -import AdminEmailIncomingsView from "admin/views/admin-email-incomings"; - -export default AdminEmailIncomingsView.extend({ - templateName: "admin/templates/email-rejected" -}); diff --git a/app/assets/javascripts/admin/views/admin-email-sent.js.es6 b/app/assets/javascripts/admin/views/admin-email-sent.js.es6 deleted file mode 100644 index d007a7964..000000000 --- a/app/assets/javascripts/admin/views/admin-email-sent.js.es6 +++ /dev/null @@ -1,5 +0,0 @@ -import AdminEmailLogsView from "admin/views/admin-email-logs"; - -export default AdminEmailLogsView.extend({ - templateName: "admin/templates/email-sent" -}); diff --git a/app/assets/javascripts/admin/views/admin-email-skipped.js.es6 b/app/assets/javascripts/admin/views/admin-email-skipped.js.es6 deleted file mode 100644 index e3c446709..000000000 --- a/app/assets/javascripts/admin/views/admin-email-skipped.js.es6 +++ /dev/null @@ -1,5 +0,0 @@ -import AdminEmailLogsView from "admin/views/admin-email-logs"; - -export default AdminEmailLogsView.extend({ - templateName: "admin/templates/email-skipped" -}); diff --git a/app/assets/javascripts/discourse/components/check-mark.js.es6 b/app/assets/javascripts/discourse/components/check-mark.js.es6 new file mode 100644 index 000000000..702af6a15 --- /dev/null +++ b/app/assets/javascripts/discourse/components/check-mark.js.es6 @@ -0,0 +1,11 @@ +import computed from 'ember-addons/ember-computed-decorators'; + +export default Ember.Component.extend({ + tagName: 'i', + classNameBindings: [':fa', 'iconClass'], + + @computed('checked') + iconClass(checked) { + return checked ? 'fa-check' : 'fa-times'; + } +}); diff --git a/app/assets/javascripts/discourse/components/load-more.js.es6 b/app/assets/javascripts/discourse/components/load-more.js.es6 new file mode 100644 index 000000000..4b355a5b0 --- /dev/null +++ b/app/assets/javascripts/discourse/components/load-more.js.es6 @@ -0,0 +1,16 @@ +import LoadMore from "discourse/mixins/load-more"; + +export default Ember.Component.extend(LoadMore, { + _viaComponent: true, + + init() { + this._super(); + this.set('eyelineSelector', this.get('selector')); + }, + + actions: { + loadMore() { + this.sendAction(); + } + } +}); diff --git a/app/assets/javascripts/discourse/mixins/load-more.js.es6 b/app/assets/javascripts/discourse/mixins/load-more.js.es6 index c422e1cd6..16c873405 100644 --- a/app/assets/javascripts/discourse/mixins/load-more.js.es6 +++ b/app/assets/javascripts/discourse/mixins/load-more.js.es6 @@ -5,6 +5,14 @@ import { on } from 'ember-addons/ember-computed-decorators'; // Provides the ability to load more items for a view which is scrolled to the bottom. export default Ember.Mixin.create(Ember.ViewTargetActionSupport, Scrolling, { + init() { + this._super(); + if (!this._viaComponent) { + console.warn('Using `LoadMore` as a view mixin is deprecated. Use `{{load-more}}` instead'); + } + + }, + scrolled() { const eyeline = this.get('eyeline'); return eyeline && eyeline.update(); diff --git a/app/assets/javascripts/discourse/templates/badges/show.hbs b/app/assets/javascripts/discourse/templates/badges/show.hbs index 7f15cc73e..f762e6dfe 100644 --- a/app/assets/javascripts/discourse/templates/badges/show.hbs +++ b/app/assets/javascripts/discourse/templates/badges/show.hbs @@ -14,21 +14,25 @@
{{i18n 'badges.granted' count=grantCount}}
-
{{i18n 'badges.allow_title'}} {{{view.allowTitle}}}
{{i18n 'badges.multiple_grant'}} {{{view.multipleGrant}}} +
+ {{i18n 'badges.allow_title'}} {{check-mark checked=model.allow_title}}
+ {{i18n 'badges.multiple_grant'}} {{check-mark checked=model.multiple_grant}}
{{#if userBadges}}
- {{#each userBadges as |ub|}} - {{#user-info user=ub.user size="medium" class="badge-info" date=ub.granted_at}} -
{{i18n 'badges.granted_on' date=(inline-date ub.granted_at)}}
- {{#if ub.post_number}} - {{{ub.topic.fancyTitle}}} - {{/if}} - {{/user-info}} - {{/each}} + {{#load-more selector=".badge-info" action="loadMore"}} + {{#each userBadges as |ub|}} + {{#user-info user=ub.user size="medium" class="badge-info" date=ub.granted_at}} +
{{i18n 'badges.granted_on' date=(inline-date ub.granted_at)}}
+ {{#if ub.post_number}} + {{{ub.topic.fancyTitle}}} + {{/if}} + {{/user-info}} + {{/each}} + {{/load-more}} {{#unless canLoadMore}} {{#if user}} diff --git a/app/assets/javascripts/discourse/views/badges-show.js.es6 b/app/assets/javascripts/discourse/views/badges-show.js.es6 deleted file mode 100644 index 2aae5f767..000000000 --- a/app/assets/javascripts/discourse/views/badges-show.js.es6 +++ /dev/null @@ -1,11 +0,0 @@ -import LoadMore from "discourse/mixins/load-more"; - -export default Ember.View.extend(LoadMore, { - eyelineSelector: '.badge-info', - tickOrX: function(field){ - var icon = this.get('controller.model.' + field) ? "fa-check" : "fa-times"; - return ""; - }, - allowTitle: function() { return this.tickOrX("allow_title"); }.property(), - multipleGrant: function() { return this.tickOrX("multiple_grant"); }.property() -});