diff options
| author | Luc Donnet | 2014-10-10 10:21:54 +0200 |
|---|---|---|
| committer | Luc Donnet | 2014-10-10 10:21:54 +0200 |
| commit | ceda2215d35e1ac2923af62f3f00f2feb214764e (patch) | |
| tree | 1951404af48e750d757ed3cdb47bfc35677e39b4 | |
| parent | 5e79dbe396a2e0cebca960b7f540fc14011263b0 (diff) | |
| download | chouette-core-ceda2215d35e1ac2923af62f3f00f2feb214764e.tar.bz2 | |
Fix layout when no sidebar Refs #0029169
| -rw-r--r-- | app/assets/stylesheets/main/stop_areas.css.scss | 2 | ||||
| -rw-r--r-- | app/controllers/chouette_controller.rb | 2 | ||||
| -rw-r--r-- | app/controllers/stop_areas_controller.rb | 19 | ||||
| -rw-r--r-- | app/views/layouts/application.html.erb | 4 |
4 files changed, 19 insertions, 8 deletions
diff --git a/app/assets/stylesheets/main/stop_areas.css.scss b/app/assets/stylesheets/main/stop_areas.css.scss index a6641bb28..59c243c26 100644 --- a/app/assets/stylesheets/main/stop_areas.css.scss +++ b/app/assets/stylesheets/main/stop_areas.css.scss @@ -7,7 +7,7 @@ #country_codes { display: none; } } -#workspace.stop_areas.edit, #workspace.stop_areas.new { +#workspace.stop_areas.edit, #workspace.stop_areas.new, #workspace.stop_areas.update, #workspace.stop_areas.create { legend { padding-bottom: 20px; } #prefetch { diff --git a/app/controllers/chouette_controller.rb b/app/controllers/chouette_controller.rb index 753fbd2fc..df082d8cd 100644 --- a/app/controllers/chouette_controller.rb +++ b/app/controllers/chouette_controller.rb @@ -4,8 +4,6 @@ class ChouetteController < BreadcrumbController include BreadcrumbHelper before_filter :switch_referential - - layout "without_sidebar", :only => [:edit, :new, :update, :create] def switch_referential Apartment::Database.switch(referential.slug) diff --git a/app/controllers/stop_areas_controller.rb b/app/controllers/stop_areas_controller.rb index 560b20626..b164f4bc8 100644 --- a/app/controllers/stop_areas_controller.rb +++ b/app/controllers/stop_areas_controller.rb @@ -68,6 +68,13 @@ class StopAreasController < ChouetteController end end + def create + @map = StopAreaMap.new( Chouette::StopArea.new).with_helpers(self) + @map.editable = true + + create! + end + def show map.editable = false @access_points = @stop_area.access_points @@ -83,14 +90,20 @@ class StopAreasController < ChouetteController end def edit - stop_area.position ||= stop_area.default_position - - map.editable = true edit! do + stop_area.position ||= stop_area.default_position + map.editable = true build_breadcrumb :edit end end + def update + stop_area.position ||= stop_area.default_position + map.editable = true + + update! + end + def default_geometry count = referential.stop_areas.without_geometry.default_geometry! flash[:notice] = I18n.translate("stop_areas.default_geometry_success", :count => count) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 418b90e72..38125e112 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -22,14 +22,14 @@ </div> <div id="middle" class="container"> <div class="row"> - <div class="col-md-9"> + <div class="<%= content_for?(:sidebar) ? 'col-md-9' : 'col-md-12' %>"> <div id="workspace" class="<%= controller_name %> <%= action_name %>"> <%= render partial: "shared/flash_messages", flash: flash %> <%= render partial: "shared/breadcrumb" %> <%= yield %> </div> </div> - <div id="sidebar" class="col-md-3"> + <div id="sidebar" class="<%= content_for?(:sidebar) ? 'col-md-3' : '' %>"> <%= yield :sidebar %> </div> </div> |
