replace old user links with new format
This commit is contained in:
@@ -4,7 +4,7 @@ module PostAppealsHelper
|
||||
html << '<ul>'
|
||||
|
||||
post.appeals.each do |appeal|
|
||||
html << '<li>' + 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) + '</li>'
|
||||
html << '<li>' + DText.parse_inline(appeal.reason).html_safe + ' - ' + link_to_user(appeal.creator) + ' ' + time_ago_in_words_tagged(appeal.created_at) + '</li>'
|
||||
end
|
||||
|
||||
html << '</ul>'
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<td><%= artist_version_other_names_diff(artist_version) %></td>
|
||||
<td><%= artist_version.group_name %></td>
|
||||
<td><%= compact_time artist_version.created_at %></td>
|
||||
<td><%= link_to artist_version.updater_name, user_path(artist_version.updater_id), { :class => artist_version.updater.level_class } %></td>
|
||||
<td><%= link_to_user artist_version.updater %></td>
|
||||
<td><%= artist_version.is_active? %></td>
|
||||
<td>
|
||||
<ul>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<tbody>
|
||||
<% @bans.each do |ban| %>
|
||||
<tr id="ban-<%= ban.id %>">
|
||||
<td><%= link_to(ban.user.name, user_path(ban.user_id), { :class => ban.user.level_class }) %></td>
|
||||
<td><%= link_to_user(ban.user) %></td>
|
||||
<td><%= ban.expires_at %></td>
|
||||
<td><%= ban.reason %></td>
|
||||
<td>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="show">
|
||||
<h1>Show Ban</h1>
|
||||
<ul>
|
||||
<li><strong>User</strong>: <%= link_to(@ban.user.name, user_path(@ban.user_id), { :class => @ban.user.level_class }) %></li>
|
||||
<li><strong>User</strong>: <%= link_to_user(@ban.user) %></li>
|
||||
<li><strong>Expires</strong>: <%= compact_time @ban.expires_at %></li>
|
||||
<li><strong>Reason</strong>: <%= @ban.reason %></li>
|
||||
</ul>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
</span>
|
||||
<span class="info">
|
||||
<strong>User</strong>
|
||||
<%= link_to(post.uploader_name, user_path(post.uploader_id), { :class => post.uploader.level_class }) %>
|
||||
<%= link_to_user(post.uploader) %>
|
||||
</span>
|
||||
<span class="info">
|
||||
<strong>Rating</strong>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<article class="comment" data-post-id="<%= comment.post_id %>" data-comment-id="<%= comment.id %>" data-score="<%= comment.score %>">
|
||||
<div class="author">
|
||||
<h1><%= link_to comment.creator_name, user_path(comment.creator_id), { :class => comment.creator.level_class } %></h1>
|
||||
<h1><%= link_to_user comment.creator %></h1>
|
||||
<p>
|
||||
<%= time_ago_in_words_tagged(comment.created_at) %>
|
||||
</p>
|
||||
@@ -10,7 +10,7 @@
|
||||
<%= format_text(comment.body) %>
|
||||
|
||||
<% if comment.updater_id.present? && (comment.updater_id != comment.creator_id || comment.created_at != comment.updated_at) %>
|
||||
<p class="info">Updated by <%= link_to comment.updater_name, user_path(comment.updater_id), { :class => comment.updater.level_class } %> <%= time_ago_in_words_tagged(comment.updated_at) %></p>
|
||||
<p class="info">Updated by <%= link_to_user comment.updater %> <%= time_ago_in_words_tagged(comment.updated_at) %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
<% @dmails.each do |dmail| %>
|
||||
<tr class="read-<%= dmail.is_read? %>">
|
||||
<td><%= compact_time(dmail.created_at) %></td>
|
||||
<td><%= link_to dmail.from_name, user_path(dmail.from), { :class => dmail.from.level_class } %></td>
|
||||
<td><%= link_to dmail.to_name, user_path(dmail.to), { :class => dmail.to.level_class } %></td>
|
||||
<td><%= link_to_user dmail.from %></td>
|
||||
<td><%= link_to_user dmail.to %></td>
|
||||
<td><%= link_to dmail.title, dmail_path(dmail) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<h2><%= @dmail.title %></h2>
|
||||
|
||||
<ul style="margin-bottom: 1em;">
|
||||
<li><strong>Sender</strong>: <%= link_to @dmail.from_name, user_path(@dmail.from_id), { :class => @dmail.from.level_class } %></li>
|
||||
<li><strong>Recipient</strong>: <%= link_to @dmail.to_name, user_path(@dmail.to_id), { :class => @dmail.to.level_class } %></li>
|
||||
<li><strong>Sender</strong>: <%= link_to_user @dmail.from %></li>
|
||||
<li><strong>Recipient</strong>: <%= link_to_user @dmail.to %></li>
|
||||
<li><strong>Date</strong>: <%= compact_time(@dmail.created_at) %></li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<article data-forum-post-id="<%= forum_post.id %>">
|
||||
<div class="author">
|
||||
<h4>
|
||||
<%= link_to forum_post.creator.name, user_path(forum_post.creator_id), { :class => forum_post.creator.level_class } %>
|
||||
<%= link_to_user forum_post.creator %>
|
||||
<% if forum_post.is_deleted? %>
|
||||
(deleted)
|
||||
<% end %>
|
||||
@@ -16,7 +16,7 @@
|
||||
<%= format_text(forum_post.body) %>
|
||||
</div>
|
||||
<% if forum_post.updater_id != forum_post.creator_id %>
|
||||
<p class="info">Updated by <%= link_to forum_post.updater_name, user_path(forum_post.updater_id), { :class => forum_post.updater.level_class } %> <%= time_ago_in_words_tagged(forum_post.updated_at) %></p>
|
||||
<p class="info">Updated by <%= link_to_user forum_post.updater %> <%= time_ago_in_words_tagged(forum_post.updated_at) %></p>
|
||||
<% end %>
|
||||
<menu>
|
||||
<li>ID: <%= forum_post.id %></li>
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
<span class="locked-topic">(locked)</span>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= link_to topic.creator.name, user_path(topic.creator), { :class => topic.creator.level_class } %></td>
|
||||
<td><%= link_to topic.updater.name, user_path(topic.updater), { :class => topic.updater.level_class } %></td>
|
||||
<td><%= link_to_user topic.creator %></td>
|
||||
<td><%= link_to_user topic.updater %></td>
|
||||
<td><%= compact_time topic.updated_at %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<% @mod_actions.each do |mod_action| %>
|
||||
<tr>
|
||||
<td><%= compact_time mod_action.created_at %></td>
|
||||
<td><%= link_to mod_action.creator.name, user_path(mod_action.creator), { :class => mod_action.creator.level_class } %></td>
|
||||
<td><%= link_to_user mod_action.creator %></td>
|
||||
<td><%= format_text(mod_action.description) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<tbody>
|
||||
<% @dashboard.mod_actions.each do |mod_action| %>
|
||||
<tr>
|
||||
<td><%= link_to mod_action.creator.name, user_path(mod_action.creator), { :class => mod_action.creator.level_class } %></td>
|
||||
<td><%= link_to_user mod_action.creator %></td>
|
||||
<td><%= format_text(mod_action.description) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<tbody>
|
||||
<% @dashboard.user_feedbacks.each do |record| %>
|
||||
<tr class="feedback-category-<%= record.category %>">
|
||||
<td><%= link_to(record.user.name, user_path(record.user), { :class => record.user.level_class }) %></td>
|
||||
<td><%= link_to_user(record.user) %></td>
|
||||
<td><%= format_text(record.body) %></td>
|
||||
<td><%= time_ago_in_words_tagged(record.created_at) %></td>
|
||||
</tr>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<ul>
|
||||
<% @users.each do |user| %>
|
||||
<li><%= link_to user.name, user_path(user), { :class => user.level_class } %></li>
|
||||
<li><%= link_to_user user %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<%= note_version.updater_ip_addr %>
|
||||
</td>
|
||||
<% end %>
|
||||
<td><%= link_to note_version.updater.try(:name), user_path(note_version.updater), { :class => note_version.updater.level_class } %></td>
|
||||
<td><%= link_to_user note_version.updater %></td>
|
||||
<td><%= compact_time note_version.updated_at %></td>
|
||||
<td>
|
||||
<% if CurrentUser.is_member? %>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<% @notes.each do |note| %>
|
||||
<tr>
|
||||
<td><%= link_to note.post_id, post_path(note.post_id) %></td>
|
||||
<td><%= link_to note.creator.name, user_path(note.creator_id), { :class => note.creator.level_class } %></td>
|
||||
<td><%= link_to_user note.creator %></td>
|
||||
<td><%= compact_time(note.created_at) %></td>
|
||||
<td><%= note.is_active? %></td>
|
||||
<td><%= format_text(note.body) %></td>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<td><%= link_to pool_version.pool.pretty_name, pool_path(pool_version.pool_id) %></td>
|
||||
<td><%= link_to pool_version.post_id_array.size, pool_versions_path(:search => {:pool_id => pool_version.pool_id}) %></td>
|
||||
<td><%= pool_version_diff(pool_version) %></td>
|
||||
<td><%= link_to pool_version.updater_name, user_path(pool_version.updater_id), { :class => pool_version.updater.level_class } %></td>
|
||||
<td><%= link_to_user pool_version.updater%></td>
|
||||
<td>
|
||||
<% if CurrentUser.is_janitor? %>
|
||||
<%= pool_version.updater_ip_addr %>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<%= link_to h(pool.pretty_name), pool_path(pool) %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to h(pool.creator.name), user_path(pool.creator), { :class => pool.creator.level_class } %>
|
||||
<%= link_to_user pool.creator %>
|
||||
</td>
|
||||
<td>
|
||||
<%= pool.post_count %>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<% @post_appeals.each do |post_appeal| %>
|
||||
<tr>
|
||||
<td><%= PostPresenter.preview(post_appeal.post, :tags => "status:any") %></td>
|
||||
<td><%= link_to post_appeal.creator.name, user_path(post_appeal.creator), { :class => post_appeal.creator.level_class } %></td>
|
||||
<td><%= link_to_user post_appeal.creator %></td>
|
||||
<td><%= format_text post_appeal.reason %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<td><%= PostPresenter.preview(post_flag.post, :tags => "status:any") %></td>
|
||||
<% if CurrentUser.user.is_janitor? %>
|
||||
<td>
|
||||
<%= link_to post_flag.creator.name, user_path(post_flag.creator), { :class => post_flag.creator.level_class } %>
|
||||
<%= link_to_user post_flag.creator %>
|
||||
</td>
|
||||
<% end %>
|
||||
<td><%= format_text post_flag.reason %></td>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<td><%= compact_time(post_version.updated_at) %></td>
|
||||
<td>
|
||||
<% 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 %>
|
||||
</td>
|
||||
<td><%= post_version.rating %></td>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<ul>
|
||||
<li>ID: <%= post.id %></li>
|
||||
<li>Uploader: <%= link_to_unless(post.uploader.nil?, post.uploader_name, user_path(post.uploader), { :class => post.uploader.level_class }) %></li>
|
||||
<li>Uploader: <%= link_to_user_unless(post.uploader.nil?, post.uploader) %></li>
|
||||
<li>Date: <%= link_to time_ago_in_words_tagged(post.created_at), posts_path(:tags => "date:#{post.created_at.to_date}") %></li>
|
||||
<% if post.approver %>
|
||||
<li>Approver: <%= link_to(post.approver.name, user_path(post.approver_id), { :class => post.approver.level_class }) %></li>
|
||||
<li>Approver: <%= link_to_user(post.approver) %></li>
|
||||
<% end %>
|
||||
<li>
|
||||
Size: <%= link_to_if Danbooru.config.can_user_see_post?(CurrentUser.user, post), number_to_human_size(post.file_size), post.file_url %>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<tbody>
|
||||
<% User.find(:all, :conditions => ["level >= ?", CONFIG["user_levels"]["Test Janitor"]], :order => "level, name").each do |user| %>
|
||||
<tr>
|
||||
<td><%= link_to user.name, user_path(user, :host => Danbooru.config.hostname, :only_path => false), { :class => user.level_class } %></td>
|
||||
<td><%= link_to user.name, user_path(user, :host => Danbooru.config.hostname, :only_path => false) %></td>
|
||||
<td><%= user.pretty_level %></td>
|
||||
<td style="text-align: right;"><%= 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]) %></td>
|
||||
<td style="text-align: right;"><%= 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]) %></td>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<% @uploads.each do |upload| %>
|
||||
<tr>
|
||||
<td><%= link_to upload.id, upload_path(upload) %></td>
|
||||
<td><%= link_to upload.uploader.name, user_path(upload.uploader), { :class => upload.uploader.level_class } %></td>
|
||||
<td><%= link_to_user upload.uploader %></td>
|
||||
<td><%= upload.presenter.status(self) %></td>
|
||||
<td><%= compact_time upload.created_at %></td>
|
||||
<td><%= upload.tag_string %></td>
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
<tbody>
|
||||
<% @user_feedbacks.each do |feedback| %>
|
||||
<tr class="feedback-category-<%= feedback.category %>">
|
||||
<td><%= link_to feedback.user_name, user_path(feedback.user_id), { :class => feedback.user.level_class } %></td>
|
||||
<td><%= link_to feedback.creator_name, user_path(feedback.creator_id), { :class => feedback.creator.level_class } %></td>
|
||||
<td><%= link_to_user feedback.user %></td>
|
||||
<td><%= link_to_user feedback.creator %></td>
|
||||
<td><%= compact_time(feedback.created_at) %></td>
|
||||
<td><%= format_text(feedback.body) %></td>
|
||||
<td>
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<%= 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 %>
|
||||
</td>
|
||||
<td><%= link_to user.posts.count, posts_path(:tags => "user:#{user.name}") %></td>
|
||||
|
||||
@@ -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 %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<% @wiki_pages.each do |wiki_page| %>
|
||||
<tr>
|
||||
<td class="tag-category-<%= wiki_page.category_name %>"><%= link_to wiki_page.pretty_title, wiki_page_path(wiki_page, :noredirect => 1) %></td>
|
||||
<td><%= 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 } %></td>
|
||||
<td><%= wiki_page.updated_at.strftime("%Y-%m-%d %I:%M") %> by <%= h link_to_user wiki_page.updater %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user