style tweaks
This commit is contained in:
@@ -438,5 +438,13 @@ class User < ActiveRecord::Base
|
||||
def can_update?(object, foreign_key = :user_id)
|
||||
is_moderator? || is_admin? || object.__send__(foreign_key) == id
|
||||
end
|
||||
|
||||
def dmail_count
|
||||
if has_mail?
|
||||
"(#{dmails.unread.count})"
|
||||
else
|
||||
""
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<% if CurrentUser.user.is_anonymous? %>
|
||||
<%= nav_link_to("Sign in", new_session_path, :class => "login") %>
|
||||
<% else %>
|
||||
<%= nav_link_to("My Account", user_path(CurrentUser.user)) %>
|
||||
<%= nav_link_to("My Account #{CurrentUser.dmail_count}", user_path(CurrentUser.user)) %>
|
||||
<% end %>
|
||||
<%= nav_link_to("Posts", posts_path) %>
|
||||
<%= nav_link_to("Comments", comments_path(:group_by => "post")) %>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<li><%= link_to "Unfavorite", favorite_path(post), :remote => true, :method => :delete, :id => "remove-from-favorites" %></li>
|
||||
<li><%= link_to "Pool", "#", :id => "pool" %></li>
|
||||
<li><%= link_to "Translate", "#", :id => "translate", :title => "Shortcut is CTRL+N" %></li>
|
||||
<li><%= link_to "Find similar", "http://danbooru.iqdb.org/db-search.php?url=#{post.preview_file_url}" %></li>
|
||||
<li><%= link_to "Find similar", "http://danbooru.iqdb.org/db-search.php?url=http://#{Danbooru.config.hostname}#{post.preview_file_url}" %></li>
|
||||
|
||||
<% unless post.is_status_locked? %>
|
||||
<% if !post.is_deleted? && !post.is_pending? %>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<% if @user.id == CurrentUser.id %>
|
||||
<li><%= link_to "Settings", edit_user_path(CurrentUser.user) %></li>
|
||||
<li><%= link_to "Profile", user_path(CurrentUser.user) %></li>
|
||||
<li><%= link_to "Messages (#{CurrentUser.dmails.unread.count})", dmails_path(:search => {:owner_id_eq => CurrentUser.id, :to_id_eq => CurrentUser.id}) %></li>
|
||||
<li><%= link_to "Messages #{CurrentUser.dmail_count}", dmails_path(:search => {:owner_id_eq => CurrentUser.id, :to_id_eq => CurrentUser.id}) %></li>
|
||||
<% else %>
|
||||
<li><%= link_to "Send message", new_dmail_path(:dmail => {:to_id => @user.id}) %></li>
|
||||
<% end %>
|
||||
|
||||
11
script/trim.sql
Normal file
11
script/trim.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
set statement_timeout = 0;
|
||||
delete from posts where id < 1000000;
|
||||
delete from comments where post_id < 1000000;
|
||||
delete from favorites where post_id < 1000000;
|
||||
delete from flagged_post_details where post_id < 1000000;
|
||||
delete from note_versions where post_id < 1000000;
|
||||
delete from notes where post_id < 1000000;
|
||||
delete from pools_posts where post_id < 1000000;
|
||||
delete from post_appeals where post_id < 1000000;
|
||||
delete from post_tag_histories where post_id < 1000000;
|
||||
delete from post_votes where post_id < 1000000;
|
||||
Reference in New Issue
Block a user