/ PageHeader = pageheader 'ligne', t('lines.index.line', line: @line.name), '', t('last_update', time: l(@line.updated_at, format: :short)) do / Below is secundary actions & optional contents .row .col-lg-12.text-right.mb-sm - @line.action_links.each do |link| = link_to link.href, method: link.method, data: link.data, class: 'btn btn-primary' do = link.content / PageContent .page_content .container-fluid .row .col-lg-6.col-md-6.col-sm-12.col-xs-12 = definition_list t('metadatas'), { t('id_codif') => @line.objectid.local_id, 'Activé' => (@line.deactivated? ? t('false') : t('true')), @line.human_attribute_name(:network) => (@line.network.nil? ? t('lines.index.unset') : link_to(@line.network.name, [@referential, @line.network]) ), @line.human_attribute_name(:company) => (@line.company.nil? ? t('lines.index.unset') : link_to(@line.company.name, [@referential, @line.company]) ), 'Transporteur(s) secondaire(s)' => (@line.secondary_companies.nil? ? t('lines.index.unset') : @line.secondary_companies.collect(&:name).join(', ')), 'Nom court' => @line.number, 'Code public' => (@line.registration_number ? @line.registration_number : '-'), @line.human_attribute_name(:transport_mode) => (@line.transport_mode.present? ? t("enumerize.transport_mode.#{@line.transport_mode}") : '-'), @line.human_attribute_name(:transport_submode) => (@line.transport_submode.present? ? t("enumerize.transport_submode.#{@line.transport_submode}") : '-'), @line.human_attribute_name(:url) => (@line.url ? @line.url : '-'), @line.human_attribute_name(:seasonal) => (@line.seasonal? ? t('true') : t('false')),} .row .col-lg-12 .h3 = t('lines.show.routes.title') - if params[:q].present? or @routes.any? .row .col-lg-12 = render 'filters' - if @routes.any? .row .col-lg-12 = table_builder_2 @routes, [ \ TableBuilderHelper::Column.new( \ name: 'ID', \ attribute: Proc.new { |n| n.objectid.short_id }, \ sortable: false \ ), \ TableBuilderHelper::Column.new( \ key: :name, \ attribute: 'name', \ link_to: lambda do |route| \ referential_line_route_path(@referential, @line, route) \ end \ ), \ TableBuilderHelper::Column.new( \ key: :published_name, \ attribute: 'published_name' \ ), \ TableBuilderHelper::Column.new( \ key: :wayback, \ attribute: 'wayback_text' \ ), \ TableBuilderHelper::Column.new( \ name: 'Arrêt de départ', \ attribute: Proc.new { |r| r.try(:stop_points).first.try(:stop_area).try(:name) }, \ sortable: false \ ), \ TableBuilderHelper::Column.new( \ name: "Arrêt d'arrivée", \ attribute: Proc.new{ |r| r.try(:stop_points).last.try(:stop_area).try(:name) }, \ sortable: false \ ), \ TableBuilderHelper::Column.new( \ key: :stop_points, \ attribute: Proc.new{ |r| r.try(:stop_points).count } \ ), \ TableBuilderHelper::Column.new( \ key: :journey_patterns, \ attribute: Proc.new{ |r| r.try(:journey_patterns).count } \ ) \ ], links: [:show, :edit], cls: 'table has-search' = new_pagination @routes, 'pull-right' - unless @routes.any? .row.mt-xs .col-lg-12 = replacement_msg t('routes.search_no_results')