Skip to content

Commit

Permalink
[0.2.1] Adds TableTools extension to copy, save, print table
Browse files Browse the repository at this point in the history
README.md edited online with Bitbucket

README.md edited online with Bitbucket
  • Loading branch information
priscillamc committed Jul 8, 2015
1 parent a0f7d28 commit 0350fc2
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# UF CLAS Admin Tools #

This is still a work in progress!

## To-Do List

* Initial Admin page is blank, add an overview screen with total counts
* There aren't any hooks when info is updated. Need a button to clear the transient manually
* Domain-mapped links end up being https instead of http, might just link title to dashboard or force http scheme
* Blank page when loading a huge list of sites. Need a loading message/spinner
* Path is blank for the main site. Need to stop trimming the / from path

## Features to Add ##

* Need to add a screen to list active forms (identify fields for possible restricted info?)
* Need to add a screen for archived/deleted sites to clean up
* Need to add a screen for users and roles for audits

## Notes ##

* Saving data into separate transient arrays so each screen can reuse the main site list
* Handling data for a network with hundreds of sites?
9 changes: 8 additions & 1 deletion js/ufclas-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ jQuery(function($){
// Use WordPress to fetch data
$.post(ajaxurl, data, function(response) {
// Display data in a customizable table
$('#info-table').DataTable({ 'data': JSON.parse(response) });
$('#info-table').DataTable({
'data': JSON.parse(response),
'dom': 'T<"clear">lfrtip',
'tableTools': {
'sSwfPath': ufca_data.plugin_url + '/lib/jquery.datatables/copy_csv_xls.swf',
'aButtons': [ "copy", "csv", "print" ]
}
});
$('#info-table').fadeIn('fast');
});
});
11 changes: 6 additions & 5 deletions ufclas-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: UF CLAS - Admin Tools
Plugin URI: https://it.clas.ufl.edu/
Description: Management Tools for UF CLAS.
Version: 0.2.0
Version: 0.2.1
Author: Priscilla Chapman (CLAS IT)
Author URI: https://it.clas.ufl.edu/
License: GPL2
Expand Down Expand Up @@ -32,17 +32,18 @@ function ufclas_admin_register_menu(){
function ufclas_admin_scripts( $hook ) {
// Site info page
if ( 'clas-admin_page_ufclas-admin-info' == $hook ) {
// Datatables scripts and styles
// Datatables, TableTools scripts and styles
wp_enqueue_style( 'datatables', '//cdn.datatables.net/1.10.7/css/jquery.dataTables.min.css', array(), '1.10.7', 'screen');
wp_enqueue_script( 'datatables', '//cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js', array('jquery'), '1.10.7', true);
//wp_enqueue_style( 'datatables', plugins_url( '/lib/jquery.datatables/jquery.dataTables.min.css', __FILE__ ), array(), '1.10.7', 'screen');
//wp_enqueue_script( 'datatables', plugins_url( '/lib/jquery.datatables/jquery.dataTables.min.js', __FILE__ ), array('jquery'), '1.10.7', true);
wp_enqueue_style( 'tabletools', '//cdn.datatables.net/tabletools/2.2.4/css/dataTables.tableTools.css', array('datatables'), '2.2.4', 'screen');
wp_enqueue_script( 'tabletools', '//cdn.datatables.net/tabletools/2.2.4/js/dataTables.tableTools.min.js', array('jquery','datatables'), '2.2.4', true);

// Plugin scripts and files
wp_enqueue_style( 'ufclas-admin', plugins_url( '/css/ufclas-admin.css' , __FILE__ ), array('datatables'), '', 'screen');
wp_enqueue_script( 'ufclas-admin', plugins_url( '/js/ufclas-admin.js' , __FILE__ ), array('datatables'), '', true);
wp_localize_script('ufclas-admin', 'ufca_data', array(
'site_info_nonce' => wp_create_nonce( "ufca-get-site-info")
'site_info_nonce' => wp_create_nonce( "ufca-get-site-info"),
'plugin_url' => plugins_url( '' , __FILE__ )
));
}
}
Expand Down

0 comments on commit 0350fc2

Please sign in to comment.