<%= blog? ? 'Blog Posts' : content_class.tableize.titleize %>
<% if blog? %>
<%= link_to 'New Post', new_entry_path(content_class: 'blog_post'), class: 'btn btn-primary space-2' %>
<%= link_to 'New Link', new_entry_path(content_class: 'blog_link'), class: 'btn btn-primary space-2' %>
<% else %>
<%= link_to "New #{content_class.titleize}", new_content_entry_path, class: 'btn btn-primary space-2' %>
<% end %>
<%= form_tag(search_path, method: :get) do %>
<%= text_field_tag 'query', '', placeholder: 'Search', class: 'form-control' %>
<% end %>
Title |
Created |
Published |
|
<% @entries.each do |entry| %>
<%= link_to entry.title, content_entry_path(entry) %> |
<%= time_ago_in_words entry.created_at %> ago |
<%= entry.published_at.strftime('%b %e, %Y at %l:%M%P') %> |
<%= link_to fa_icon('edit', text: 'Edit'), edit_content_entry_path(entry) %> |
<%= link_to fa_icon('trash', text: 'Delete'), content_entry_path(entry), method: :delete, data: { confirm: 'Are you sure you want to delete this?' } %> |
<% end %>