mirror of
https://github.com/Radarr/Radarr
synced 2025-03-20 18:55:42 +00:00
Add notification card
This commit is contained in:
parent
f4e27002f9
commit
d7c70a9c91
4 changed files with 48 additions and 6 deletions
UI/Settings/Notifications
7
UI/Settings/Notifications/AddCardTemplate.html
Normal file
7
UI/Settings/Notifications/AddCardTemplate.html
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<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,9 +1,4 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="span12">
|
|
||||||
<button class="btn btn-success x-add">Add Notification</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="span12">
|
<div class="span12">
|
||||||
<ul class="notifications"></ul>
|
<ul class="notifications"></ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -10,12 +10,34 @@ define([
|
||||||
itemViewContainer: '.notifications',
|
itemViewContainer: '.notifications',
|
||||||
template : 'Settings/Notifications/CollectionTemplate',
|
template : 'Settings/Notifications/CollectionTemplate',
|
||||||
|
|
||||||
|
ui: {
|
||||||
|
'addCard': '.x-add-card'
|
||||||
|
},
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
'click .x-add': '_openSchemaModal'
|
'click .x-add': '_openSchemaModal',
|
||||||
|
'click .x-add-card': '_openSchemaModal'
|
||||||
|
},
|
||||||
|
|
||||||
|
onBeforeItemAdded: function () {
|
||||||
|
this.ui.addCard.remove();
|
||||||
|
},
|
||||||
|
|
||||||
|
onAfterItemAdded: function () {
|
||||||
|
this._appendAddCard();
|
||||||
},
|
},
|
||||||
|
|
||||||
_openSchemaModal: function () {
|
_openSchemaModal: function () {
|
||||||
SchemaModal.open(this.collection);
|
SchemaModal.open(this.collection);
|
||||||
|
},
|
||||||
|
|
||||||
|
_appendAddCard: function () {
|
||||||
|
this.$itemViewContainer.find('.x-add-card').remove();
|
||||||
|
|
||||||
|
this.templateFunction = Marionette.TemplateCache.get('Settings/Notifications/AddCardTemplate');
|
||||||
|
var html = this.templateFunction();
|
||||||
|
|
||||||
|
this.$itemViewContainer.append(html);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -57,3 +57,21 @@
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.add-card {
|
||||||
|
.clickable;
|
||||||
|
color: #adadad;
|
||||||
|
font-size: 50px;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
.center {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0px 20px;
|
||||||
|
padding-top: 5px;
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
i {
|
||||||
|
.clickable;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue