diff --git a/app/helpers/post_appeals_helper.rb b/app/helpers/post_appeals_helper.rb
index af39daa6a..7cbe4c3de 100644
--- a/app/helpers/post_appeals_helper.rb
+++ b/app/helpers/post_appeals_helper.rb
@@ -4,7 +4,7 @@ module PostAppealsHelper
html << '
'
post.appeals.each do |appeal|
- html << '- ' + DText.parse_inline(appeal.reason).html_safe + ' - ' + link_to(appeal.creator.name, user_path(appeal.creator), { :class => appeal.creator.level_class }) + ' ' + time_ago_in_words_tagged(appeal.created_at) + '
'
+ html << '- ' + DText.parse_inline(appeal.reason).html_safe + ' - ' + link_to_user(appeal.creator) + ' ' + time_ago_in_words_tagged(appeal.created_at) + '
'
end
html << '
'
diff --git a/app/helpers/post_flags_helper.rb b/app/helpers/post_flags_helper.rb
index 3becc3c80..8c9fbe3a4 100644
--- a/app/helpers/post_flags_helper.rb
+++ b/app/helpers/post_flags_helper.rb
@@ -8,7 +8,7 @@ module PostFlagsHelper
html << DText.parse_inline(flag.reason).html_safe
if CurrentUser.is_janitor?
- html << ' - ' + link_to(flag.creator.name, user_path(flag.creator), { :class => flag.creator.level_class })
+ html << ' - ' + link_to_user(flag.creator)
end
html << ' - ' + time_ago_in_words_tagged(flag.created_at)
diff --git a/app/presenters/user_presenter.rb b/app/presenters/user_presenter.rb
index 788fd982a..204c34356 100644
--- a/app/presenters/user_presenter.rb
+++ b/app/presenters/user_presenter.rb
@@ -105,7 +105,7 @@ class UserPresenter
def inviter(template)
if user.inviter_id
- template.link_to(user.inviter.name, template.user_path(user.inviter_id), { :class => user.inviter.level_class })
+ template.link_to_user(user.inviter)
else
"None"
end
diff --git a/app/views/artist_versions/index.html.erb b/app/views/artist_versions/index.html.erb
index ec2b72bf2..6f6014183 100644
--- a/app/views/artist_versions/index.html.erb
+++ b/app/views/artist_versions/index.html.erb
@@ -27,7 +27,7 @@
<%= artist_version_other_names_diff(artist_version) %> |
<%= artist_version.group_name %> |
<%= compact_time artist_version.created_at %> |
- <%= link_to artist_version.updater_name, user_path(artist_version.updater_id), { :class => artist_version.updater.level_class } %> |
+ <%= link_to_user artist_version.updater %> |
<%= artist_version.is_active? %> |
diff --git a/app/views/bans/index.html.erb b/app/views/bans/index.html.erb
index 2d88d3d44..9f6e95606 100644
--- a/app/views/bans/index.html.erb
+++ b/app/views/bans/index.html.erb
@@ -14,7 +14,7 @@
<% @bans.each do |ban| %>
- | <%= link_to(ban.user.name, user_path(ban.user_id), { :class => ban.user.level_class }) %> |
+ <%= link_to_user(ban.user) %> |
<%= ban.expires_at %> |
<%= ban.reason %> |
diff --git a/app/views/bans/show.html.erb b/app/views/bans/show.html.erb
index 7291b088a..e76fb3249 100644
--- a/app/views/bans/show.html.erb
+++ b/app/views/bans/show.html.erb
@@ -2,7 +2,7 @@
Show Ban
- - User: <%= link_to(@ban.user.name, user_path(@ban.user_id), { :class => @ban.user.level_class }) %>
+ - User: <%= link_to_user(@ban.user) %>
- Expires: <%= compact_time @ban.expires_at %>
- Reason: <%= @ban.reason %>
diff --git a/app/views/comments/partials/index/_header.html.erb b/app/views/comments/partials/index/_header.html.erb
index 98d7807b6..9724e6758 100644
--- a/app/views/comments/partials/index/_header.html.erb
+++ b/app/views/comments/partials/index/_header.html.erb
@@ -6,7 +6,7 @@
User
- <%= link_to(post.uploader_name, user_path(post.uploader_id), { :class => post.uploader.level_class }) %>
+ <%= link_to_user(post.uploader) %>
Rating
diff --git a/app/views/comments/partials/show/_comment.html.erb b/app/views/comments/partials/show/_comment.html.erb
index 5296df968..4a008bbbf 100644
--- a/app/views/comments/partials/show/_comment.html.erb
+++ b/app/views/comments/partials/show/_comment.html.erb
@@ -1,6 +1,6 @@
|
- <%= link_to topic.creator.name, user_path(topic.creator), { :class => topic.creator.level_class } %> |
- <%= link_to topic.updater.name, user_path(topic.updater), { :class => topic.updater.level_class } %> |
+ <%= link_to_user topic.creator %> |
+ <%= link_to_user topic.updater %> |
<%= compact_time topic.updated_at %> |
<% end %>
diff --git a/app/views/mod_actions/index.html.erb b/app/views/mod_actions/index.html.erb
index 9c17f7c05..32f30d5ef 100644
--- a/app/views/mod_actions/index.html.erb
+++ b/app/views/mod_actions/index.html.erb
@@ -13,7 +13,7 @@
<% @mod_actions.each do |mod_action| %>
| <%= compact_time mod_action.created_at %> |
- <%= link_to mod_action.creator.name, user_path(mod_action.creator), { :class => mod_action.creator.level_class } %> |
+ <%= link_to_user mod_action.creator %> |
<%= format_text(mod_action.description) %> |
<% end %>
diff --git a/app/views/moderator/dashboards/_activity_mod_action.html.erb b/app/views/moderator/dashboards/_activity_mod_action.html.erb
index 749ec4c71..8c0f86af6 100644
--- a/app/views/moderator/dashboards/_activity_mod_action.html.erb
+++ b/app/views/moderator/dashboards/_activity_mod_action.html.erb
@@ -9,7 +9,7 @@
<% @dashboard.mod_actions.each do |mod_action| %>
- | <%= link_to mod_action.creator.name, user_path(mod_action.creator), { :class => mod_action.creator.level_class } %> |
+ <%= link_to_user mod_action.creator %> |
<%= format_text(mod_action.description) %> |
<% end %>
diff --git a/app/views/moderator/dashboards/_activity_user_feedback.html.erb b/app/views/moderator/dashboards/_activity_user_feedback.html.erb
index 940757c30..c176e3634 100644
--- a/app/views/moderator/dashboards/_activity_user_feedback.html.erb
+++ b/app/views/moderator/dashboards/_activity_user_feedback.html.erb
@@ -10,7 +10,7 @@
<% @dashboard.user_feedbacks.each do |record| %>
- | <%= link_to(record.user.name, user_path(record.user), { :class => record.user.level_class }) %> |
+ <%= link_to_user(record.user) %> |
<%= format_text(record.body) %> |
<%= time_ago_in_words_tagged(record.created_at) %> |
diff --git a/app/views/moderator/invitations/index.html.erb b/app/views/moderator/invitations/index.html.erb
index 7e7556a6e..abb81f54c 100644
--- a/app/views/moderator/invitations/index.html.erb
+++ b/app/views/moderator/invitations/index.html.erb
@@ -4,7 +4,7 @@
<% @users.each do |user| %>
- - <%= link_to user.name, user_path(user), { :class => user.level_class } %>
+ - <%= link_to_user user %>
<% end %>
diff --git a/app/views/note_versions/index.html.erb b/app/views/note_versions/index.html.erb
index 2758c587b..50d9e6486 100644
--- a/app/views/note_versions/index.html.erb
+++ b/app/views/note_versions/index.html.erb
@@ -29,7 +29,7 @@
<%= note_version.updater_ip_addr %>
<% end %>
- <%= link_to note_version.updater.try(:name), user_path(note_version.updater), { :class => note_version.updater.level_class } %> |
+ <%= link_to_user note_version.updater %> |
<%= compact_time note_version.updated_at %> |
<% if CurrentUser.is_member? %>
diff --git a/app/views/notes/index_by_note.html.erb b/app/views/notes/index_by_note.html.erb
index 4d31ea455..571ba4d38 100644
--- a/app/views/notes/index_by_note.html.erb
+++ b/app/views/notes/index_by_note.html.erb
@@ -16,7 +16,7 @@
<% @notes.each do |note| %>
|
| <%= link_to note.post_id, post_path(note.post_id) %> |
- <%= link_to note.creator.name, user_path(note.creator_id), { :class => note.creator.level_class } %> |
+ <%= link_to_user note.creator %> |
<%= compact_time(note.created_at) %> |
<%= note.is_active? %> |
<%= format_text(note.body) %> |
diff --git a/app/views/pool_versions/index.html.erb b/app/views/pool_versions/index.html.erb
index a916c6748..128798f51 100644
--- a/app/views/pool_versions/index.html.erb
+++ b/app/views/pool_versions/index.html.erb
@@ -20,7 +20,7 @@
<%= link_to pool_version.pool.pretty_name, pool_path(pool_version.pool_id) %> |
<%= link_to pool_version.post_id_array.size, pool_versions_path(:search => {:pool_id => pool_version.pool_id}) %> |
<%= pool_version_diff(pool_version) %> |
- <%= link_to pool_version.updater_name, user_path(pool_version.updater_id), { :class => pool_version.updater.level_class } %> |
+ <%= link_to_user pool_version.updater%> |
<% if CurrentUser.is_janitor? %>
<%= pool_version.updater_ip_addr %>
diff --git a/app/views/pools/index.html.erb b/app/views/pools/index.html.erb
index bcda70dea..68c27ed12 100644
--- a/app/views/pools/index.html.erb
+++ b/app/views/pools/index.html.erb
@@ -19,7 +19,7 @@
<%= link_to h(pool.pretty_name), pool_path(pool) %>
|
- <%= link_to h(pool.creator.name), user_path(pool.creator), { :class => pool.creator.level_class } %>
+ <%= link_to_user pool.creator %>
|
<%= pool.post_count %>
diff --git a/app/views/post_appeals/index.html.erb b/app/views/post_appeals/index.html.erb
index e55f3c7f9..78c806bfb 100644
--- a/app/views/post_appeals/index.html.erb
+++ b/app/views/post_appeals/index.html.erb
@@ -13,7 +13,7 @@
<% @post_appeals.each do |post_appeal| %>
|
| <%= PostPresenter.preview(post_appeal.post, :tags => "status:any") %> |
- <%= link_to post_appeal.creator.name, user_path(post_appeal.creator), { :class => post_appeal.creator.level_class } %> |
+ <%= link_to_user post_appeal.creator %> |
<%= format_text post_appeal.reason %> |
<% end %>
diff --git a/app/views/post_flags/index.html.erb b/app/views/post_flags/index.html.erb
index ca53ef758..8d77e466c 100644
--- a/app/views/post_flags/index.html.erb
+++ b/app/views/post_flags/index.html.erb
@@ -17,7 +17,7 @@
<%= PostPresenter.preview(post_flag.post, :tags => "status:any") %> |
<% if CurrentUser.user.is_janitor? %>
- <%= link_to post_flag.creator.name, user_path(post_flag.creator), { :class => post_flag.creator.level_class } %>
+ <%= link_to_user post_flag.creator %>
|
<% end %>
<%= format_text post_flag.reason %> |
diff --git a/app/views/post_versions/_listing.html.erb b/app/views/post_versions/_listing.html.erb
index 6c634124e..86e883b4c 100644
--- a/app/views/post_versions/_listing.html.erb
+++ b/app/views/post_versions/_listing.html.erb
@@ -21,7 +21,7 @@
<%= compact_time(post_version.updated_at) %> |
<% if post_version.updater %>
- <%= link_to(post_version.updater.name, user_path(post_version.updater_id), { :class => post_version.updater.level_class } ) %>
+ <%= link_to_user(post_version.updater) %>
<% end %>
|
<%= post_version.rating %> |
diff --git a/app/views/posts/partials/show/_information.html.erb b/app/views/posts/partials/show/_information.html.erb
index 4ac51b9f1..19c96c9ac 100644
--- a/app/views/posts/partials/show/_information.html.erb
+++ b/app/views/posts/partials/show/_information.html.erb
@@ -1,9 +1,9 @@
- ID: <%= post.id %>
- - Uploader: <%= link_to_unless(post.uploader.nil?, post.uploader_name, user_path(post.uploader), { :class => post.uploader.level_class }) %>
+ - Uploader: <%= link_to_user_unless(post.uploader.nil?, post.uploader) %>
- Date: <%= link_to time_ago_in_words_tagged(post.created_at), posts_path(:tags => "date:#{post.created_at.to_date}") %>
<% if post.approver %>
- - Approver: <%= link_to(post.approver.name, user_path(post.approver_id), { :class => post.approver.level_class }) %>
+ - Approver: <%= link_to_user(post.approver) %>
<% end %>
-
Size: <%= link_to_if Danbooru.config.can_user_see_post?(CurrentUser.user, post), number_to_human_size(post.file_size), post.file_url %>
diff --git a/app/views/report_mailer/moderator_report.html.erb b/app/views/report_mailer/moderator_report.html.erb
index 7d91e3aa8..ad92347d5 100644
--- a/app/views/report_mailer/moderator_report.html.erb
+++ b/app/views/report_mailer/moderator_report.html.erb
@@ -19,7 +19,7 @@
<% User.find(:all, :conditions => ["level >= ?", CONFIG["user_levels"]["Test Janitor"]], :order => "level, name").each do |user| %>
- | <%= link_to user.name, user_path(user, :host => Danbooru.config.hostname, :only_path => false), { :class => user.level_class } %> |
+ <%= link_to user.name, user_path(user, :host => Danbooru.config.hostname, :only_path => false) %> |
<%= user.pretty_level %> |
<%= Post.count(:conditions => ["created_at >= ? AND approver_id = ?", 1.days.ago, user.id]) %>/<%= Post.count(:conditions => ["created_at >= ? AND (approver_id IS NOT NULL OR status = 'pending')", 1.days.ago]) %> |
<%= Post.count(:conditions => ["created_at >= ? AND approver_id = ?", 7.days.ago, user.id]) %>/<%= Post.count(:conditions => ["created_at >= ? AND (approver_id IS NOT NULL OR status = 'pending')", 7.days.ago]) %> |
diff --git a/app/views/uploads/index.html.erb b/app/views/uploads/index.html.erb
index 5ea9e25fa..6f1e2ac55 100644
--- a/app/views/uploads/index.html.erb
+++ b/app/views/uploads/index.html.erb
@@ -14,7 +14,7 @@
<% @uploads.each do |upload| %>
| <%= link_to upload.id, upload_path(upload) %> |
- <%= link_to upload.uploader.name, user_path(upload.uploader), { :class => upload.uploader.level_class } %> |
+ <%= link_to_user upload.uploader %> |
<%= upload.presenter.status(self) %> |
<%= compact_time upload.created_at %> |
<%= upload.tag_string %> |
diff --git a/app/views/user_feedbacks/index.html.erb b/app/views/user_feedbacks/index.html.erb
index ce4601949..bec7a78f2 100644
--- a/app/views/user_feedbacks/index.html.erb
+++ b/app/views/user_feedbacks/index.html.erb
@@ -15,8 +15,8 @@
<% @user_feedbacks.each do |feedback| %>
- | <%= link_to feedback.user_name, user_path(feedback.user_id), { :class => feedback.user.level_class } %> |
- <%= link_to feedback.creator_name, user_path(feedback.creator_id), { :class => feedback.creator.level_class } %> |
+ <%= link_to_user feedback.user %> |
+ <%= link_to_user feedback.creator %> |
<%= compact_time(feedback.created_at) %> |
<%= format_text(feedback.body) %> |
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
index 1ac0d48b9..0fdcfdf55 100644
--- a/app/views/users/index.html.erb
+++ b/app/views/users/index.html.erb
@@ -30,9 +30,9 @@
<% end %>
|
- <%= link_to user.pretty_name, user_path(user.id), { :class => user.level_class } %>
+ <%= link_to_user user %>
<% if user.inviter %>
- ← <%= link_to user.inviter.name, user_path(user.inviter_id), { :class => user.inviter.level_class } %>
+ ← <%= link_to_user user.inviter %>
<% end %>
|
<%= link_to user.posts.count, posts_path(:tags => "user:#{user.name}") %> |
diff --git a/app/views/wiki_page_versions/index.html.erb b/app/views/wiki_page_versions/index.html.erb
index 8bad2d85f..fdf4a120c 100644
--- a/app/views/wiki_page_versions/index.html.erb
+++ b/app/views/wiki_page_versions/index.html.erb
@@ -43,7 +43,7 @@
<%= compact_time(wiki_page_version.updated_at) %>
<% if wiki_page_version.updater %>
by
- <%= link_to wiki_page_version.updater_name, user_path(wiki_page_version.updater), { :class => wiki_page_version.updater.level_class } %>
+ <%= link_to_user wiki_page_version.updater %>
<% end %>
diff --git a/app/views/wiki_pages/index.html.erb b/app/views/wiki_pages/index.html.erb
index 41e6438e4..354f6c98d 100644
--- a/app/views/wiki_pages/index.html.erb
+++ b/app/views/wiki_pages/index.html.erb
@@ -16,7 +16,7 @@
<% @wiki_pages.each do |wiki_page| %>
| <%= link_to wiki_page.pretty_title, wiki_page_path(wiki_page, :noredirect => 1) %> |
- <%= wiki_page.updated_at.strftime("%Y-%m-%d %I:%M") %> by <%= h link_to wiki_page.updater_name, user_path(wiki_page.updater_id), { :class => wiki_page.updater.level_class } %> |
+ <%= wiki_page.updated_at.strftime("%Y-%m-%d %I:%M") %> by <%= h link_to_user wiki_page.updater %> |
<% end %>
|