From 6522b38584ed7ce90a936f8a38352d07742f64e3 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 26 Jul 2013 00:19:44 -0700 Subject: [PATCH] Indexers add card --- UI/Settings/Indexers/AddCardTemplate.html | 7 +++++++ UI/Settings/Indexers/CollectionTemplate.html | 7 ------- UI/Settings/Indexers/CollectionView.js | 13 +++++++++++-- UI/Settings/Indexers/indexers.less | 18 ++++++++++++++++++ UI/Settings/Notifications/CollectionView.js | 2 +- .../Profile/QualityProfileCollectionView.js | 2 +- 6 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 UI/Settings/Indexers/AddCardTemplate.html diff --git a/UI/Settings/Indexers/AddCardTemplate.html b/UI/Settings/Indexers/AddCardTemplate.html new file mode 100644 index 000000000..5605cfcc8 --- /dev/null +++ b/UI/Settings/Indexers/AddCardTemplate.html @@ -0,0 +1,7 @@ +
  • +
    + + + +
    +
  • diff --git a/UI/Settings/Indexers/CollectionTemplate.html b/UI/Settings/Indexers/CollectionTemplate.html index 8f263291d..92f0d9f22 100644 --- a/UI/Settings/Indexers/CollectionTemplate.html +++ b/UI/Settings/Indexers/CollectionTemplate.html @@ -1,12 +1,5 @@ 
    Indexers - -
    -
    - -
    -
    -
      diff --git a/UI/Settings/Indexers/CollectionView.js b/UI/Settings/Indexers/CollectionView.js index 856433837..e5cf55d52 100644 --- a/UI/Settings/Indexers/CollectionView.js +++ b/UI/Settings/Indexers/CollectionView.js @@ -11,10 +11,19 @@ define(['app', template : 'Settings/Indexers/CollectionTemplate', events: { - 'click .x-add': 'openSchemaModal' + 'click .x-add-card': '_openSchemaModal' }, - openSchemaModal: function () { + onAfterItemAdded: function () { + this.$itemViewContainer.find('.x-add-card').parent('li').remove(); + + this.templateFunction = Marionette.TemplateCache.get('Settings/Indexers/AddCardTemplate'); + var html = this.templateFunction(); + + this.$itemViewContainer.append(html); + }, + + _openSchemaModal: function () { var self = this; //TODO: Is there a better way to deal with changing URLs? var schemaCollection = new IndexerCollection(); diff --git a/UI/Settings/Indexers/indexers.less b/UI/Settings/Indexers/indexers.less index 7f51b7c39..ea2d5a03a 100644 --- a/UI/Settings/Indexers/indexers.less +++ b/UI/Settings/Indexers/indexers.less @@ -27,4 +27,22 @@ .btn-group { margin-top: 8px; } + + &.add-card { + .clickable; + color: #adadad; + font-size: 50px; + text-align: center; + + .center { + display: inline-block; + padding: 0px 20px; + padding-top: 5px; + margin-top: 100px; + } + + i { + .clickable; + } + } } \ No newline at end of file diff --git a/UI/Settings/Notifications/CollectionView.js b/UI/Settings/Notifications/CollectionView.js index 67658c995..5bdae6b40 100644 --- a/UI/Settings/Notifications/CollectionView.js +++ b/UI/Settings/Notifications/CollectionView.js @@ -15,7 +15,7 @@ define([ }, onAfterItemAdded: function () { - this.$itemViewContainer.find('.x-add-card').remove(); + this.$itemViewContainer.find('.x-add-card').parent('li').remove(); this.templateFunction = Marionette.TemplateCache.get('Settings/Notifications/AddCardTemplate'); var html = this.templateFunction(); diff --git a/UI/Settings/Quality/Profile/QualityProfileCollectionView.js b/UI/Settings/Quality/Profile/QualityProfileCollectionView.js index cf10aebee..eee379df1 100644 --- a/UI/Settings/Quality/Profile/QualityProfileCollectionView.js +++ b/UI/Settings/Quality/Profile/QualityProfileCollectionView.js @@ -17,7 +17,7 @@ define(['app', }, onAfterItemAdded: function () { - this.$itemViewContainer.find('.x-add-card').remove(); + this.$itemViewContainer.find('.x-add-card').parent('li').remove(); this.templateFunction = Marionette.TemplateCache.get('Settings/Quality/Profile/AddCardTemplate'); var html = this.templateFunction();