Sha256: 73924e7fd22f03fe680a1ae76d1074e387819b1e05461aca726bcf8b9109ccf0

Contents?: true

Size: 1.76 KB

Versions: 5

Compression:

Stored size: 1.76 KB

Contents

- content_for(:page_header) do
  %h1= tplural <%= model_name.demodulize %>
  %p= link_to "Добавить #{taccusative('<%= resource_name %>')}", [:new, :admin, :<%= resource_name %>]
  
- unless @<%= plural_resource_name %>.empty?
  %table.list<%= ".sortable" if column_names.include?('position') %>
    %colgroup 
      <%- columns.each do |column| -%>
      %col<%= '.w1' if ['position', 'visible'].include? column.name %>
      <%- end -%>
      %col.w1
    %thead
      %tr
        <%- columns.each do |column| -%>
        %th<%- unless ['position', 'visible'].include? column.name %>= <%= model_name.demodulize %>.human_attribute_name('<%= column.name %>')<% end %>
        <%- end -%>
        %th
    - @<%= plural_resource_name %>.each do |<%= resource_name %>|
      <%- if column_names.include?('position') -%>
      %tr{ id: "pos_#{<%= resource_name %>.id}" }
      <%- else -%>
      %tr
      <%- end -%>
        <%- columns.each do |column| -%>
        <%- if column.name == 'position' -%>
        %td.handle= image_tag asset_path('admin/move_handler.png')
        <%- elsif column.name == 'visible' -%>
        %td.show= link_to '', admin_<%= singular_controller_routing_path %>_path(<%= resource_name %>, <%= resource_name %>: { visible: !<%= resource_name %>.visible} ), class: <%= resource_name %>.visible ? nil : 'not-show', data: { method: 'put' }
        <%- else -%>
        %td= link_to <%= resource_name %>.<%= column.name %>, [:edit, :admin, <%= resource_name %>]
        <%- end -%>
        <%- end -%>
        %td= link_to 'Удалить', [:admin, <%= resource_name %>], method: :delete, data: { confirm: 'Точно Удалить?'' }, class: :del
        
  <%- if column_names.include?('position') -%>
  = sortable sort_admin_<%= plural_resource_name %>_path
  <%- end -%>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
redde-0.1.12 lib/generators/redde/scaffold/templates/index.html.haml
redde-0.1.11 lib/generators/redde/scaffold/templates/index.html.haml
redde-0.1.10 lib/generators/redde/scaffold/templates/index.html.haml
redde-0.1.9 lib/generators/redde/scaffold/templates/index.html.haml
redde-0.1.8 lib/generators/redde/scaffold/templates/index.html.haml