aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Etienne2012-07-03 09:42:16 +0200
committerMichel Etienne2012-07-03 09:42:16 +0200
commit38ff8bd04f55b38db3fa1332a52d7659e28f1f94 (patch)
tree460f147cbfd96242639ae8c2a18eb325b80499a0
parent7dad4f8d04be2f05e298c60228c31a0ee026db14 (diff)
downloadchouette-core-38ff8bd04f55b38db3fa1332a52d7659e28f1f94.tar.bz2
correct multiple select and conbined filters
-rw-r--r--app/assets/stylesheets/lines.css.scss3
-rw-r--r--app/assets/stylesheets/multiple_selection.scss10
-rw-r--r--app/views/lines/_line.erb4
-rw-r--r--app/views/stop_areas/index.html.erb1
-rw-r--r--app/views/vehicle_journeys/_form.html.erb50
-rw-r--r--app/views/vehicle_journeys/_time_filter.html.erb2
6 files changed, 40 insertions, 30 deletions
diff --git a/app/assets/stylesheets/lines.css.scss b/app/assets/stylesheets/lines.css.scss
index f66f8badd..c4ddcc9f7 100644
--- a/app/assets/stylesheets/lines.css.scss
+++ b/app/assets/stylesheets/lines.css.scss
@@ -44,6 +44,9 @@
font-weight: bold;
padding-top: 21px;
}
+ .name a {
+ display: inline;
+ }
}
}
diff --git a/app/assets/stylesheets/multiple_selection.scss b/app/assets/stylesheets/multiple_selection.scss
index 02f0dc513..6a5bdd54f 100644
--- a/app/assets/stylesheets/multiple_selection.scss
+++ b/app/assets/stylesheets/multiple_selection.scss
@@ -1,8 +1,8 @@
-input[type=checkbox].multiple_selection {
- margin-left: 0px;
- position: absolute;
- top: 0px;
-}
+// input[type=checkbox].multiple_selection {
+// margin-left: 0px;
+// position: absolute;
+// top: 0px;
+// }
#multiple_selection_menu {
h3 {
diff --git a/app/views/lines/_line.erb b/app/views/lines/_line.erb
index 3565966fb..a3b5c1b86 100644
--- a/app/views/lines/_line.erb
+++ b/app/views/lines/_line.erb
@@ -6,8 +6,10 @@
<% end %>
</div>
<% end %>
+ <div class="name">
<%= check_box_tag "ids[]", line.id, false, :class => "multiple_selection", :style => "display: none;" %>
- <%= link_to truncate(line.name, :length => 30), [@referential, line], :title => "Ligne #{line.name}" %>
+ <%= link_to truncate(line.name, :length => 30), [@referential, line], :title => "Ligne #{line.name}"%>
+ </div>
<div class="info">
<%= line.human_attribute_name('network') %> <%= link_to_if line.network, line.network.name, referential_network_path(@referential, line.network), :title => "#{line.human_attribute_name('network')} #{line.network.name}" %> -
<%= line.human_attribute_name('company') %> <%= link_to_if( line.company, line.company.name, referential_company_path(@referential, line.company), :title => "#{line.human_attribute_name('company')} #{line.company.name}" ) %>
diff --git a/app/views/stop_areas/index.html.erb b/app/views/stop_areas/index.html.erb
index d40f0d646..0d2a925cc 100644
--- a/app/views/stop_areas/index.html.erb
+++ b/app/views/stop_areas/index.html.erb
@@ -3,6 +3,7 @@
<%= search_form_for @q, :url => referential_stop_areas_path(@referential), :html => {:method => :get} do |f| %>
<%= f.label :name_or_country_code_cont, "#{t('.name_or_country_code')} :" %>
<%= f.text_field :name_or_country_code_cont %>
+ <%= f.hidden_field :area_type_eq %>
<%= f.submit t('actions.search') %> <%= t("or") %>
<%= link_to t("cancel"), referential_stop_areas_path(@referential) %>
diff --git a/app/views/vehicle_journeys/_form.html.erb b/app/views/vehicle_journeys/_form.html.erb
index 6258d634a..dada2c6ff 100644
--- a/app/views/vehicle_journeys/_form.html.erb
+++ b/app/views/vehicle_journeys/_form.html.erb
@@ -3,37 +3,39 @@
<%= form.input :journey_pattern, :as => :select, :collection => @route.journey_patterns, :include_blank => false, :member_label => Proc.new { |jp| journey_name(jp) } %>
<%= form.input :published_journey_name %>
<%= form.input :published_journey_identifier %>
- <%= form.input :comment %>
+ <%= form.input :comment %>
<%= form.input :transport_mode, :as => :select, :collection => Chouette::Line.transport_modes, :include_blank => true, :member_label => Proc.new { |mode| t("transport_modes.label.#{mode}") } %>
<%= form.input :status_value %>
<%= form.input :facility %>
<%= form.input :vehicle_type_identifier%>
<%= form.input :objectid, :input_html => { :disabled => !@vehicle_journey.new_record? } %>
- <%= form.inputs :class => "stop_times", :name => @vehicle_journey.human_attribute_name(:vehicle_journey_at_stop_ids) do %>
- <table border="0" class="vehicle_journey_at_stops">
- <thead>
- <tr>
- <th class="hour title"><%= t('.arrival') %></th>
- <th class="stop title" ><%= t('.stop_title') %></th>
- <th class="hour title"><%= t('.departure') %></th>
- </tr>
- </thead>
- <!--
- <= form.semantic_fields_for :vehicle_journey_at_stops do |vjas| >
- <= vjas.object.stop_point.stop_area.name >
- <= vjas.input :_destroy, :as => :hidden >
- <= vjas.input :departure_time, :as => :time >
-
- < end >
- -->
- <tbody class="journey_pattern_dependent_list">
- <%= render :partial => "vehicle_journeys/vehicle_journey_at_stop_fields",
- :collection => @vehicle_journey.vehicle_journey_at_stops, :as => :vehicle_journey_at_stop %>
- </tbody>
- </table>
+ <% if !@vehicle_journey.new_record? %>
+ <%= form.inputs :class => "stop_times", :name => @vehicle_journey.human_attribute_name(:vehicle_journey_at_stop_ids) do %>
+ <table border="0" class="vehicle_journey_at_stops">
+ <thead>
+ <tr>
+ <th class="hour title"><%= t('.arrival') %></th>
+ <th class="stop title" ><%= t('.stop_title') %></th>
+ <th class="hour title"><%= t('.departure') %></th>
+ </tr>
+ </thead>
+ <!--
+ <= form.semantic_fields_for :vehicle_journey_at_stops do |vjas| >
+ <= vjas.object.stop_point.stop_area.name >
+ <= vjas.input :_destroy, :as => :hidden >
+ <= vjas.input :departure_time, :as => :time >
+
+ < end >
+ -->
+ <tbody class="journey_pattern_dependent_list">
+ <%= render :partial => "vehicle_journeys/vehicle_journey_at_stop_fields",
+ :collection => @vehicle_journey.vehicle_journey_at_stops, :as => :vehicle_journey_at_stop %>
+ </tbody>
+ </table>
+ <% end %>
<% end %>
- <%= form.input :time_table_tokens, :label => t('.time_tables'), :as => :text, :input_html => { :"data-pre" => ( @vehicle_journey.time_tables.map { |time_table| { :id => time_table.id, :name => time_table.comment } } ).to_json } %>
+ <%= form.input :time_table_tokens, :label => t('.time_tables'), :as => :text, :input_html => { :"data-pre" => ( @vehicle_journey.time_tables.map { |time_table| { :id => time_table.id, :name => time_table.comment } } ).to_json } %>
<% end %>
diff --git a/app/views/vehicle_journeys/_time_filter.html.erb b/app/views/vehicle_journeys/_time_filter.html.erb
index 0f1e8d439..6767468ec 100644
--- a/app/views/vehicle_journeys/_time_filter.html.erb
+++ b/app/views/vehicle_journeys/_time_filter.html.erb
@@ -6,6 +6,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)") %>
+ <%= f.hidden_field :journey_pattern_id_eq %>
+ <%= f.hidden_field :time_tables_comment_eq %>
<%= f.submit t('.time_range_filter') %>
<% end %>