Sha256: cfd6e77912ddeab0cd1eb6731443f533fe3f96bf3125da20fa5c4a9997f7682d

Contents?: true

Size: 1.14 KB

Versions: 5

Compression:

Stored size: 1.14 KB

Contents

<%=
  table_for @contents, :class => "articles list tree" do |t|
    columns = [:content]
    columns << :category if @section.categories.any?
    columns << :comments if defined?(Comment)
    columns += [:published, :actions]

    t.column *columns

    t.row do |r, content|
      r.add_class "level_#{content.level}"
      r.cell content_status(content) + " " + link_to(content.title, [:edit, :admin, @section, content], :class => content.state)
      r.cell content.category_titles.join(", ") if @section.categories.any?
      r.cell content.accept_comments? && content.comments.present? ? link_to(content.comments.size, admin_comments_path) : "None" if defined?(Comment)
      r.cell published_at_formatted(content)
      r.cell link_to("Edit", [:edit, :admin, @section, content], :class => "edit content") +
        link_to("Delete", [:admin, @section, content], method: :delete, class: "delete content", data: { confirm: "Are you sure you want to delete this content?" })
    end

    t.empty :p, :class => 'empty' do
      raw "There are no contents in #{@section.title}. " +
        link_to("Create one now", [:new, :admin, @section, :content])
    end
  end
%>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
adva-0.2.4 app/views/admin/page/contents/index.html.erb
adva-0.2.3 app/views/admin/page/contents/index.html.erb
adva-0.2.2 app/views/admin/page/contents/index.html.erb
adva-0.2.1 app/views/admin/page/contents/index.html.erb
adva-0.2.0 app/views/admin/page/contents/index.html.erb