24 lines
1,016 B
Text
24 lines
1,016 B
Text
<% if @admin_banner&.active? %>
|
|
<% unless session[:hide_banner] || current_user&.preference&.banner_seen %>
|
|
<div class="<%= @admin_banner.banner_type %> announcement group" id="admin-banner">
|
|
<blockquote class="userstuff">
|
|
<%= raw sanitize_field(@admin_banner, :content, image_safety_mode: true) %>
|
|
</blockquote>
|
|
<% if current_user.nil? %>
|
|
<p class="submit">
|
|
<%= link_to current_path_with(hide_banner: true), "aria-label": t(".hide"), class: "showme action" do
|
|
content_tag(:span, "×".html_safe, "aria-hidden": true)
|
|
end %>
|
|
</p>
|
|
<% else %>
|
|
<%= form_tag end_banner_user_path(current_user), method: :post, remote: true do %>
|
|
<p class="submit">
|
|
<%= button_tag "aria-label": t(".hide"), class: "showme action" do
|
|
content_tag(:span, "×".html_safe, "aria-hidden": true)
|
|
end %>
|
|
</p>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|