- breadcrumb @referential - page_header_content_for @referential - content_for :page_header_actions do - unless (@referential.archived? || !policy(@referential).edit?) = link_to(t('actions.edit'), edit_referential_path(@referential), class: 'btn btn-default') - content_for :page_header_content do .row.mb-sm .col-lg-12.text-right - @referential.action_links.each do |link| - if link.is_a?(HTMLElement) = link.to_html(class: 'btn btn-primary') - else = link_to link.href, method: link.method, data: link.data, class: 'btn btn-primary' do = link.content .page_content .container-fluid .row .col-lg-6.col-md-6.col-sm-12.col-xs-12 = definition_list t('metadatas'), { t('activerecord.attributes.referential.status') => @referential.archived? ? "
#{t('activerecord.attributes.referential.archived_at')}
".html_safe : "
#{t('activerecord.attributes.referential.archived_at_null')}
".html_safe, @referential.human_attribute_name(:validity_period) => (@referential.validity_period.present? ? t('validity_range', debut: l(@referential.try(:validity_period).try(:begin), format: :short), end: l(@referential.try(:validity_period).try(:end), format: :short)) : '-'), @referential.human_attribute_name(:organisation) => @referential.organisation.name, @referential.human_attribute_name(:published_at) => '-' } - if params[:q].present? or @reflines.any? .row .col-lg-12 = render 'filters' - if @reflines.any? .row .col-lg-12 / ID Codif, nom court, nom de la ligne, réseau, mode, transporteur principal, actions = [show, edit_notes] = table_builder_2 @reflines, [ \ TableBuilderHelper::Column.new( \ name: t('id_codif'), \ attribute: Proc.new { |n| n.get_objectid.short_id }, \ sortable: false \ ), \ TableBuilderHelper::Column.new( \ key: :number, \ attribute: 'number' \ ), \ TableBuilderHelper::Column.new( \ key: :name, \ attribute: 'name', \ link_to: lambda do |line| \ referential_line_path(@referential, line) \ end \ ), \ TableBuilderHelper::Column.new( \ key: :deactivated, \ attribute: Proc.new { |n| line_status(n.deactivated?) } \ ), \ TableBuilderHelper::Column.new( \ key: :transport_mode, \ attribute: Proc.new { |n| n.transport_mode ? t("enumerize.transport_mode.#{n.transport_mode}") : '' }, \ ), \ TableBuilderHelper::Column.new( \ key: 'networks.name', \ attribute: Proc.new { |n| n.try(:network).try(:name) } \ ), \ TableBuilderHelper::Column.new( \ key: 'companies.name', \ attribute: Proc.new { |n| n.try(:company).try(:name) } \ ) \ ], links: [:show], cls: 'table has-filter has-search' = new_pagination @reflines, 'pull-right' - unless @reflines.any? .row.mt-xs .col-lg-12 = replacement_msg t('referential_lines.search_no_results') / Modal(s) = modalbox 'purgeModal' do = simple_form_for [@referential, CleanUp.new] do |f| .modal-header h4.modal-title #{t('simple_form.labels.clean_up.title')} .modal-body .container-fluid .row .col-lg-8.col-ld-offset-2.col-md-8.col-md-offset-2.col-sm-8.col-sm-offset-2.col-xs-12 = f.input :date_type, as: :radio_buttons, label: false .col-lg-8.col-ld-offset-2.col-md-8.col-md-offset-2.col-sm-8.col-sm-offset-2.col-xs-12 label.control-label.begin_date = t('titles.clean_up.begin_date') label.control-label.end_date.hidden = t('titles.clean_up.end_date') = f.input :begin_date, as: :date, label: false, wrapper_html: { class: 'date smart_date' } = f.input :end_date, as: :date, label: t('titles.clean_up.end_date'), wrapper_html: { class: 'date cleanup_end_date_wrapper smart_date', id: "end_date" } .modal-footer button.btn.btn-link type='button' data-dismiss='modal' #{t('cancel')} - unless policy(@referential).archived? = f.button :submit, t('actions.clean_up') , class: 'btn btn-primary'