diff options
| author | Alban Peignier | 2016-11-20 22:02:51 +0100 |
|---|---|---|
| committer | Alban Peignier | 2016-11-20 22:10:33 +0100 |
| commit | 9d9de3e0727eff7b585c6e9ebeb91b8f6811b893 (patch) | |
| tree | 7b996e0cd8f55e75250e9aa058efbf03aa886714 | |
| parent | 411bdcb6e0137bd022e2126911db0b17051f8be9 (diff) | |
| download | chouette-core-9d9de3e0727eff7b585c6e9ebeb91b8f6811b893.tar.bz2 | |
Remove useless instance variables in LinesController. Fixes company/network DOM in lines/show
| -rw-r--r-- | app/controllers/lines_controller.rb | 4 | ||||
| -rw-r--r-- | app/views/lines/show.html.slim | 35 |
2 files changed, 17 insertions, 22 deletions
diff --git a/app/controllers/lines_controller.rb b/app/controllers/lines_controller.rb index eb38352be..ef058e317 100644 --- a/app/controllers/lines_controller.rb +++ b/app/controllers/lines_controller.rb @@ -22,9 +22,7 @@ class LinesController < BreadcrumbController end def show - @map = LineMap.new(resource).with_helpers(self) - @routes = @line.routes - @group_of_lines = @line.group_of_lines + @group_of_lines = resource.group_of_lines show! do build_breadcrumb :show end diff --git a/app/views/lines/show.html.slim b/app/views/lines/show.html.slim index 82ed8bdcf..636313d54 100644 --- a/app/views/lines/show.html.slim +++ b/app/views/lines/show.html.slim @@ -4,8 +4,6 @@ = title_tag t('lines.show.title', line: @line.name) .line_show - = @map.to_html - .summary - text_color = @line.text_color.blank? ? "black" : "##{@line.text_color}" - bg_color = @line.color.blank? ? "white" : "##{@line.color}" @@ -23,18 +21,17 @@ p label = "#{@line.human_attribute_name(:network)} : " - - if @line.network.nil? - = t('lines.index.unset') - - else - = link_to @line.network.name, [@line_referential, @line.network] + - if @line.network.nil? + = t('lines.index.unset') + - else + = link_to @line.network.name, [@line_referential, @line.network] p label = "#{@line.human_attribute_name(:company)} : " - - - if @line.company.nil? - = t('lines.index.unset') - - else - = link_to @line.company.name, [@line_referential, @line.company] + - if @line.company.nil? + = t('lines.index.unset') + - else + = link_to @line.company.name, [@line_referential, @line.company] p label = "#{@line.human_attribute_name('number')} : " @@ -54,7 +51,7 @@ = " " + t("enumerize.line.transport_mode.#{@line.transport_mode}") - else = " -" - + p label = "#{@line.human_attribute_name('transport_submode')} : " - if @line.transport_submode @@ -72,14 +69,14 @@ / p / label = "#{@line.human_attribute_name('mobility_restricted_suitability')} : " - / + / / - if @line.mobility_restricted_suitability.nil? / = @line.human_attribute_name("unspecified_mrs") / - elsif @line.mobility_restricted_suitability? / = @line.human_attribute_name("accessible") / - else / = @line.human_attribute_name("not_accessible") - / + / / br / = "#{@line.human_attribute_name('number_of_mrs_vj')} : #{@line.vehicle_journeys.where('mobility_restricted_suitability = ?', true).count}" / br @@ -88,27 +85,27 @@ / = @line.human_attribute_name("number_of_null_mrs_vj") / = " : " / = @line.vehicle_journeys.count - (@line.vehicle_journeys.where("mobility_restricted_suitability = ?", true).count + @line.vehicle_journeys.where("mobility_restricted_suitability = ?", false).count) - / + / / p / label = "#{@line.human_attribute_name('flexible_service')} : " - / + / / - if @line.flexible_service.nil? / = @line.human_attribute_name("unspecified_fs") / - elsif @line.flexible_service? / = @line.human_attribute_name("on_demaond_fs") / - else / = @line.human_attribute_name("regular_fs") - / + / / br / = "#{@line.human_attribute_name('number_of_fs_vj')} : #{@line.vehicle_journeys.where('flexible_service = ?', true).count}" / br / = "#{@line.human_attribute_name('number_of_non_fs_vj')} : #{@line.vehicle_journeys.where('flexible_service = ?', false).count}" / br / = @line.human_attribute_name("number_of_null_fs_vj") - / + / / - if @line.flexible_service.nil? / = "(#{@line.human_attribute_name('default_fs_msg')})" - / + / / = " : " / = @line.vehicle_journeys.count - (@line.vehicle_journeys.where("flexible_service = ?", true).count + @line.vehicle_journeys.where("flexible_service = ?", false).count) |
