diff --git a/models/campaign.go b/models/campaign.go index debca6ab..bdf463ae 100644 --- a/models/campaign.go +++ b/models/campaign.go @@ -666,5 +666,10 @@ func CompleteCampaign(id int64, uid int64) error { if err != nil { log.Error(err) } + // Add event + err = AddEvent(&Event{Message: "Campaign Completed"}, c.Id) + if err != nil { + log.Error(err) + } return err } diff --git a/static/js/src/app/campaigns.js b/static/js/src/app/campaigns.js index 8a72e70c..e8babd63 100644 --- a/static/js/src/app/campaigns.js +++ b/static/js/src/app/campaigns.js @@ -396,6 +396,7 @@ $(document).ready(function () { " ] if (campaign.status == 'Completed') { + row.splice(2, 0, moment(campaign.completed_date).format('MMMM Do YYYY, h:mm:ss a')); rows['archived'].push(row) } else { rows['active'].push(row) diff --git a/static/js/src/app/dashboard.js b/static/js/src/app/dashboard.js index 66f705a1..402afc1c 100644 --- a/static/js/src/app/dashboard.js +++ b/static/js/src/app/dashboard.js @@ -303,23 +303,23 @@ $(document).ready(function () { }, { className: "color-sent", - targets: [2] - }, - { - className: "color-opened", targets: [3] }, { - className: "color-clicked", + className: "color-opened", targets: [4] }, { - className: "color-success", + className: "color-clicked", targets: [5] }, { - className: "color-reported", + className: "color-success", targets: [6] + }, + { + className: "color-reported", + targets: [7] } ], order: [ @@ -329,6 +329,7 @@ $(document).ready(function () { campaignRows = [] $.each(campaigns, function (i, campaign) { var campaign_date = moment(campaign.created_date).format('MMMM Do YYYY, h:mm:ss a') + var completed_date = () => (campaign.status === "Completed" ? moment(campaign.completed_date).format('MMMM Do YYYY, h:mm:ss a') : '') var label = statuses[campaign.status].label || "label-default"; //section for tooltips on the status of a campaign to show some quick stats var launchDate; @@ -343,6 +344,7 @@ $(document).ready(function () { campaignRows.push([ escapeHtml(campaign.name), campaign_date, + completed_date, campaign.stats.sent, campaign.stats.opened, campaign.stats.clicked, diff --git a/templates/campaigns.html b/templates/campaigns.html index 7c12c9c2..78794631 100644 --- a/templates/campaigns.html +++ b/templates/campaigns.html @@ -61,6 +61,7 @@