partial fix for #1363 (notice cannot be closed)

This commit is contained in:
Toks
2013-04-22 19:42:39 -04:00
parent c6b1e5885c
commit 94984fb85a
4 changed files with 12 additions and 1 deletions

View File

@@ -8,7 +8,7 @@ div#page {
overflow: visible;
margin: 0 30px;
div#upgrade-account-notice, div#sign-up-notice, div#tos-notice, div#ban-notice {
div#upgrade-account-notice, div#sign-up-notice, div#tos-notice, div#ban-notice, div#dmail-notice {
margin: 1em 0;
padding: 1em;
text-align: center;

View File

@@ -193,6 +193,10 @@ class AnonymousUser
false
end
def dmail_count
""
end
%w(member banned privileged builder platinum contributor janitor moderator admin).each do |name|
define_method("is_#{name}?") do
false

View File

@@ -48,6 +48,10 @@
<%= render "users/ban_notice" %>
<% end %>
<% if CurrentUser.dmail_count.present? %>
<%= render "users/dmail_notice" %>
<% end %>
<% if cookies["accepted_tos"].blank? && !CurrentUser.is_privileged? %>
<%= render "users/tos" %>
<% end %>

View File

@@ -0,0 +1,3 @@
<div class="ui-corner-all ui-state-highlight" id="dmail-notice">
<h1>You have <%= link_to "unread mail", dmails_path(:search => {:owner_id => CurrentUser.id, :to_id => CurrentUser.id}, :folder => "received") %>.</h1>
</div>