aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Florisson2014-09-19 13:53:45 +0200
committerMarc Florisson2014-09-19 13:53:45 +0200
commit8a866d25ca6b622f2e4b87552e2b8088896c1673 (patch)
treec6137bdd8dc3ac909bd36b142d02d4bc6d0065d8
parentff4e748da69889a4441a051c0577b38bbaea3b47 (diff)
downloadchouette-core-8a866d25ca6b622f2e4b87552e2b8088896c1673.tar.bz2
add more js on vehcile_journeys filter
-rw-r--r--app/views/vehicle_journeys/index.html.erb19
1 files changed, 17 insertions, 2 deletions
diff --git a/app/views/vehicle_journeys/index.html.erb b/app/views/vehicle_journeys/index.html.erb
index dd1cfa301..0f643b3ea 100644
--- a/app/views/vehicle_journeys/index.html.erb
+++ b/app/views/vehicle_journeys/index.html.erb
@@ -23,14 +23,21 @@
<div id="advanced_search" class="panel-collapse collapse">
<div class="panel-body">
+ <div>
<%= f.label :time_tables_id_not_eq, "Sans calendrier" %>
<%= f.check_box :time_tables_id_not_eq %>
- <%= f.label :vehicle_journey_at_stops_departure_time_gt, "Sélectionner calendriers" %>
- <%= f.text_field :time_tables_id_eq, :input_html => { :"data-pre" => [].to_json} %>
+ <span class="time_tables_id_eq">
+ <%= f.label :time_tables_id_eq, "Sélectionner calendriers" %>
+ <%= f.text_field :time_tables_id_eq, :input_html => { :"data-pre" => [].to_json} %>
+ </span>
+ </div>
+ <div>
<%= f.label :vehicle_journey_at_stops_departure_time_not_eq, "Sans horaire" %>
<%= f.check_box :vehicle_journey_at_stops_departure_time_not_eq %>
+
+ <span class="vehicle_journey_at_stops_departure_time_gt">
<input name=<%= "q[vehicle_journey_at_stops_departure_time_gt(3i)]" %> type="hidden" value="1">
<input name=<%= "q[vehicle_journey_at_stops_departure_time_gt(2i)]" %> type="hidden" value="1">
<input name=<%= "q[vehicle_journey_at_stops_departure_time_gt(1i)]" %> type="hidden" value="2000">
@@ -39,6 +46,8 @@
:prefix => "q", :field_name => "vehicle_journey_at_stops_departure_time_gt(4i)") %>
<%= select_minute(@q.send( "vehicle_journey_at_stops_departure_time_gt") ? @q.send( "vehicle_journey_at_stops_departure_time_gt").min : 0,
:prefix => "q", :field_name => "vehicle_journey_at_stops_departure_time_gt(5i)") %>
+ </span>
+ </div>
</div>
</div>
</div>
@@ -75,5 +84,11 @@
searchingText: '<%= t('searching_term') %>',
resultsFormatter: function(item){ return '<li><div class=\"name\">' + item.name + ', (' + item.id + ') </div></li>' },
});
+ $( 'input[name="q[time_tables_id_not_eq]"]').change( function(){
+ $('span.time_tables_id_eq').toggle( $(this).filter(":checked").val()==undefined);
+ });
+ $( 'input[name="q[vehicle_journey_at_stops_departure_time_not_eq]"]').change( function(){
+ $('span.vehicle_journey_at_stops_departure_time_gt').toggle( $(this).filter(":checked").val()==undefined);
+ });
});
</script>