summaryrefslogtreecommitdiff
path: root/app/views/gs_parameters/index.html.haml
blob: 9d757a0d341e5e5fa7b7c70879068335c293b548 (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
- content_for :title, t("gs_parameters.index.page_title")

- cache(['gs_parameter_all_tables', I18n.locale, @gs_parameters.count, @gs_parameters.reorder(:updated_at).first, @gs_parameters.reorder(:updated_at).last]) do
  - if @gs_parameters && @gs_parameters.count > 0
    %table.table.table-striped
      %thead
        %tr
          %th
          %th
          %th
          %th

      %tbody 
        - @entities.each do |entity_name, entity|
          %tr.table.info
            %td{:colspan => 5}
              - if !entity_name.blank?
                %strong= entity_name
          - entity.each do |section_name, section|
            %tr.table.success
              %td
              %td{:colspan => 4}
                %strong= section_name
              - gs_parameters = @gs_parameters.where(:entity => entity_name, :section => section_name)
              - cache(['gs_parameter_sub_table', I18n.locale, gs_parameters.count, gs_parameters.reorder(:updated_at).first, gs_parameters.reorder(:updated_at).last]) do
                
                - for gs_parameter in gs_parameters
                  - cache(['gs_parameters_table_single_row', I18n.locale, gs_parameter]) do 
                    %tr
                      %td
                      %td
                      %td
                        %span.hidden-phone
                          = truncate(gs_parameter.name, :length => GsParameter.get('DESKTOP_MAX_STRING_LENGTH'))
                        %span.visible-phone
                          = truncate(gs_parameter.name, :length => GsParameter.get('MOBILE_MAX_STRING_LENGTH'))
                      %td
                        %span.hidden-phone
                          = truncate(gs_parameter.value, :length => GsParameter.get('DESKTOP_MAX_STRING_LENGTH'))
                        %span.visible-phone
                          = truncate(gs_parameter.value, :length => GsParameter.get('MOBILE_MAX_STRING_LENGTH'))           
                      =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => gs_parameter}