aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/referential_lines/_line.html.slim
blob: 789b21534751ebad261209a70c5bbefb8e4f72d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#index_item.panel.panel-default.line.ce-LineBlock
  .panel-heading.ce-LineBlock-header
    ul.ce-LineBlock-header-list
      li
        = check_box_tag "ids[]", line.id, false, class: "multiple_selection", style: "display: none;"

        - if line.number && line.number.length <= 3
          span.label.label-default.line_number style="#{number_style(line)}"
            = line.number

      li
        = link_to([@referential, line], class: 'preview', title: "#{Chouette::Line.model_name.human.capitalize} #{line.name}") do
          h5.ce-LineBlock-header-title = truncate(line.name, length: 24)

      li
        - if edit && policy(Chouette::Line).update?
          = link_to edit_referential_line_path(@referential, line), class: 'btn btn-default btn-sm' do
            span.fa.fa-pencil

        - if delete && policy(Chouette::Line).destroy?
          = link_to referential_line_path(@referential, line), method: :delete, data: { confirm: t('lines.actions.destroy_confirm') }, class: 'btn btn-danger btn-sm' do
            span.fa.fa-trash-o

  .panel-body
    p
      - if line.network.nil?
        = line.human_attribute_name('network')
        = t('lines.index.unset')
      - else
        = line.human_attribute_name('network')
        = link_to_if line.network, line.network.name, referential_network_path(@referential, line.network), :title => "#{line.human_attribute_name('network')} #{line.network.name}"

    p
      - if line.company.nil?
        = line.human_attribute_name('company')
        = t('lines.index.unset')
      - else
        = line.human_attribute_name('company')
        = link_to_if( line.company, line.company.name, referential_company_path(@referential, line.company), :title => "#{line.human_attribute_name('company')} #{line.company.name}" )

    - unless @hide_group_of_line
      p
        - if line.group_of_lines.count == 0
          br
          / = t('lines.form.no_group_of_line')
        - elsif line.group_of_lines.count == 1
          = line.human_attribute_name('group_of_line')
          = link_to_if( line.group_of_lines.first, line.group_of_lines.first.name, referential_group_of_line_path(@referential, line.group_of_lines.first), :title => "#{line.human_attribute_name('group_of_line')} #{line.group_of_lines.first.name}")
        - else
          = t('lines.form.several_group_of_lines', :count => line.group_of_lines.count)