replace uploader information post previews and comment listing, rename tagger to top tagger

This commit is contained in:
Albert Yi 2018-03-27 10:49:12 -07:00
parent ce7e31325c
commit 6c790c61d3
4 changed files with 18 additions and 7 deletions

View File

@ -336,7 +336,11 @@
} else {
score = " score:" + $post.data("score");
}
$img.attr("title", $post.attr("data-tags") + " user:" + $post.attr("data-uploader").replace(/_/g, " ") + " rating:" + $post.data("rating") + score);
var uploader = " ";
if ($post.attr("data-uploader")) {
uploader += "user:" + $post.attr("data-uploader").replace(/_/g, " ");
}
$img.attr("title", $post.attr("data-tags") + uploader + " rating:" + $post.data("rating") + score);
}
Danbooru.Post.expand_image = function(e) {

View File

@ -85,7 +85,6 @@ class PostPresenter < Presenter
data-has-sound="#{post.has_tag?('video_with_sound|flash_with_sound')}"
data-tags="#{h(post.tag_string)}"
data-pools="#{post.pool_string}"
data-uploader="#{h(post.uploader_name)}"
data-approver-id="#{post.approver_id}"
data-rating="#{post.rating}"
data-width="#{post.image_width}"
@ -103,6 +102,12 @@ class PostPresenter < Presenter
data-is-favorited="#{post.favorited_by?(CurrentUser.user.id)}"
}
if CurrentUser.is_moderator?
attributes += %{
data-uploader="#{h(post.uploader_name)}"
}
end
if post.visible?
attributes += %{
data-md5="#{post.md5}"

View File

@ -4,10 +4,12 @@
<strong>Date</strong>
<%= compact_time(post.created_at) %>
</span>
<span class="info">
<strong>User</strong>
<%= link_to_user(post.uploader) %>
</span>
<% if CurrentUser.is_moderator? %>
<span class="info">
<strong>User</strong>
<%= link_to_user(post.uploader) %>
</span>
<% end %>
<span class="info">
<strong>Rating</strong>
<%= post.rating %>

View File

@ -1,6 +1,6 @@
<ul itemscope itemtype="http://schema.org/ImageObject">
<li>ID: <%= post.id %></li>
<li>Tagger: <%= link_to_user(post.keeper) %></li>
<li>Top Tagger: <%= link_to_user(post.keeper) %></li>
<% if CurrentUser.is_moderator? %>
<li>Uploader: <%= link_to_user(post.uploader) %></li>
<% end %>