4 /about/audit.mas- display organism search results and search form
12 optional L<DBIx::Class::ResultSet> object for the set of results to
13 display. if not set or not passed, only the search form will be
18 required L<HTML::FormFu> form object for the search form. will call
19 C<$form->render> on this.
21 =head2 pagination_link_maker
23 subroutine reference that takes a single integer page number for the
24 results and returns the appropriate URL for going to that page of results
36 <& /page/page_title.mas, title=>"Database Audit Tables" &>
38 <div class="container-fluid">
46 <!--here is where I pasted in the drop down and search code -->
48 <& /util/import_javascript.mas, classes => [ 'jquery', 'jquery.dataTables' ] &>
50 <div class="well well-sm">
51 <div class="panel panel-default">
52 <div class="panel-body">
53 <div class="col-sm-1">
56 <div class="col-sm-11">
57 <div class="form-horizontal">
58 <div class="form-group">
59 <label class="control-label col-sm-4">Select a database table to see audits:</label>
60 <div class="col-sm-8" >
61 <div class="input-group">
62 <select class="form-control" id="db_table_list_select">
64 <div class="input-group-btn">
65 <button class="btn btn-info" id="search_audit_button"><i class="glyphicon glyphicon-search"></i> View audits </button>
75 <div class="panel panel-default">
76 <div class="panel-body">
77 <&| /page/info_section.mas, title=>"Audit table", is_subsection => 1, collapsible=>1, collapsed=>0 &>
78 <table class="table table-hover table-bordered" id="audit_results">
89 jQuery(document).ready(function(){
92 url: '/ajax/audit/retrieve_table_names',
93 success: function(response){
94 var json_names = JSON.parse(response.result1);
95 for (var i=0; i<json_names.length; i++){
96 var opt = json_names[i];
97 var displayname = opt.replace("_audit","");
98 jQuery("select#db_table_list_select").append(jQuery("<option>")
105 jQuery("#search_audit_button").click(function(){
106 if ( jQuery.fn.dataTable.isDataTable( '#audit_results' ) ) {
107 table = jQuery('#audit_results').DataTable();
110 var db_table_list_id = jQuery('#db_table_list_select').find(":selected").val();
112 url: '/ajax/audit/retrieve_results',
113 data: {'db_table_list_id':db_table_list_id},
115 success: function(response){
117 var all_audits = response.result;
120 var json_object = JSON.parse(all_audits);
122 jQuery('#audit_results').DataTable({
125 { title: 'Timestamp' },
126 { title: 'Operation' },
127 { title: 'Username' },
128 { title: 'Logged in User' },
131 { title: 'Transaction Code'},
132 { title: 'Primary Key'},
135 "rowCallback" : function (row, data, index){
136 if(data[1] == "INSERT"){
137 jQuery('td', row).css('background-color', 'HoneyDew');
139 if(data[1] == "UPDATE"){
140 jQuery('td',row).css('background-color', 'LightCyan');
142 if(data[1] == "DELETE"){
143 jQuery('td',row).css('background-color', 'LightSalmon');
162 use CXGN::Page::FormattingHelpers qw/ columnar_table_html /;