Refactor layout flash usage and move to a partial
This commit is contained in:
10
app/views/layouts/_flash.html.erb
Normal file
10
app/views/layouts/_flash.html.erb
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<% flash.each do |flash_key, flash_message| %>
|
||||||
|
<div id="<%= flash_key %>" data-alert class="row" data-closable>
|
||||||
|
<div class="callout <%= flash_key %>">
|
||||||
|
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
<%= flash_message %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
@@ -23,23 +23,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="admin-content small-12 medium-9 column">
|
<div class="admin-content small-12 medium-9 column">
|
||||||
<% if notice %>
|
|
||||||
<div data-alert class="callout success" data-closable>
|
|
||||||
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
<%= notice %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if alert %>
|
<%= render 'layouts/flash' %>
|
||||||
<div data-alert class="callout alert" data-closable>
|
|
||||||
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
<%= alert %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<%= yield %>
|
<%= yield %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -42,27 +42,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
|
|
||||||
<% if notice %>
|
<%= render 'layouts/flash' %>
|
||||||
<div id="notice" data-alert class="row" data-closable>
|
|
||||||
<div class="callout success">
|
|
||||||
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
<%= notice %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if alert %>
|
|
||||||
<div id="alert" data-alert class="row" data-closable>
|
|
||||||
<div class="callout alert">
|
|
||||||
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
<%= alert %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<%= yield %>
|
<%= yield %>
|
||||||
<div class="push"></div>
|
<div class="push"></div>
|
||||||
|
|||||||
@@ -27,23 +27,8 @@
|
|||||||
<div class="row auth">
|
<div class="row auth">
|
||||||
<main>
|
<main>
|
||||||
<div class="small-12 medium-8 large-5 column small-centered panel padding margin-bottom">
|
<div class="small-12 medium-8 large-5 column small-centered panel padding margin-bottom">
|
||||||
<% if notice %>
|
|
||||||
<div data-alert class="callout success" data-closable>
|
|
||||||
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
<%= notice %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if alert %>
|
<%= render 'layouts/flash' %>
|
||||||
<div data-alert class="callout warning" data-closable>
|
|
||||||
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
<%= alert %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<%= yield %>
|
<%= yield %>
|
||||||
</div>
|
</div>
|
||||||
@@ -56,4 +41,4 @@
|
|||||||
<%= render 'layouts/footer' %>
|
<%= render 'layouts/footer' %>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -54,23 +54,8 @@
|
|||||||
<%= render "management/account_info" %>
|
<%= render "management/account_info" %>
|
||||||
|
|
||||||
<div class="admin-content small-12 medium-9 column">
|
<div class="admin-content small-12 medium-9 column">
|
||||||
<% if notice %>
|
|
||||||
<div data-alert class="callout success" data-closable>
|
|
||||||
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
<%= notice %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if alert %>
|
<%= render 'layouts/flash' %>
|
||||||
<div data-alert class="callout alert" data-closable>
|
|
||||||
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
<%= alert %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<%= yield %>
|
<%= yield %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user