5 $breeding_program => undef
7 $identifier_prefix => ''
8 $type_select_options => undef
15 <& /util/import_javascript.mas, classes => [ 'jquery', 'jquery/dataTables', 'CXGN.BreedersToolbox.HTMLSelect.js', 'CXGN.List' ] &>
18 % my @column_headers = @$activity_headers;
19 % my @activity_types = @$type_select_options;
21 <& /page/page_title.mas, title => "Tracking Activities of '$identifier_name'" &>
23 <& /util/import_javascript.mas, classes => ['jquery','jquery.dataTables'] &>
24 <& /util/import_css.mas, paths => ['/documents/inc/datatables/jquery.dataTables.css'] &>
26 <&| /page/info_section.mas, title => 'Record', collapsible => 1, collapsed => 0, subtitle => '' &>
28 <form class="form-horizontal" >
29 <div class="form-group">
30 <label class="col-sm-3 control-label">Material: </label>
31 <div class="col-sm-5">
32 <input class="form-control" id="material_info" name="material_info" type="text" disabled value="<%$material_name%>">
35 <div class="form-group">
36 <label class="col-sm-3 control-label">Type: </label>
37 <div class="col-sm-5">
38 % if ($type_select_options) {
39 <select id="type_select">
40 <option value="">Please select a type</option>
41 % foreach my $type(@$type_select_options){
42 <option value="<%$type->[0]%>"><%$type->[1]%></option>
48 <div class="form-group">
49 <label class="col-sm-3 control-label">Input: </label>
50 <div class="col-sm-5">
51 <input class="form-control" id="selected_type_input" name="selected_type_input" type="text" value="">
54 <div class="form-group">
55 <label class="col-sm-3 control-label">Notes:</label>
56 <div class="col-sm-5">
57 <textarea class="form-control" id="selected_type_notes" name="selected_type_notes" ></textarea>
60 <div class="form-group">
61 <label class="col-sm-3 control-label">Timestamp: </label>
62 <div class="col-sm-5">
63 <input class="form-control" id="record_timestamp" name="record_timestamp" type="text" disabled value="<%$timestamp%>">
67 <button id="activity_info_submit" name="activity_info_submit" class="btn btn-primary">Save</button>
73 <&| /page/info_section.mas, title => 'Summary', collapsible => 1, collapsed => 0, subtitle => '' &>
74 <div class = "well well-sm">
75 <div class = "panel panel-default">
76 <div class = "panel-body">
77 <div style="overflow:scroll">
78 <table id = "activity_summary_table" class="table table-hover table-striped">
81 % foreach my $header(@column_headers){
93 <&| /page/info_section.mas, title => 'Activity Details', collapsible => 1, collapsed => 0, subtitle => '' &>
94 <div class = "well well-sm">
95 <div class = "panel panel-default">
96 <div class = "panel-body">
97 <div style="overflow:scroll">
98 <table id = "activity_info_table" class="table table-hover table-striped">
101 % foreach my $header(@column_headers){
113 <div class="modal fade" id="info_saved_dialog_message" name="info_saved_dialog_message" tabindex="-1" role="dialog" aria-labelledby="infoSavedDialog">
114 <div class="modal-dialog" role="document">
115 <div class="modal-content">
116 <div class="modal-header">
117 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
118 <h4 class="modal-title" id="infoSavedDialog">Success</h4>
120 <div class="modal-body">
121 <div class="container-fluid">
123 <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
124 New information was saved.
128 <div class="modal-footer">
129 <button id="dismiss_info_saved_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close & Reload</button>
138 jQuery(document).ready( function() {
140 var identifier_id = "<%$identifier_id%>";
142 jQuery('#activity_info_table').DataTable({
145 'ajax': '/ajax/tracking_activity/details/'+identifier_id,
148 jQuery('#activity_summary_table').DataTable({
155 'ajax': '/ajax/tracking_activity/summary/'+identifier_id,
158 jQuery('#activity_info_submit').click( function(e) {
160 var selected_type = jQuery('#type_select').val();
161 var input = jQuery('#selected_type_input').val();
162 var record_timestamp = jQuery('#record_timestamp').val();
163 var notes = jQuery('#selected_type_notes').val();
165 if (selected_type == '') {
166 alert("Please select a type");
170 alert("Please provide an input");
175 url: '/ajax/tracking_activity/save',
179 'tracking_identifier' : "<%$identifier_name%>",
180 'selected_type': selected_type,
182 'record_timestamp': record_timestamp,
185 beforeSend: function(response){
186 jQuery('#working_modal').modal('show');
188 success: function(response) {
189 jQuery('#working_modal').modal('hide');
190 if (response.success == 1) {
191 jQuery('#info_saved_dialog_message').modal("show");
193 if (response.error) {
194 alert(response.error);
197 error: function(response){
198 jQuery('#working_modal').modal('hide');
199 alert('An error occurred saving new information');
204 jQuery("#dismiss_info_saved_dialog").click(function(){
205 jQuery('#type_select').val('');
206 jQuery('#selected_type_input').val('');
207 jQuery('#selected_type_notes').val('');