5 <& /util/import_javascript.mas, classes => [ 'jquery', 'thickbox', 'jquery.dataTables' ] &>
7 <& /page/page_title.mas, title => "Image Search" &>
9 <&| /page/info_section.mas, title=>"Image Search Criteria", collapsible => 1, collapsed=>0, subtitle => "All images may not have names, descriptions, or tags associated with them."&>
11 <div id="image_search_form" class="well well-sm">
12 <div class="form-horizontal" >
13 <div class="form-group">
14 <label class="col-sm-6 control-label">Image descriptors (name, description, or filename): </label>
15 <div class="col-sm-6" >
16 <input class="form-control" type="text" id="image_description_filename_composite" name="image_description_filename_composite" placeholder="e.g. MyImageName" />
19 <div class="form-group">
20 <label class="col-sm-6 control-label">Submitter: </label>
21 <div class="col-sm-6" >
22 <input class="form-control" type="text" id="image_submitter" name="image_submitter" placeholder="e.g. JaneDoe" />
25 <div class="form-group">
26 <label class="col-sm-6 control-label">Image tag: </label>
27 <div class="col-sm-6" >
28 <input class="form-control" type="text" id="image_tag" name="image_tag" placeholder="e.g. ImageTagName" />
31 <div class="form-group">
32 <label class="col-sm-6 control-label">Associated stock: </label>
33 <div class="col-sm-6" >
34 <input class="form-control" type="text" id="image_stock_uniquename" name="image_stock_uniquename" placeholder="e.g. FieldPlot100" />
37 <div class="form-group">
38 <label class="col-sm-6 control-label">Associated project: </label>
39 <div class="col-sm-6" >
40 <input class="form-control" type="text" id="image_project_name" name="image_project_name" placeholder="e.g. DroneProject 01/01/2019" />
46 <button class="btn btn-primary" id="image_search_submit" >Search</button>
51 <&| /page/info_section.mas, title=>"Image Search Results", collapsible => 1, collapsed=>0 &>
52 <div class="well well-sm">
53 <div class="panel panel-default">
54 <div class="panel-body">
55 <table id="images_search_results" class="table table-hover table-striped">
58 <th>Image Thumbnail</th>
76 jQuery(document).ready(function () {
78 _load_image_search_results();
80 jQuery("#image_submitter").autocomplete({
81 source: '/ajax/people/autocomplete'
84 jQuery('#image_search_submit').click( function() {
85 _load_image_search_results();
88 jQuery('#image_search_form').keypress( function( e ) {
89 var code = e.keyCode || e.which;
91 jQuery('#image_search_submit').click();
95 jQuery('#images_search_results').on( 'draw.dt', function () {
96 jQuery('a.image_search_group').colorbox();
101 function _load_image_search_results() {
102 images_table = jQuery('#images_search_results').DataTable({
109 'lengthMenu': [10,20,50,100,1000,5000],
110 'ajax': { 'url': '/ajax/search/images',
111 'data': function(d) {
112 d.image_description_filename_composite = jQuery('#image_description_filename_composite').val();
113 d.image_person = jQuery('#image_submitter').val();
114 d.image_tag = jQuery('#image_tag').val();
115 d.image_stock_uniquename = jQuery('#image_stock_uniquename').val();
116 d.image_project_name = jQuery('#image_project_name').val();