Error popup only shows on flash[:error]
This commit is contained in:
parent
39604d30ce
commit
43bc704468
|
@ -78,7 +78,7 @@ class PagesController < ApplicationController
|
||||||
protected
|
protected
|
||||||
def save_from_no_lang_for_page
|
def save_from_no_lang_for_page
|
||||||
if @item.nil? or !@item.enabled_for_lang(I18n.locale.to_s)
|
if @item.nil? or !@item.enabled_for_lang(I18n.locale.to_s)
|
||||||
flash[:notice] = t('sys.module_page_lang_not_support')
|
flash[:error] = t('sys.module_page_lang_not_support')
|
||||||
redirect_to '/'
|
redirect_to '/'
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
|
|
|
@ -13,12 +13,10 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<%= yield %>
|
<%= yield %>
|
||||||
<% if !flash.empty? %>
|
<% if flash[:error] %>
|
||||||
<div class="modal alert alert-error hide" id="myModal">
|
<div class="modal alert alert-error hide" id="myModal">
|
||||||
<p type="button" class="close" data-dismiss="modal">×</p>
|
<p type="button" class="close" data-dismiss="modal">×</p>
|
||||||
<% flash.each do |key, msg| %>
|
<%= "<strong>#{flash[:error]}</strong><br/>".html_safe%>
|
||||||
<%= "<strong>#{msg}</strong><br/>".html_safe%>
|
|
||||||
<% end%>
|
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
$('#myModal').modal('show')
|
$('#myModal').modal('show')
|
||||||
|
|
|
@ -5,13 +5,13 @@
|
||||||
|
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
<tr>
|
<tr>
|
||||||
<th><%= t('announcement.bulletin.title') %></th>
|
<th class="title"><%= t('announcement.bulletin.title') %></th>
|
||||||
<th class="date"><%= t('announcement.bulletin.postdate') %></th>
|
<th class="date"><%= t('announcement.bulletin.postdate') %></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<% @bulletins.each do |post| %>
|
<% @bulletins.each do |post| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= link_to post.title, panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
|
<td class="title"><%= link_to post.title, panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
|
||||||
</td>
|
</td>
|
||||||
<td class="date"><%= display_date_time(post.postdate) %></td>
|
<td class="date"><%= display_date_time(post.postdate) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Reference in New Issue