diff options
| author | Luc Donnet | 2014-08-20 15:35:01 +0200 |
|---|---|---|
| committer | Luc Donnet | 2014-08-20 15:35:01 +0200 |
| commit | 1e14376c4116a3add9cf6b4dac7d7659789d349d (patch) | |
| tree | d809d7e90b9062b7ac1dec6f5a96d454840a3336 | |
| parent | b6d1c06128a67878ca5430dff005eaabb026307b (diff) | |
| download | chouette-core-1e14376c4116a3add9cf6b4dac7d7659789d349d.tar.bz2 | |
Refactor edit and new page layout for stop_area
| -rw-r--r-- | app/assets/stylesheets/main/stop_areas.css.scss | 9 | ||||
| -rw-r--r-- | app/assets/stylesheets/vendor/map_layers.css.scss | 1 | ||||
| -rw-r--r-- | app/views/stop_areas/_form.html.erb | 101 | ||||
| -rw-r--r-- | config/locales/stop_areas.yml | 12 |
4 files changed, 63 insertions, 60 deletions
diff --git a/app/assets/stylesheets/main/stop_areas.css.scss b/app/assets/stylesheets/main/stop_areas.css.scss index 74f8e0277..26aada5fd 100644 --- a/app/assets/stylesheets/main/stop_areas.css.scss +++ b/app/assets/stylesheets/main/stop_areas.css.scss @@ -27,17 +27,20 @@ legend { padding-bottom: 20px; } #prefetch { - padding: 10px 10px 30px 10px; + padding: 10px 10px 20px 10px; label{ - font-size: 18px; - margin-right: 20px; + font-size: 16px; + margin-right: 25px; } + + input{ width: 330px; } } #map{ float:none; width: 100%; + height: 450px; } } diff --git a/app/assets/stylesheets/vendor/map_layers.css.scss b/app/assets/stylesheets/vendor/map_layers.css.scss index 7d9972038..835417ddc 100644 --- a/app/assets/stylesheets/vendor/map_layers.css.scss +++ b/app/assets/stylesheets/vendor/map_layers.css.scss @@ -6,4 +6,5 @@ p.after_map { float: right; width: 400px; height: 400px; + border: 1px solid gray; }
\ No newline at end of file diff --git a/app/views/stop_areas/_form.html.erb b/app/views/stop_areas/_form.html.erb index 21b1a4f98..88cd3248d 100644 --- a/app/views/stop_areas/_form.html.erb +++ b/app/views/stop_areas/_form.html.erb @@ -1,62 +1,60 @@ -<div class="container-fluid"> - <div class="col-md-7"> - +<%= semantic_form_for [@referential, @stop_area] do |form| %> + <div class="row"> + <div class="col-md-6"> + <%= form.inputs do %> + <%= form.input :id, :as => :hidden %> + <%= form.input :name %> + <%= form.input :stop_area_type, :as => :select, :input_html => { :disabled => !@stop_area.new_record? }, :collection => Chouette::StopArea.stop_area_types, :include_blank => false, :member_label => Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } %> + <div class="location_info"> + <h3>Localisation</h3> + <% if @stop_area.new_record? %> <div id="prefetch"> <label><%= t('.geolocalize') %></label> - <input class="typeahead form-control input-lg" maxlength="255" name="stop_area[address]" type="text" placeholder="<%= t('.address') %>" /> + <input class="typeahead form-control input-lg" maxlength="255" type="text" placeholder="<%= t('.address') %>" /> </div> - - <%= semantic_form_for [@referential, @stop_area] do |form| %> - <%= form.inputs do %> - <%= form.input :id, :as => :hidden %> - <%= form.input :name %> - <%= form.input :stop_area_type, :as => :select, :input_html => { :disabled => !@stop_area.new_record? }, :collection => Chouette::StopArea.stop_area_types, :include_blank => false, :member_label => Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } %> - <% unless @referential.projection_type_label.empty? %> - <div class="panel panel-default"> - <div class="panel-heading"><%= @referential.projection_type_label %></div> - <div class="panel-body"> - <%= form.input :projection_xy, :input_html => { :title => t("formtastic.titles.stop_area.projection_xy")} %> - </div> - </div> + <% end %> + <% unless @referential.projection_type_label.empty? %> + <%= form.input :projection_xy, :label => t("projection_xy", :projection => @referential.projection_type_label), :input_html => { :title => t("formtastic.titles.stop_area.projection_xy")} %> <% end %> - <div class="panel panel-default"> - <div class="panel-heading">WGS84</div> - <div class="panel-body"> <%= form.input :coordinates, :input_html => { :title => t("formtastic.titles.stop_area.coordinates")} %> - </div> - </div> - <%= form.input :registration_number, :input_html => { :title => t("formtastic.titles.stop_area.registration_number")} %> - <%= form.input :street_name %> - <%= form.input :country_code %> - <%= form.input :zip_code %> - <%= form.input :city_name %> - <%= form.input :fare_code %> - <%= form.input :nearest_topic_name %> - <%= form.input :comment, :as => :text %> - - <% if !manage_itl %> - <%= form.input :mobility_restricted_suitability,:as => :boolean %> - <%= form.input :stairs_availability,:as => :boolean %> - <%= form.input :lift_availability,:as => :boolean %> - <% end %> - - <%= form.input :objectid, :required => !@stop_area.new_record?, :input_html => { :title => t("formtastic.titles.stop_area.objectid")} %> - - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> + <%= form.input :street_name %> + <%= form.input :country_code %> + <%= form.input :zip_code %> + <%= form.input :city_name %> + <% end %> + </div> + <div class="col-md-6"> + <% if !manage_itl && @map %> + <%= @map.to_html %> <% end %> - <% end %> - + </div> </div> - <div class="col-md-5"> - <% if !manage_itl && @map %> - <%= @map.to_html %> + <div class="general_info"> + <h3>Général</h3> + <%= form.inputs do %> + <%= form.input :objectid, :required => !@stop_area.new_record?, :input_html => { :title => t("formtastic.titles.stop_area.objectid")} %> + <%= form.input :registration_number, :input_html => { :title => t("formtastic.titles.stop_area.registration_number")} %> + <%= form.input :fare_code, :as => :number %> + <%= form.input :nearest_topic_name %> + <%= form.input :comment, :as => :text, :input_html => { :rows => 5 } %> <% end %> - </div> -</div> + </div> + <div class="pmr_info"> + <h3>Accessibilité</h3> + <%= form.inputs do %> + <% if !manage_itl %> + <%= form.input :mobility_restricted_suitability,:as => :boolean %> + <%= form.input :stairs_availability,:as => :boolean %> + <%= form.input :lift_availability,:as => :boolean %> + <% end %> + <% end %> + </div> + + <%= form.actions do %> + <%= form.action :submit, :as => :button %> + <%= form.action :cancel, :as => :link %> + <% end %> +<% end %> <script> var address_display = function( address ) { @@ -132,3 +130,4 @@ $('input[name="stop_area[city_name]"]').val(datum.city); }) </script> + diff --git a/config/locales/stop_areas.yml b/config/locales/stop_areas.yml index ccc3d2c5b..22b544a26 100644 --- a/config/locales/stop_areas.yml +++ b/config/locales/stop_areas.yml @@ -26,7 +26,7 @@ en: title: "Add a new stop" form: address: "15 rue du Louvre, Paris" - geolocalize: "Pinpoint : " + geolocalize: "Pinpoint " edit: title: "Update stop %{stop_area}" show: @@ -84,7 +84,7 @@ en: projection: "Projection type" projection_x: "x-position" projection_y: "y-position" - projection_xy: "position (x,y)" + projection_xy: "position (x,y) %{projection}" long_lat_type: "Projection type" longitude: "Longitude" latitude: "Latitude" @@ -96,7 +96,7 @@ en: routing_stop_ids: "Attached stops" routing_line_ids: "Attached lines" parent: "Parent" - coordinates: "Coordinates (lat,lng)" + coordinates: "Coordinates (lat,lng) WGS84" zip_code: "Zip code" city_name: "City" formtastic: @@ -136,7 +136,7 @@ fr: title: "Ajouter un arrêt" form: address: "15 rue du Louvre, Paris" - geolocalize: "Géolocalisez : " + geolocalize: "Géolocalisez " edit: title: "Modifier l'arrêt %{stop_area}" show: @@ -195,7 +195,7 @@ fr: projection: "Projection" projection_x: "Position X" projection_y: "Position Y" - projection_xy: "Position (x,y)" + projection_xy: "Position (x,y) %{projection}" long_lat_type: "Projection" longitude: "Longitude" latitude: "Latitude" @@ -207,7 +207,7 @@ fr: routing_stop_ids: "Arrêts concernés par l'ITL" routing_line_ids: "Lignes affectées par l'ITL" parent: "Parent" - coordinates: "Coordonnées (lat,lng)" + coordinates: "Coordonnées (lat,lng) WGS84" zip_code: "Code postal" city_name: "Commune" formtastic: |
