Indexers add card

pull/4/head
Mark McDowall 12 years ago
parent 4f1b27a523
commit 6522b38584

@ -0,0 +1,7 @@
<li>
<div class="indexer-settings-item add-card x-add-card">
<span class="center well">
<i class="icon-plus" title="Add Newznab"/>
</span>
</div>
</li>

@ -1,12 +1,5 @@
<fieldset> <fieldset>
<legend>Indexers</legend> <legend>Indexers</legend>
<div class="row">
<div class="span12">
<button class="btn btn-success x-add">Add Newznab</button>
</div>
</div>
<div class="row"> <div class="row">
<div class="span12"> <div class="span12">
<ul id="x-indexers" class="indexer-list"></ul> <ul id="x-indexers" class="indexer-list"></ul>

@ -11,10 +11,19 @@ define(['app',
template : 'Settings/Indexers/CollectionTemplate', template : 'Settings/Indexers/CollectionTemplate',
events: { 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; var self = this;
//TODO: Is there a better way to deal with changing URLs? //TODO: Is there a better way to deal with changing URLs?
var schemaCollection = new IndexerCollection(); var schemaCollection = new IndexerCollection();

@ -27,4 +27,22 @@
.btn-group { .btn-group {
margin-top: 8px; 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;
}
}
} }

@ -15,7 +15,7 @@ define([
}, },
onAfterItemAdded: function () { 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'); this.templateFunction = Marionette.TemplateCache.get('Settings/Notifications/AddCardTemplate');
var html = this.templateFunction(); var html = this.templateFunction();

@ -17,7 +17,7 @@ define(['app',
}, },
onAfterItemAdded: function () { 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'); this.templateFunction = Marionette.TemplateCache.get('Settings/Quality/Profile/AddCardTemplate');
var html = this.templateFunction(); var html = this.templateFunction();

Loading…
Cancel
Save