Sha256: 820b704a1869bc9521555e68316b5829a955847e976c9bc2995986f23dbadd33

Contents?: true

Size: 1.62 KB

Versions: 11

Compression:

Stored size: 1.62 KB

Contents

%table.zebra<%= "#sort-list" if column_names.include?("position") %>
  %thead
    %tr
      <%- columns.each do |column| -%>
      <%- if column.name=='position' || column.name=='visible'-%>
      %th{:class => <%= (column.name=='position') ? "\'position\'" : "\'visibility\'" %>}
      <%- else -%>
      <%= "%th= sortable_columns \"#{column.name}\", #{@model_name.demodulize}.human_attribute_name(\"#{column.name}\")" %>
      <%- end -%>
      <%- end -%>
      %th
      
  %tbody
    - @<%= plural_resource_name %>.each do |<%= resource_name %>|
      <%- if column_names.include?("position") -%>
      %tr{:id => "<%= resource_name %>_#{<%= resource_name %>.id}"}
      <%- else -%>
      %tr
      <%- end -%>
        <%- columns.each do |column| -%>
        <%- if column.name == "position" -%>
        %td.icon.handle
          %i{:class => "icon-move icon-large"}
        <%- elsif column.name == "visible" -%>
        %td.icon.visibility
          = link_to [:toggleshow, :admin, <%= resource_name %>], :remote => true do
            %i{:class => (<%= resource_name %>.visible? ? "icon-eye-open icon-large" : "icon-eye-close icon-large not-work")}
        <%- else -%>
        %td= link_to <%= resource_name %>.<%= column.name %>, [:edit, :admin, <%= resource_name %>]
        <%- end -%>
        <%- end -%>
        %td.right
          = link_to [:admin, <%= resource_name %>], :method => :delete, :confirm => "#{t 'confirm.delete'}", class: :del do
            %span Удалить
            %i{:class => "icon-trash icon-large"}
  <%- if column_names.include?("position") -%>
  = sortable sort_admin_<%= plural_resource_name %>_path
  <%- end -%>

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ideyabox-0.1.12 lib/generators/ideyabox/scaffold/templates/_index.html.haml
ideyabox-0.1.11 lib/generators/ideyabox/scaffold/templates/_index.html.haml
ideyabox-0.1.10 lib/generators/ideyabox/scaffold/templates/_index.html.haml
ideyabox-0.1.9 lib/generators/ideyabox/scaffold/templates/_index.html.haml
ideyabox-0.1.8 lib/generators/ideyabox/scaffold/templates/_index.html.haml
ideyabox-0.1.7 lib/generators/ideyabox/scaffold/templates/_index.html.haml
ideyabox-0.1.6 lib/generators/ideyabox/scaffold/templates/_index.html.haml
ideyabox-0.1.5 lib/generators/ideyabox/scaffold/templates/_index.html.haml
ideyabox-0.1.4 lib/generators/ideyabox/scaffold/templates/_index.html.haml
ideyabox-0.1.3 lib/generators/ideyabox/scaffold/templates/_index.html.haml
ideyabox-0.1.2 lib/generators/ideyabox/scaffold/templates/_index.html.haml