diff options
| -rw-r--r-- | app/controllers/routing_constraint_zones_controller.rb | 15 | ||||
| -rw-r--r-- | app/views/routing_constraint_zones/index.html.slim | 29 |
2 files changed, 37 insertions, 7 deletions
diff --git a/app/controllers/routing_constraint_zones_controller.rb b/app/controllers/routing_constraint_zones_controller.rb index f019b5ea9..3d0ee19ed 100644 --- a/app/controllers/routing_constraint_zones_controller.rb +++ b/app/controllers/routing_constraint_zones_controller.rb @@ -10,6 +10,21 @@ class RoutingConstraintZonesController < ChouetteController belongs_to :line, parent_class: Chouette::Line end + def index + index! do |format| + @routing_constraint_zones = ModelDecorator.decorate( + @routing_constraint_zones, + with: RoutingConstraintZoneDecorator, + context: { + referential: referential, + line: parent + } + ) + + build_breadcrumb :index + end + end + def show show! do |format| @routing_constraint_zone = @routing_constraint_zone.decorate(context: { diff --git a/app/views/routing_constraint_zones/index.html.slim b/app/views/routing_constraint_zones/index.html.slim index 596ea9e91..6b3e73096 100644 --- a/app/views/routing_constraint_zones/index.html.slim +++ b/app/views/routing_constraint_zones/index.html.slim @@ -16,13 +16,28 @@ - if @routing_constraint_zones.any? .row .col-lg-12 - = table_builder @routing_constraint_zones, - { 'ID' => Proc.new { |n| n.try(:objectid).try(:local_id) }, - :name => 'name', :stop_points_count => 'stop_points_count', - :route => 'route_name' }, - [:show, :edit, :delete], - [], - 'table has-filter has-search' + = table_builder_2 @routing_constraint_zones, + [ \ + TableBuilderHelper::Column.new( \ + name: 'ID', \ + attribute: Proc.new { |n| n.try(:objectid).try(:local_id) }, \ + sortable: false \ + ), \ + TableBuilderHelper::Column.new( \ + key: :name, \ + attribute: 'name' \ + ), \ + TableBuilderHelper::Column.new( \ + key: :stop_points_count, \ + attribute: 'stop_points_count' \ + ), \ + TableBuilderHelper::Column.new( \ + key: :route, \ + attribute: 'route_name' \ + ), \ + ], + links: [:show], + cls: 'table has-filter has-search' - unless @routing_constraint_zones.any? .row.mt-xs |
