Sha256: 906e7c8e8e352f2a742c14c0b1f29ff3f958feebca8c2fdce460a935e5a24f59

Contents?: true

Size: 1.68 KB

Versions: 4

Compression:

Stored size: 1.68 KB

Contents

%h1 Articles

= link_to 'New Article', new_admin_article_path, class: 'btn btn-default'

<hr>

= form_tag '#', method: :get, class: 'inline-form' do
  = text_field_tag :search, params[:search], class: 'form-control inline-form', placeholder: 'search'
  = select_tag(:status, options_for_select(%w"Archived Published Drafts", params[:status]), include_blank: 'Status', class: 'form-control inline-form')
  <button class="btn btn-default btn-sm inline-form" type="submit">Search</button>

<hr>

%table.table
  %thead
    %tr
      %th
        Article
      %th
        Tags
      %th
        Created At
      %th
        Status
      %th
        Actions
  - @articles.each do |article|
    %tr
      %td
        = link_to article.title, article_path(article)
      %td
        - article.tags.each do |tag|
          = link_to tag, articles_path(search: tag)
      %td
        = article.created_at.strftime("%B %d %Y")
      %td
        = article.article_status
      %td
        = article.draft ? link_to( 'Publish',admin_article_path(article, article: { draft: false }), method: :put, class: 'btn btn-xs btn-default') : link_to( 'Make Draft',admin_article_path(article, article: { draft: true }), method: :put, class: 'btn btn-xs btn-default')
        = article.archived ? link_to( 'Publish',admin_article_path(article, article: { draft: false }), method: :put, class: 'btn btn-xs btn-default')  : link_to('Archive', admin_article_path(article, article: { archived: false } ), method: :put, class: 'btn btn-xs btn-default')
        = link_to 'Delete', admin_article_path(article), method: :delete, class: 'btn btn-xs btn-default'
        = link_to 'Edit', edit_admin_article_path(article), class: 'btn btn-xs btn-default'

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pages_cms-1.0.8 app/views/pages_cms/admin/articles/index.html.haml
pages_cms-1.0.6 app/views/pages_cms/admin/articles/index.html.haml
pages_cms-1.0.5 app/views/pages_cms/admin/articles/index.html.haml
pages_cms-1.0.4 app/views/pages_cms/admin/articles/index.html.haml