active_admin_prism 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,76 @@
1
+ <%# Overrides ActiveAdmin's own layouts/active_admin_logged_out.html.erb
2
+ (used for every Devise page — sign in, sign up, forgot/reset password,
3
+ resend confirmation, resend unlock) purely to upgrade its flash
4
+ rendering to this gem's toast cards (icon + dismiss button + countdown
5
+ bar), matching the same markup lib/active_admin/views/flash_messages.rb
6
+ renders for logged-in pages. Devise's pages route through this plain
7
+ ERB layout instead of ActiveAdmin::Views::Pages::Base/Arbre at all, so
8
+ that Ruby-side override alone never reaches them — this file is the
9
+ only way to reach them. Everything else here is copied verbatim from
10
+ ActiveAdmin core's own version; only the ".flashes" block differs. %>
11
+ <!DOCTYPE html>
12
+ <html lang="<%=I18n.locale%>">
13
+ <head>
14
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
15
+
16
+ <title><%= [@page_title, ActiveAdmin.application.site_title(self)].compact.join(" | ") %></title>
17
+
18
+ <% ActiveAdmin.application.stylesheets.each do |style, options| %>
19
+ <% if ActiveAdmin.application.use_webpacker %>
20
+ <%= stylesheet_pack_tag style, **options %>
21
+ <% else %>
22
+ <%= stylesheet_link_tag style, **options %>
23
+ <% end %>
24
+ <% end %>
25
+ <% ActiveAdmin.application.javascripts.each do |path, options| %>
26
+ <% if ActiveAdmin.application.use_webpacker %>
27
+ <%= javascript_pack_tag path, **options %>
28
+ <% else %>
29
+ <%= javascript_include_tag path, **options %>
30
+ <% end %>
31
+ <% end %>
32
+
33
+ <%= favicon_link_tag ActiveAdmin.application.favicon if ActiveAdmin.application.favicon %>
34
+
35
+ <% ActiveAdmin.application.meta_tags_for_logged_out_pages.each do |name, content| %>
36
+ <%= tag(:meta, name: name, content: content) %>
37
+ <% end %>
38
+
39
+ <%= csrf_meta_tags %>
40
+ <%= csp_meta_tag %>
41
+ </head>
42
+ <body class="active_admin logged_out <%= controller.action_name %>">
43
+ <div id="wrapper">
44
+
45
+ <div id="content_wrapper">
46
+ <% prism_config = ActiveAdminPrism.configuration %>
47
+ <% prism_auto_dismiss_ms = prism_config.flash_auto_dismiss_ms %>
48
+ <div class="flashes"
49
+ data-prism-transition-ms="<%= prism_config.flash_transition_ms.to_i %>"
50
+ <%= "data-prism-auto-dismiss-ms=\"#{prism_auto_dismiss_ms}\"".html_safe if prism_auto_dismiss_ms %>>
51
+ <% flash_messages.each do |type, message| %>
52
+ <div class="flash flash_<%= type %>"
53
+ <%= "style=\"--prism-flash-duration: #{prism_auto_dismiss_ms}ms\"".html_safe if prism_auto_dismiss_ms %>>
54
+ <%= ActiveAdminPrism::Icons.svg(ActiveAdminPrism::Icons.flash_icon_name(type), css_class: "prism-flash-icon")&.html_safe %>
55
+ <span class="prism-flash-message"><%= message %></span>
56
+ <% if prism_config.flash_dismissible %>
57
+ <button class="prism-flash-dismiss" type="button" aria-label="Dismiss" data-prism-flash-dismiss="true">
58
+ <%= ActiveAdminPrism::Icons.svg(:x, css_class: "prism-flash-dismiss-icon", size: 14)&.html_safe %>
59
+ </button>
60
+ <% end %>
61
+ <% if prism_auto_dismiss_ms %>
62
+ <div class="prism-flash-progress"></div>
63
+ <% end %>
64
+ </div>
65
+ <% end %>
66
+ </div>
67
+ <div id="active_admin_content">
68
+ <%= yield %>
69
+ </div>
70
+ </div>
71
+ <div id="footer">
72
+ <%= yield :footer %>
73
+ </div>
74
+ </div>
75
+ </body>
76
+ </html>