%h1 Listing posts

= link_to 'New Post', new_editor_post_url, class: 'btn btn-default'

%table.table
  %thead
    %tr
      %th Public ID
      %th Title
      %th Category
      %th Published at
      %th Thumbnail
      %th
      %th
      %th

  %tbody
    - @posts.each do |post|
      %tr
        %td= post.public_id
        %td= post.title
        %td= post.category&.name
        %td= post.published_at
        %td= image_tag post.thumbnail_url, height: 80 if post.thumbnail.present?
        %td= link_to 'Show', editor_post_url(post)
        %td= link_to 'Preview', preview_editor_post_url(post), target: '_blank'
        %td= link_to 'Edit', edit_editor_post_url(post)
        %td= link_to 'Destroy', editor_post_url(post), method: :delete, data: { confirm: 'Are you sure?' }

- if @posts.total_pages > 1
  .text-center
    %nav.pagination
      = paginate @posts, views_prefix: 'editor'
      %p.pagination__entries= page_entries_info @posts

%h1 Listing posts

= link_to 'New Post', new_editor_post_url, class: 'btn btn-default'

%table.table
  %thead
    %tr
      %th Public ID
      %th Title
      %th Category
      %th Published at
      %th Thumbnail
      %th
      %th
      %th

  %tbody
    - @posts.each do |post|
      %tr
        %td= post.public_id
        %td= post.title
        %td= post.category&.name
        %td= l post.published_at  if post.published_at
        %td= image_tag post.thumbnail_url, height: 80 if post.thumbnail.present?
        %td= link_to 'Show', editor_post_url(post)
        %td= link_to 'Preview', preview_editor_post_url(post), target: '_blank'
        %td= link_to 'Edit', edit_editor_post_url(post)
        %td= link_to 'Destroy', editor_post_url(post), method: :delete, data: { confirm: 'Are you sure?' }

- if @posts.total_pages > 1
  .text-center
    %nav.pagination
      = paginate @posts, views_prefix: 'editor'
      %p.pagination__entries= page_entries_info @posts

Use `l` to display `post.published_at`
Use `l` to display `post.published_at`
