Settings will load with zero notifications

pull/4/head
Mark McDowall 11 years ago
parent 07073be73c
commit f25df49068

@ -1,7 +0,0 @@
<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>

@ -2,7 +2,15 @@
<legend>Indexers</legend> <legend>Indexers</legend>
<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">
<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>
</ul>
</div> </div>
</div> </div>
</fieldset> </fieldset>

@ -10,19 +10,19 @@ define(['app',
itemViewContainer: '#x-indexers', itemViewContainer: '#x-indexers',
template : 'Settings/Indexers/CollectionTemplate', template : 'Settings/Indexers/CollectionTemplate',
ui: {
'addCard': '.x-add-card'
},
events: { events: {
'click .x-add-card': '_openSchemaModal' 'click .x-add-card': '_openSchemaModal'
}, },
onRender: function () { appendHtml: function(collectionView, itemView, index){
this.listenTo(this.collection, 'add', this.render); collectionView.ui.addCard.parent('li').before(itemView.el);
this.templateFunction = Marionette.TemplateCache.get('Settings/Indexers/AddCardTemplate');
var html = this.templateFunction();
this.$itemViewContainer.append(html);
}, },
_openSchemaModal: function () { _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?

@ -29,20 +29,8 @@
} }
&.add-card { &.add-card {
.clickable;
color: #adadad;
font-size: 50px;
text-align: center;
.center { .center {
display: inline-block;
padding: 0px 20px;
padding-top: 5px;
margin-top: 100px; margin-top: 100px;
} }
i {
.clickable;
}
} }
} }

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

@ -1,5 +1,13 @@
<div class="row"> <div class="row">
<div class="span12"> <div class="span12">
<ul class="notifications"></ul> <ul class="notifications">
<li>
<div class="notification-item add-card x-add-card">
<span class="center well">
<i class="icon-plus" title="Add Notification"/>
</span>
</div>
</li>
</ul>
</div> </div>
</div> </div>

@ -3,24 +3,24 @@ define([
'app', 'app',
'marionette', 'marionette',
'Settings/Notifications/ItemView', 'Settings/Notifications/ItemView',
'Settings/Notifications/SchemaModal' 'Settings/Notifications/SchemaModal',
], function (App, Marionette, NotificationItemView, SchemaModal) { 'Settings/Notifications/AddCardView'
], function (App, Marionette, NotificationItemView, SchemaModal, AddCardView) {
return Marionette.CompositeView.extend({ return Marionette.CompositeView.extend({
itemView : NotificationItemView, itemView : NotificationItemView,
itemViewContainer: '.notifications', itemViewContainer: '.notifications',
template : 'Settings/Notifications/CollectionTemplate', template : 'Settings/Notifications/CollectionTemplate',
ui: {
'addCard': '.x-add-card'
},
events: { events: {
'click .x-add-card': '_openSchemaModal' 'click .x-add-card': '_openSchemaModal'
}, },
onRender: function () { appendHtml: function(collectionView, itemView, index){
this.listenTo(this.collection, 'add', this.render); collectionView.ui.addCard.parent('li').before(itemView.el);
this.templateFunction = Marionette.TemplateCache.get('Settings/Notifications/AddCardTemplate');
var html = this.templateFunction();
this.$itemViewContainer.append(html);
}, },
_openSchemaModal: function () { _openSchemaModal: function () {

@ -58,20 +58,8 @@
} }
&.add-card { &.add-card {
.clickable;
color: #adadad;
font-size: 50px;
text-align: center;
.center { .center {
display: inline-block;
padding: 0px 20px;
padding-top: 5px;
margin-top: 15px; margin-top: 15px;
} }
i {
.clickable;
}
} }
} }

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

@ -2,7 +2,15 @@
<legend>Quality Profiles</legend> <legend>Quality Profiles</legend>
<div class="row"> <div class="row">
<div class="span12"> <div class="span12">
<ul class="quality-profiles"></ul> <ul class="quality-profiles">
<li>
<div class="quality-profile-item add-card x-add-card">
<span class="center well">
<i class="icon-plus" title="Add Profile"/>
</span>
</div>
</li>
</ul>
</div> </div>
</div> </div>
</fieldset> </fieldset>

@ -12,19 +12,19 @@ define(['app',
itemViewContainer: '.quality-profiles', itemViewContainer: '.quality-profiles',
template : 'Settings/Quality/Profile/QualityProfileCollectionTemplate', template : 'Settings/Quality/Profile/QualityProfileCollectionTemplate',
ui: {
'addCard': '.x-add-card'
},
events: { events: {
'click .x-add-card': '_addProfile' 'click .x-add-card': '_addProfile'
}, },
onRender: function () { appendHtml: function(collectionView, itemView, index){
this.listenTo(this.collection, 'add', this.render); collectionView.ui.addCard.parent('li').before(itemView.el);
this.templateFunction = Marionette.TemplateCache.get('Settings/Quality/Profile/AddCardTemplate');
var html = this.templateFunction();
this.$itemViewContainer.append(html);
}, },
_addProfile: function () { _addProfile: function () {
var self = this; var self = this;
var schemaCollection = new ProfileCollection(); var schemaCollection = new ProfileCollection();

@ -29,21 +29,9 @@
} }
&.add-card { &.add-card {
.clickable;
color: #adadad;
font-size: 50px;
text-align: center;
.center { .center {
display: inline-block;
padding: 0px 20px;
padding-top: 5px;
margin-top: 30px; margin-top: 30px;
} }
i {
.clickable;
}
} }
} }

@ -20,4 +20,23 @@ li.save-and-add:hover {
text-decoration: none; text-decoration: none;
color: rgb(255, 255, 255); color: rgb(255, 255, 255);
background-color: rgb(0, 129, 194); background-color: rgb(0, 129, 194);
}
.add-card {
.clickable;
color: #adadad;
font-size: 50px;
text-align: center;
background-color: #f5f5f5;
.center {
.well;
display: inline-block;
padding: 5px 20px 0px;
background-color: white;
}
i {
.clickable;
}
} }
Loading…
Cancel
Save