Changed default sorting order in campaign tables to show most recent campaigns first. Fixes #426

This commit is contained in:
Jordan Wright 2017-01-06 17:58:36 -06:00
parent b5100156f9
commit 22834c75a6
2 changed files with 10 additions and 4 deletions

View file

@ -241,14 +241,14 @@ function copy(idx) {
})
// Set our initial values
api.campaignId.get(campaigns[idx].id)
.success(function(campaign){
.success(function(campaign) {
$("#name").val("Copy of " + campaign.name)
$("#template").val(campaign.template.name)
$("#page").val(campaign.page.name)
$("#profile").val(campaign.smtp.name)
$("#url").val(campaign.url)
})
.error(function(data){
.error(function(data) {
$("#modal\\.flashes").empty().append("<div style=\"text-align:center\" class=\"alert alert-danger\">\
<i class=\"fa fa-exclamation-circle\"></i> " + data.responseJSON.message + "</div>")
})
@ -312,7 +312,10 @@ $(document).ready(function() {
columnDefs: [{
orderable: false,
targets: "no-sort"
}]
}],
order: [
[1, "desc"]
]
});
$.each(campaigns, function(i, campaign) {
label = labels[campaign.status] || "label-default";

View file

@ -56,7 +56,10 @@ $(document).ready(function() {
columnDefs: [{
orderable: false,
targets: "no-sort"
}]
}],
order: [
[1, "desc"]
]
});
$.each(campaigns, function(i, campaign) {
var campaign_date = moment(campaign.created_date).format('MMMM Do YYYY, h:mm:ss a')