diff options
| author | jpl | 2016-11-14 17:33:34 +0100 |
|---|---|---|
| committer | jpl | 2016-11-14 17:33:34 +0100 |
| commit | 3960264693d8ea79907b7c5619af678c69aef234 (patch) | |
| tree | b969a3f07be217b19c82dd470549294d0a2e9a34 | |
| parent | 0bf427ddb26129b988b0db78ecc57eee5f62c972 (diff) | |
| download | chouette-core-3960264693d8ea79907b7c5619af678c69aef234.tar.bz2 | |
Refs #1865: Updating routes list (table mode)
| -rw-r--r-- | app/views/lines/show.html.slim | 3 | ||||
| -rw-r--r-- | app/views/referential_lines/_reflines_routes.html.slim | 30 | ||||
| -rw-r--r-- | app/views/referential_lines/show.html.slim | 96 | ||||
| -rw-r--r-- | app/views/routes/_route.html.slim | 6 |
4 files changed, 84 insertions, 51 deletions
diff --git a/app/views/lines/show.html.slim b/app/views/lines/show.html.slim index cca0e395c..b314dee82 100644 --- a/app/views/lines/show.html.slim +++ b/app/views/lines/show.html.slim @@ -118,7 +118,8 @@ p.after_map -h3.routes = t('.itineraries') +h3.routes + = t('.itineraries') .routes.paginated_content / FIXME #825 diff --git a/app/views/referential_lines/_reflines_routes.html.slim b/app/views/referential_lines/_reflines_routes.html.slim new file mode 100644 index 000000000..43cc908b4 --- /dev/null +++ b/app/views/referential_lines/_reflines_routes.html.slim @@ -0,0 +1,30 @@ +table.table.table-bordered.table-hover + thead + tr + th.text-center = @routes.human_attribute_name(:name) + th.text-center = @routes.human_attribute_name(:published_name) + th.text-center = @routes.human_attribute_name(:wayback) + th.text-center = @routes.human_attribute_name(:opposite_route) + th.text-center = "Actions" + + - @routes.each do |route| + tr + td = truncate(route.name, length: 20) + td = route.published_name + td = route.wayback_text + td + - if route.opposite_route + = route.opposite_route.name + - else + = "Aucune séquence d'arrêts associée en sens opposé" + + td.text-center + .btn.btn-group.btn-group-sm + = link_to [@referential, @line, route], class: 'btn btn-default preview', title: "#{Chouette::Route.model_name.human.capitalize} #{route.name}" do + span.fa.fa-eye + + = link_to edit_referential_line_route_path(@referential, @line, route), class: 'btn btn-default' do + span.fa.fa-pencil + + = link_to referential_line_route_path(@referential, @line, route), method: :delete, :data => {:confirm => t('routes.actions.destroy_confirm')}, class: 'btn btn-danger' do + span.fa.fa-trash-o diff --git a/app/views/referential_lines/show.html.slim b/app/views/referential_lines/show.html.slim index ddaeea724..4c439d08a 100644 --- a/app/views/referential_lines/show.html.slim +++ b/app/views/referential_lines/show.html.slim @@ -54,51 +54,51 @@ label = "#{@line.human_attribute_name('url')} : " = @line.url - 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 - = "#{@line.human_attribute_name('number_of_non_mrs_vj')} : #{@line.vehicle_journeys.where('mobility_restricted_suitability = ?', false).count}" - br - = "#{@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)}" - - p - label = "#{@line.human_attribute_name('footnotes')} : " - ul - - @line.footnotes.each do |footnote| - li = "#{footnote.code} : #{footnote.label}" + / 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 + / = "#{@line.human_attribute_name('number_of_non_mrs_vj')} : #{@line.vehicle_journeys.where('mobility_restricted_suitability = ?', false).count}" + / br + / = "#{@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)}" + / + / p + / label = "#{@line.human_attribute_name('footnotes')} : " + / ul + / - @line.footnotes.each do |footnote| + / li = "#{footnote.code} : #{footnote.label}" p label = "#{@line.human_attribute_name('comment')} : " @@ -109,10 +109,12 @@ #flexible_service.col-md-6 p.after_map -h3.routes = t('.itineraries') +h3.routes + = t('.itineraries') .routes.paginated_content - = paginated_content @routes, "routes/route" + / = paginated_content @routes, "routes/route" + = render 'reflines_routes' - if @line.group_of_lines.any? h3.line_group_of_lines = t('.group_of_lines') diff --git a/app/views/routes/_route.html.slim b/app/views/routes/_route.html.slim index 5a377761f..251c92000 100644 --- a/app/views/routes/_route.html.slim +++ b/app/views/routes/_route.html.slim @@ -1,11 +1,11 @@ #index_item.panel.panel-default.route .panel-heading .panel-title.clearfix - span.pull-right - = link_to edit_referential_line_route_path(@referential, @line, route), class: 'btn btn-default btn-sm' do + .btn-group.btn-group-sm.pull-right + = link_to edit_referential_line_route_path(@referential, @line, route), class: 'btn btn-default' do span.fa.fa-pencil - = link_to referential_line_route_path(@referential, @line, route), method: :delete, :data => {:confirm => t('routes.actions.destroy_confirm')}, class: 'btn btn-danger btn-sm' do + = link_to referential_line_route_path(@referential, @line, route), method: :delete, :data => {:confirm => t('routes.actions.destroy_confirm')}, class: 'btn btn-danger' do span.fa.fa-trash-o h5 |
