diff --git a/static/css/main.css b/static/css/main.css
index dcdb603b..cc79ef62 100644
--- a/static/css/main.css
+++ b/static/css/main.css
@@ -341,3 +341,33 @@
float:none !important;
}
}
+/* Table Styling */
+.modal-content .dataTable tbody td {
+ font-size: 16px;/* Smaller font on modal tables */
+}
+.dataTables_info{
+ font-size: 15px;
+}
+
+/* Sort Icons */
+table.dataTable thead .sorting:after, table.dataTable thead .sorting_asc:after, table.dataTable thead .sorting_desc:after {
+ font-family: 'FontAwesome' !important;
+ position: relative !important;
+ display: initial !important;
+ top: initial!important;
+ right: initial!important;
+ left: 6px;
+ color: #1abc9c;
+}
+table.dataTable thead .sorting:after{
+ content: "\f0dc" !important;
+ color: initial;
+}
+table.dataTable thead .sorting_asc:after {
+ content: "\f0de" !important;
+ opacity: .8 !important;
+}
+table.dataTable thead .sorting_desc:after {
+ content: "\f0dd" !important;
+ opacity: .8 !important;
+}
diff --git a/static/js/app/campaigns.js b/static/js/app/campaigns.js
index 3c5e18a2..dafce85d 100644
--- a/static/js/app/campaigns.js
+++ b/static/js/app/campaigns.js
@@ -106,6 +106,12 @@ $(document).ready(function() {
api.campaigns.get()
.success(function(cs) {
campaigns = cs
+ campaignTable = $("#campaignTable").DataTable({
+ columnDefs: [{
+ orderable: false,
+ targets: "no-sort"
+ }]
+ });
$("#loading").hide()
if (campaigns.length > 0) {
$("#campaignTable").show()
@@ -146,7 +152,12 @@ $(document).ready(function() {
return false;
})
// Create the group typeahead objects
- groupTable = $("#groupTable").DataTable()
+ groupTable = $("#groupTable").DataTable({
+ columnDefs: [{
+ orderable: false,
+ targets: "no-sort"
+ }]
+ })
group_bh = new Bloodhound({
datumTokenizer: function(g) {
return Bloodhound.tokenizers.whitespace(g.name)
diff --git a/static/js/app/dashboard.js b/static/js/app/dashboard.js
index 7eac0080..f997caaa 100644
--- a/static/js/app/dashboard.js
+++ b/static/js/app/dashboard.js
@@ -50,7 +50,11 @@ $(document).ready(function() {
showLabel: false
}
var average = 0
- campaignTable = $("#campaignTable").DataTable();
+ campaignTable = $("#campaignTable").DataTable({
+ columnDefs: [
+ { orderable: false, targets: "no-sort" }
+ ]
+ });
$.each(campaigns, function(i, campaign) {
var campaign_date = moment(campaign.created_date).format('MMMM Do YYYY h:mm:ss a')
var label = labels[campaign.status] || "label-default";
diff --git a/static/js/app/landing_pages.js b/static/js/app/landing_pages.js
index c2df241e..550048b4 100644
--- a/static/js/app/landing_pages.js
+++ b/static/js/app/landing_pages.js
@@ -95,7 +95,13 @@ function load() {
$("#loading").hide()
if (pages.length > 0) {
$("#pagesTable").show()
- pagesTable = $("#pagesTable").DataTable();
+ pagesTable = $("#pagesTable").DataTable({
+ destroy: true,
+ columnDefs: [{
+ orderable: false,
+ targets: "no-sort"
+ }]
+ });
pagesTable.clear()
$.each(pages, function(i, page) {
pagesTable.row.add([
diff --git a/static/js/app/templates.js b/static/js/app/templates.js
index 6f487e73..b3e7245a 100644
--- a/static/js/app/templates.js
+++ b/static/js/app/templates.js
@@ -80,7 +80,19 @@ function deleteTemplate(idx) {
}
function attach(files) {
- attachmentsTable = $("#attachmentsTable").DataTable();
+ attachmentsTable = $("#attachmentsTable").DataTable({
+ destroy: true,
+ "order": [
+ [1, "asc"]
+ ],
+ columnDefs: [{
+ orderable: false,
+ targets: "no-sort"
+ }, {
+ sClass: "datatable_hidden",
+ targets: [3, 4]
+ }]
+ });
$.each(files, function(i, file) {
var reader = new FileReader();
/* Make this a datatable */
@@ -111,17 +123,19 @@ function edit(idx) {
})
$("#html_editor").ckeditor()
$("#attachmentsTable").show()
- attachmentsTable = null
- if ($.fn.dataTable.isDataTable('#attachmentsTable')) {
- attachmentsTable = $('#attachmentsTable').DataTable();
- } else {
- attachmentsTable = $("#attachmentsTable").DataTable({
- "aoColumnDefs": [{
- "targets": [3, 4],
- "sClass": "datatable_hidden"
- }]
- });
- }
+ attachmentsTable = $('#attachmentsTable').DataTable({
+ destroy: true,
+ "order": [
+ [1, "asc"]
+ ],
+ columnDefs: [{
+ orderable: false,
+ targets: "no-sort"
+ }, {
+ sClass: "datatable_hidden",
+ targets: [3, 4]
+ }]
+ });
var template = {
attachments: []
}
@@ -185,7 +199,13 @@ function load() {
$("#loading").hide()
if (templates.length > 0) {
$("#templateTable").show()
- templateTable = $("#templateTable").DataTable();
+ templateTable = $("#templateTable").DataTable({
+ destroy: true,
+ columnDefs: [{
+ orderable: false,
+ targets: "no-sort"
+ }]
+ });
templateTable.clear()
$.each(templates, function(i, template) {
templateTable.row.add([
diff --git a/static/js/app/users.js b/static/js/app/users.js
index c2a62dab..db591429 100644
--- a/static/js/app/users.js
+++ b/static/js/app/users.js
@@ -53,7 +53,13 @@ function dismiss() {
}
function edit(idx) {
- targets = $("#targetsTable").dataTable()
+ targets = $("#targetsTable").dataTable({
+ destroy: true, // Destroy any other instantiated table - http://datatables.net/manual/tech-notes/3#destroy
+ columnDefs: [{
+ orderable: false,
+ targets: "no-sort"
+ }]
+ })
$("#modalSubmit").unbind('click').click(function() {
save(idx)
})
@@ -122,7 +128,13 @@ function load() {
groups = gs
$("#emptyMessage").hide()
$("#groupTable").show()
- groupTable = $("#groupTable").DataTable();
+ groupTable = $("#groupTable").DataTable({
+ destroy: true,
+ columnDefs: [{
+ orderable: false,
+ targets: "no-sort"
+ }]
+ });
groupTable.clear();
$.each(groups, function(i, group) {
var targets = ""
diff --git a/templates/campaigns.html b/templates/campaigns.html
index 16732340..28ab8fea 100644
--- a/templates/campaigns.html
+++ b/templates/campaigns.html
@@ -47,7 +47,7 @@
Name |
Created Date |
Status |
- |
+ |
@@ -113,7 +113,7 @@
diff --git a/templates/dashboard.html b/templates/dashboard.html
index 3d652870..52083259 100644
--- a/templates/dashboard.html
+++ b/templates/dashboard.html
@@ -67,7 +67,7 @@
Name |
Created Date |
Status |
- |
+ |
diff --git a/templates/landing_pages.html b/templates/landing_pages.html
index 837307ad..6efe51f8 100644
--- a/templates/landing_pages.html
+++ b/templates/landing_pages.html
@@ -44,7 +44,7 @@
Name |
Last Modified Date |
- |
+ |
diff --git a/templates/templates.html b/templates/templates.html
index 70fde2d6..5be682f1 100644
--- a/templates/templates.html
+++ b/templates/templates.html
@@ -46,7 +46,7 @@
Name |
Modified Date |
- |
+ |
@@ -102,11 +102,11 @@
- |
+ |
Name |
- |
- Content |
- Type |
+ |
+ Content |
+ Type |
diff --git a/templates/users.html b/templates/users.html
index da1b731e..006c76a6 100644
--- a/templates/users.html
+++ b/templates/users.html
@@ -47,7 +47,7 @@
Name |
Members |
Modified Date |
- |
+ |
@@ -94,14 +94,14 @@
-
+
First Name |
Last Name |
Email |
Position |
- |
+ |