diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 610f52e..c95b4f4 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -1,93 +1,95 @@ // This is a manifest file that'll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. // // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the // compiled file. // // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details // about supported directives. // //= require jquery.min //= require jquery_ujs //= require jquery-ui.min //= require bootstrap.min //= require jstree //= require chosen.jquery.min +//= require jquery.dataTables.min +//= require dataTables.bootstrap.min //= require_tree . //= require highcharts //= require jobs //= require filesets //= require clients $(document).ready(function() { if ($('.schedule_run_form_plus').size() > 0) { $(".schedule_run_form_plus").click(function() { addScheduleRun(); return false; }); }; if ($('.schedule_run_form_remove').size() > 0) { $(".schedule_run_form_remove").click(function() { removeScheduleRun(); return false; }); }; if ($('.schedule_run_form').size() > 1) { $('.schedule_run_form_remove').show(); }; }); function addScheduleRun() { var count = $('.schedule_run_form').size(); var scheduleRun = $('.schedule_run_form:last').clone(); $(scheduleRun).find('label').each(function() { var newLabel, oldLabel; oldLabel = $(this).attr('for'); newLabel = oldLabel.replace(new RegExp(/_[0-9]+_/), "_" + count + "_"); $(this).attr('for', newLabel); }); $(scheduleRun).find('select, input').each(function() { var newId, oldId, newName, oldName; oldId = $(this).attr('id'); newId = oldId.replace(new RegExp(/_[0-9]+_/), "_" + count + "_"); $(this).attr('id', newId); oldName = $(this).attr('name'); newName = oldName.replace(new RegExp(/[0-9]+/), "[" + count + "]"); $(this).attr('name', newName); }); scheduleRun.insertAfter('.schedule_run_form:last'); $('.schedule_run_form:last input').val(''); if (count > 0) { $(".schedule_run_form_remove").show(); }; $('.destroyer:last').remove(); } function removeScheduleRun() { var count = $('.schedule_run_form').size(); if (count > 1) { var last_id = count - 1; $('').attr({ type: 'hidden', class: 'destroyer', id: 'schedule_schedule_runs_attributes_' + last_id + '__destroy', name: 'schedule[schedule_runs_attributes][' + last_id + '][_destroy]', value: '1' }).appendTo('form'); $('.schedule_run_form:last').remove(); if ($('.schedule_run_form').size() == 1) { $(".schedule_run_form_remove").hide(); }; } else { alert('nothing to remove'); }; } diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 3044266..31a0c81 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1,73 +1,78 @@ /* * This is a manifest file that'll be compiled into application.css, which will include all the files * listed below. * * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. * * You're free to add application-wide styles to this file and they'll appear at the bottom of the * compiled file so the styles you add here take precedence over styles defined in any styles * defined in the other CSS/SCSS files in this directory. It is generally better to create a new * file per style scope. * *= require bootstrap.min *= require jstree-default *= require bootstrap-chosen + *= require dataTables.bootstrap.min *= require_tree . *= require_self */ /* Make sure navbar does not overlay body */ body { padding-top: 70px; } .right { text-align: right; margin-right: 0px; float: right; } .graybox { max-width: 500px; margin-right: 0; margin-left: 0; background-color: #F7F7F9; margin-bottom: 30px; } .graybox form { padding-top: 30px; } #_days_back { margin: auto 10px; } tr.fatal > td { background-color: #EA7272; } tr.fatal > td { background-color: #EA7272; } li.logo { } li.logo > a { padding-left: 60px; background: url('/images/logo.png') no-repeat scroll 4px 5px; padding-top: 5px; padding-bottom: 5px; } li.logo > a > p { font-size: 13px; margin-bottom: 0; color: #333333px; } .jstree-closed > a > i.jstree-checkbox, .jstree-open > a > i.jstree-checkbox { display: none; } + +.datatable-wrapper { + margin-bottom: 20px; +} diff --git a/vendor/assets/javascripts/dataTables.bootstrap.min.js b/vendor/assets/javascripts/dataTables.bootstrap.min.js new file mode 100644 index 0000000..7ae847b --- /dev/null +++ b/vendor/assets/javascripts/dataTables.bootstrap.min.js @@ -0,0 +1,9 @@ +/*! + DataTables Bootstrap 3 integration + ©2011-2015 SpryMedia Ltd - datatables.net/license +*/ +(function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return b(a,window,document)}):"object"===typeof exports?module.exports=function(a,e){a||(a=window);if(!e||!e.fn.dataTable)e=require("datatables.net")(a,e).$;return b(e,a,a.document)}:b(jQuery,window,document)})(function(b,a,e){var d=b.fn.dataTable;b.extend(!0,d.defaults,{dom:"<'row'<'col-sm-6'l><'col-sm-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-5'i><'col-sm-7'p>>",renderer:"bootstrap"});b.extend(d.ext.classes, +{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm",sProcessing:"dataTables_processing panel panel-default"});d.ext.renderer.pageButton.bootstrap=function(a,h,r,m,j,n){var o=new d.Api(a),s=a.oClasses,k=a.oLanguage.oPaginate,t=a.oLanguage.oAria.paginate||{},f,g,p=0,q=function(d,e){var l,h,i,c,m=function(a){a.preventDefault();!b(a.currentTarget).hasClass("disabled")&&o.page()!=a.data.action&&o.page(a.data.action).draw("page")}; +l=0;for(h=e.length;l",{"class":s.sPageButton+" "+g,id:0===r&&"string"===typeof c?a.sTableId+"_"+c:null}).append(b("",{href:"#", +"aria-controls":a.sTableId,"aria-label":t[c],"data-dt-idx":p,tabindex:a.iTabIndex}).html(f)).appendTo(d),a.oApi._fnBindAction(i,{action:c},m),p++)}},i;try{i=b(h).find(e.activeElement).data("dt-idx")}catch(u){}q(b(h).empty().html('