Sha256: 10355530778288bd8d762b546a75ece909079dc6e9e7ce5f2c20853e291a9f07

Contents?: true

Size: 900 Bytes

Versions: 9

Compression:

Stored size: 900 Bytes

Contents

class Admin::Sections::Index < Minimal::Template
  include do
    def to_html
    	table_for collection, :collection_name => :sections, :class => 'sections list tree' do |t|
    		t.column :section
    		t.column :actions, :class => :actions

    		t.row(:class => 'section') do |r, section|
    			r.add_class "level_#{section.level}"
    			r.cell link_to_section(section)
          r.cell links_to_actions([:view, :edit, :destroy], section)
    		end
    	end
    end

    def link_to_section(section)
      status(section) + capture { link_to(section.name, url_for([:admin, site, section])) } # :class => section.state
    end

    def link_to_view(section)
      capture { link_to(:'.actions.view', public_url_for([section]), :class => :view) }
    end

    def status(section)
      capture { span(t(:'.published'), :title => t(:'.published'), :class => 'status published') }
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
adva-core-0.0.14 app/views/admin/sections/index.html.rb
adva-core-0.0.13 app/views/admin/sections/index.html.rb
adva-core-0.0.9 app/views/admin/sections/index.html.rb
adva-core-0.0.8 app/views/admin/sections/index.html.rb
adva-core-0.0.7 app/views/admin/sections/index.html.rb
adva-core-0.0.6 app/views/admin/sections/index.html.rb
adva-core-0.0.5 app/views/admin/sections/index.html.rb
adva-core-0.0.4 app/views/admin/sections/index.html.rb
adva-core-0.0.2 app/views/admin/sections/index.html.rb