зеркало из https://github.com/mozilla/MozDef.git
averez-83-incident-urls: Have one URL per incident URL (also fixes refresh in an incident page), Closes #83
This commit is contained in:
Родитель
0f692c0606
Коммит
0d715216a5
|
@ -31,7 +31,6 @@ Jeff Bryner jbryner@mozilla.com
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
{{>veristags}}
|
{{>veristags}}
|
||||||
{{#with incident}}
|
|
||||||
<form id="editincidentform" class="form-horizontal editincidentform" style="margin: 0px 30% 20px;">
|
<form id="editincidentform" class="form-horizontal editincidentform" style="margin: 0px 30% 20px;">
|
||||||
<legend>Edit Incident</legend>
|
<legend>Edit Incident</legend>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
@ -120,7 +119,5 @@ Jeff Bryner jbryner@mozilla.com
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
{{/with}}
|
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -96,8 +96,7 @@ if (Meteor.isClient) {
|
||||||
"click": function(e,t){
|
"click": function(e,t){
|
||||||
if (this._id != undefined){
|
if (this._id != undefined){
|
||||||
Session.set('displayMessage','Starting edit for incident._id: ' + this._id);
|
Session.set('displayMessage','Starting edit for incident._id: ' + this._id);
|
||||||
Session.set('incidentID',this._id);
|
Router.go('/incident/' + this._id + '/edit');
|
||||||
Router.go('/incidents/edit')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -133,18 +132,18 @@ if (Meteor.isClient) {
|
||||||
"drop .tags": function(e){
|
"drop .tags": function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
//console.log(e)
|
//console.log(e)
|
||||||
tagtext=e.originalEvent.dataTransfer.getData("text/plain")
|
tagtext = e.originalEvent.dataTransfer.getData("text/plain");
|
||||||
//e.target.textContent=droptag
|
//e.target.textContent=droptag
|
||||||
//console.log(tagtext)
|
//console.log(tagtext)
|
||||||
incidents.update(Session.get('incidentID'),{
|
incidents.update(Session.get('incidentID'), {
|
||||||
$addToSet:{tags:tagtext}
|
$addToSet: {tags:tagtext}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
"click .tagdelete": function(e){
|
"click .tagdelete": function(e){
|
||||||
tagtext=e.target.parentNode.firstChild.wholeText;
|
tagtext = e.target.parentNode.firstChild.wholeText;
|
||||||
incidents.update(Session.get('incidentID'),{
|
incidents.update(Session.get('incidentID'), {
|
||||||
$pull:{tags:tagtext}
|
$pull: {tags:tagtext}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -153,7 +152,7 @@ if (Meteor.isClient) {
|
||||||
|
|
||||||
// tags are saved in realtime
|
// tags are saved in realtime
|
||||||
|
|
||||||
incidents.update(Session.get('incidentID'),{$set:{
|
incidents.update(Session.get('incidentID'), {$set: {
|
||||||
summary: template.find("#incidentSummary").value,
|
summary: template.find("#incidentSummary").value,
|
||||||
dateOpened: template.find("#dateOpened").value,
|
dateOpened: template.find("#dateOpened").value,
|
||||||
dateClosed: template.find("#dateClosed").value,
|
dateClosed: template.find("#dateClosed").value,
|
||||||
|
@ -177,7 +176,7 @@ if (Meteor.isClient) {
|
||||||
|
|
||||||
Template.editincidentform.rendered = function() {
|
Template.editincidentform.rendered = function() {
|
||||||
if (typeof console !== 'undefined') {
|
if (typeof console !== 'undefined') {
|
||||||
console.log('load edit incident form')
|
console.log('load edit incident form ' + Session.get('incidentID'));
|
||||||
}
|
}
|
||||||
$('#dateClosed').daterangepicker({
|
$('#dateClosed').daterangepicker({
|
||||||
singleDatePicker: true,
|
singleDatePicker: true,
|
||||||
|
|
|
@ -33,7 +33,6 @@ Router.map(function () {
|
||||||
layoutTemplate: 'layout'
|
layoutTemplate: 'layout'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
this.route('incidentnew', {
|
this.route('incidentnew', {
|
||||||
path: '/incidents/new',
|
path: '/incidents/new',
|
||||||
template: 'addincidentform',
|
template: 'addincidentform',
|
||||||
|
@ -41,11 +40,16 @@ Router.map(function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
this.route('incidentedit', {
|
this.route('incidentedit', {
|
||||||
path: '/incidents/edit',
|
path: '/incident/:_id/edit',
|
||||||
|
data: function() {
|
||||||
|
Session.set('incidentID', this.params._id);
|
||||||
|
return incidents.findOne(this.params._id);
|
||||||
|
},
|
||||||
template: 'editincidentform',
|
template: 'editincidentform',
|
||||||
layoutTemplate: 'layout'
|
layoutTemplate: 'layout'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
this.route('attackers', {
|
this.route('attackers', {
|
||||||
path: '/incidents/attackers',
|
path: '/incidents/attackers',
|
||||||
template: 'attackers',
|
template: 'attackers',
|
||||||
|
|
Загрузка…
Ссылка в новой задаче