This commit is contained in:
Toks
2013-05-17 13:19:14 -04:00
parent d07219e092
commit 2b427273b2
3 changed files with 11 additions and 2 deletions

View File

@@ -16,6 +16,14 @@ $(function() {
e.preventDefault();
});
$("#hide-dmail-notice").click(function(e) {
$dmail_notice = $("#dmail-notice")
$dmail_notice.hide();
var dmail_id = $dmail_notice.data("id");
Danbooru.Cookie.put("hide_dmail_notice", dmail_id);
e.preventDefault();
});
$("#close-notice-link").click(function(e) {
$('#notice').fadeOut("fast");
e.preventDefault();

View File

@@ -48,7 +48,7 @@
<%= render "users/ban_notice" %>
<% end %>
<% if CurrentUser.dmail_count.present? %>
<% if CurrentUser.dmail_count.present? && CurrentUser.dmails.unread.present? && cookies[:hide_dmail_notice].to_i != CurrentUser.dmails.unread.first.id %>
<%= render "users/dmail_notice" %>
<% end %>

View File

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