docbrown/app/views/internal/broadcasts/show.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

39 lines
1.5 KiB
Text

<div class="row my-3">
<div class="col">
<div class="list-group-flush w-100">
<a class="list-group-item flex-column align-items-start">
<h3 class="mb-2">Title: <%= @broadcast.title %></h3>
<h3>Broadcast Type: <%= @broadcast.type_of %></h3>
<h3>Content:</h3>
<p>
<%= @broadcast.processed_html %>
</p>
<h3>Last Active On: <%= @broadcast.active_status_updated_at&.strftime("%b %d, %Y %H:%M UTC") %></h3>
<h3>Status:</h3>
<h3>
<span class="badge badge-<%= @broadcast.active? ? "success" : "warning" %>">
<%= @broadcast.active? ? "Active" : "Inactive" %>
</span>
<span class="sr-only">Broadcast Status</span>
</h3>
</a>
<hr>
<% if @broadcast.processed_html %>
<div>
<p><strong>Preview</strong></p>
<div class="broadcast-wrapper visible <%= banner_class(@broadcast) %>">
<div class="broadcast-data">
<%= sanitize @broadcast.processed_html, attributes: %w[href style src] %>
</div>
</div>
<p><em>Please note: announcement broadcasts will render directly below the nav bar once activated.</em></p>
<div>
<% end %>
<hr>
<%= link_to "Destroy Broadcast", url_for(action: :destroy, id: @broadcast.id), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-danger" %>
<%= link_to "Edit Broadcast", edit_internal_broadcast_path, class: "btn btn-primary float-right" %>
</div>
</div>
</div>
<%= csrf_meta_tags %>