docbrown/app/views/admin/broadcasts/show.html.erb
ludwiczakpawel bf8e2e53f1
Titles & subtitles cleanup (#10508)
* .

* .

* .
2020-10-02 12:37:39 +02:00

47 lines
1.4 KiB
Text

<header class="flex">
<h2 class="crayons-title mb-6"><%= @broadcast.title %></h2>
<div class="ml-auto">
<%= link_to "Destroy", url_for(action: :destroy, id: @broadcast.id), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-danger" %>
<%= link_to "Edit", edit_admin_broadcast_path, class: "btn btn-primary" %>
</div>
</header>
<div class="crayons-card p-6 grid gap-4 mb-6">
<div>
<p class="fw-bold">Type</p>
<p><%= @broadcast.type_of %></p>
</div>
<div>
<p class="fw-bold">Content</p>
<p><%= @broadcast.processed_html %></p>
</div>
<div>
<p class="fw-bold">Last active</p>
<p><%= @broadcast.active_status_updated_at&.strftime("%b %d, %Y %H:%M UTC") %></p>
</div>
<div>
<p class="fw-bold">Status</p>
<p>
<span class="badge badge-<%= @broadcast.active? ? "success" : "warning" %>">
<%= @broadcast.active? ? "Active" : "Inactive" %>
</span>
</p>
</div>
</div>
<% if @broadcast.processed_html %>
<div class="crayons-card p-6">
<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 %>
<%= csrf_meta_tags %>