diff --git a/meteor/app/client/incidentEdit.html b/meteor/app/client/incidentEdit.html index b09c56b4..a9c9357f 100644 --- a/meteor/app/client/incidentEdit.html +++ b/meteor/app/client/incidentEdit.html @@ -31,7 +31,6 @@ Jeff Bryner jbryner@mozilla.com {{>veristags}} - {{#with incident}}
Edit Incident
@@ -120,7 +119,5 @@ Jeff Bryner jbryner@mozilla.com
- {{/with}} - diff --git a/meteor/app/client/mozdef.js b/meteor/app/client/mozdef.js index cf958ded..1070ff5a 100644 --- a/meteor/app/client/mozdef.js +++ b/meteor/app/client/mozdef.js @@ -96,8 +96,7 @@ if (Meteor.isClient) { "click": function(e,t){ if (this._id != undefined){ Session.set('displayMessage','Starting edit for incident._id: ' + this._id); - Session.set('incidentID',this._id); - Router.go('/incidents/edit') + Router.go('/incident/' + this._id + '/edit'); } } }); @@ -133,18 +132,18 @@ if (Meteor.isClient) { "drop .tags": function(e){ e.preventDefault(); //console.log(e) - tagtext=e.originalEvent.dataTransfer.getData("text/plain") + tagtext = e.originalEvent.dataTransfer.getData("text/plain"); //e.target.textContent=droptag //console.log(tagtext) - incidents.update(Session.get('incidentID'),{ - $addToSet:{tags:tagtext} + incidents.update(Session.get('incidentID'), { + $addToSet: {tags:tagtext} }); }, "click .tagdelete": function(e){ - tagtext=e.target.parentNode.firstChild.wholeText; - incidents.update(Session.get('incidentID'),{ - $pull:{tags:tagtext} + tagtext = e.target.parentNode.firstChild.wholeText; + incidents.update(Session.get('incidentID'), { + $pull: {tags:tagtext} }); }, @@ -153,7 +152,7 @@ if (Meteor.isClient) { // tags are saved in realtime - incidents.update(Session.get('incidentID'),{$set:{ + incidents.update(Session.get('incidentID'), {$set: { summary: template.find("#incidentSummary").value, dateOpened: template.find("#dateOpened").value, dateClosed: template.find("#dateClosed").value, @@ -177,7 +176,7 @@ if (Meteor.isClient) { Template.editincidentform.rendered = function() { if (typeof console !== 'undefined') { - console.log('load edit incident form') + console.log('load edit incident form ' + Session.get('incidentID')); } $('#dateClosed').daterangepicker({ singleDatePicker: true, diff --git a/meteor/app/router/router.js b/meteor/app/router/router.js index 4cd29162..295fae15 100644 --- a/meteor/app/router/router.js +++ b/meteor/app/router/router.js @@ -33,7 +33,6 @@ Router.map(function () { layoutTemplate: 'layout' }); - this.route('incidentnew', { path: '/incidents/new', template: 'addincidentform', @@ -41,11 +40,16 @@ Router.map(function () { }); 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', layoutTemplate: 'layout' }); + this.route('attackers', { path: '/incidents/attackers', template: 'attackers',