docbrown/app/views/admin/display_ads/index.html.erb
Ridhwana cf5207564f
RFC#50-P5 Prepares the admin restructure to be tested (#13114)
* feat: make the sidebar more dynamic

* refactor: use the action in the same controller instead of the whole path

* feat: remove hardcoded routes

* feat: move routes into file

* feat: use rails 6 draw for the admin routes

* add a helper method

* oops: fix super

* feat: add the hacky helper methods :( )

* WIP: created different path helpers for the new routes and point the old helpers to the new ones if the FF is toggled

* feat: update the module

* chore: add new paths

* feat: change link_to's use paths instead

* feat: feedback_messages to scoped admin route

* chore: update the feature flag urls helpers

* feat: feedback_messages issue

* chore: remove all the workarounds

* chore: rubucop

* fix: oops remove helper

* chore: comment out the tests that touch the tabbed navbar which is affected by the rails application needing to be reloaded

* feat: ensure that we chcek if the db table exists
2021-04-15 14:53:46 +02:00

43 lines
1.7 KiB
Text

<nav class="flex mb-4" aria-label="Display Ads navigation">
<%= form_tag(admin_display_ads_path, method: "get") do %>
<%= text_field_tag(:search, params[:search], aria: { label: "Search" }, class: "crayons-header--search-input crayons-textfield", placeholder: "Search by Org name") %>
<% end %>
<div class="ml-auto">
<div class="justify-content-end">
<%= link_to "Make A New Display Ad", new_admin_display_ad_path, class: "crayons-btn" %>
</div>
</div>
</nav>
<%= paginate @display_ads %>
<table class="crayons-table" width="100%">
<thead>
<tr>
<th scope="col">ID</th>
<th scope="col">Organization</th>
<th scope="col">Placement Area</th>
<th scope="col">Body Markdown</th>
<th scope="col">Published</th>
<th scope="col">Approved</th>
<th scope="col">Success Rate</th>
</tr>
</thead>
<tbody class="crayons-card">
<% @display_ads.each do |display_ad| %>
<tr>
<td><%= link_to display_ad.id, edit_admin_display_ad_path(display_ad) %></td>
<td><%= link_to display_ad.organization.name, admin_organization_path(display_ad.organization) %></td>
<td><%= display_ad.placement_area %></td>
<td><%= display_ad.body_markdown.truncate(30) %></td>
<td><%= display_ad.published %></td>
<td><%= display_ad.approved %></td>
<td><%= display_ad.success_rate %></td>
<td><%= link_to "Edit", edit_admin_display_ad_path(display_ad), class: "crayons-btn" %></td>
<td><%= link_to "Destroy", admin_display_ad_path(display_ad), class: "crayons-btn crayons-btn--danger", method: :delete, data: { confirm: "Are you sure?" } %></td>
</tr>
<% end %>
</tbody>
</table>
<%= paginate @display_ads %>