docbrown/app/views/internal/broadcasts/index.html.erb
Julianna Tetreault 426d3191e8
Add a Broadcast Show View (#8769) [deploy]
* Add #show to the Broadcasts::Controller and to routes.rb
  - Adds a show method to the Broadcasts Controller
  - Adds a show route to routes.rb

* Add a show view for Broadcasts
  - Adds show.html.erb to /internal/broadcasts
  - Repurposes code from index.html.erb for show view
  - Repurposes code from edit.html.erb for show view

* Rewrite /internal/broadcasts index to use a table
  - Formats /internal/broadcasts with a table
  - Removes on-hover functionality from show.html.erb

* Refactor Broadcast resources in routes.rb

* Redirect to #show on create and update for Broadcasts

* Add the Destroy Broadcast button to the Broadcast show view

* Remove style preventing Broadcast preview

* Add Broadcast styling back and add display: block to stylesheet

* Add display: flex to .broadcast-wrapper in layout.scss

* Remove superfluous slashes from opening tags
2020-06-18 15:51:45 -06:00

47 lines
1.5 KiB
Text

<div class="row my-3">
<div class="col">
<ul class="nav nav-pills">
<li class="nav-item">
<%= link_to "All", internal_broadcasts_path, class: "nav-link #{'active' if params[:type_of].blank?}" %>
</li>
<li class="nav-item">
<%= link_to "Announcement", internal_broadcasts_path(type_of: :announcement), class: "nav-link #{'active' if params[:type_of] == 'announcement'}" %>
</li>
<li class="nav-item">
<%= link_to "Welcome", internal_broadcasts_path(type_of: :welcome), class: "nav-link #{'active' if params[:type_of] == 'welcome'}" %>
</li>
</ul>
</div>
<div class="col">
<div class="row justify-content-end">
<%= link_to "Make A New Broadcast", new_internal_broadcast_path, class: "btn btn-primary" %>
</div>
</div>
</div>
<div class="alert alert-warning"><strong>Note: You must ensure that your Broadcast is active in order for it to be sent to users!</strong></div>
<table class="table">
<thead>
<tr>
<th scope="col">Title</th>
<th scope="col">Status</th>
</tr>
</thead>
<tbody>
<% @broadcasts.each do |broadcast| %>
<tr>
<td><%= link_to broadcast.title, internal_broadcast_path(broadcast.id) %></td>
<td class="justify-content-center">
<h5>
<div class="badge badge-<%= broadcast.active? ? "success" : "warning" %>">
<%= broadcast.active? ? "Active" : "Inactive" %>
</div>
</h5>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= csrf_meta_tags %>