* h1 and h2 design fixes * h2 redesign fixes * Removed incorrect code * Revert incorrect test code * h3 heading redesign * h4,h4,h5 headings redesign * Minor design fixes * Fixed all heading styles * Test case fix * Revert incorrect if condition * Revert incorrect if condition * Removed non required div
65 lines
2.2 KiB
Text
65 lines
2.2 KiB
Text
|
|
<header class="flex items-center mb-6">
|
|
<h1 class="crayons-title">Listings</h1>
|
|
|
|
<a
|
|
href="<%= admin_listing_categories_path %>"
|
|
aria-label="Listing Categories"
|
|
class="ml-auto crayons-btn">
|
|
Listing Categories
|
|
</a>
|
|
</header>
|
|
|
|
<%= form_tag(admin_listings_path, method: "get", role: "search", class: "crayons-card crayons-card--secondary p-4 flex items-center") do %>
|
|
<div class="mr-4">
|
|
<%= label_tag(:search, "Keyword", class: "mb-0") %>
|
|
<%= text_field_tag(:search, params[:search]) %>
|
|
<% if params[:state].present? %>
|
|
<%= hidden_field_tag(:state, params[:state]) %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="mr-4">
|
|
<%= label_tag(:filter, "Category", class: "mb-0") %>
|
|
<%= select_tag(:filter, options_for_select(categories_available.keys, params[:filter]), include_blank: true) %>
|
|
</div>
|
|
|
|
<div class="mr-4">
|
|
<%= label_tag(:include_unpublished, "Include unpublished listings", class: "mb-0") %>
|
|
<%= hidden_field_tag(:include_unpublished, 0) %>
|
|
<%= check_box_tag(:include_unpublished, 1, params[:include_unpublished] == "1") %>
|
|
</div>
|
|
|
|
<%= submit_tag("Filter") %>
|
|
<% end %>
|
|
|
|
<%= paginate @listings %>
|
|
|
|
<table class="crayons-table">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">Title Link</th>
|
|
<th scope="col">User</th>
|
|
<th scope="col">Org</th>
|
|
<th scope="col">Category</th>
|
|
<th scope="col">Cached Tags</th>
|
|
<th scope="col">Published?</th>
|
|
<th scope="col">Last Bumped</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="crayons-card">
|
|
<% @listings.each do |listing| %>
|
|
<tr>
|
|
<td><%= link_to listing.title, edit_admin_listing_path(listing.id), rel: "noopener" %></td>
|
|
<td><%= link_to listing.user.username, admin_user_path(listing.user.id) %></td>
|
|
<td><%= link_to listing.organization.name, admin_organization_path(listing.organization_id) if listing.organization_id.present? %></td>
|
|
<td><%= listing.category %></td>
|
|
<td><%= listing.cached_tag_list %></td>
|
|
<td><%= listing.published ? "Yes" : "No" %></td>
|
|
<td><%= listing.bumped_at ? "#{time_ago_in_words(listing.bumped_at)} ago" : "Draft" %></td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
|
|
<%= paginate @listings %>
|