fixes #1062
This commit is contained in:
@@ -459,6 +459,10 @@ class Post < ActiveRecord::Base
|
|||||||
typed_tags("artist")
|
typed_tags("artist")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def general_tags
|
||||||
|
typed_tags("general")
|
||||||
|
end
|
||||||
|
|
||||||
def typed_tags(name)
|
def typed_tags(name)
|
||||||
@typed_tags ||= {}
|
@typed_tags ||= {}
|
||||||
@typed_tags[name] ||= begin
|
@typed_tags[name] ||= begin
|
||||||
|
|||||||
@@ -67,6 +67,28 @@ class PostPresenter < Presenter
|
|||||||
string.join(" ").tr("_", " ")
|
string.join(" ").tr("_", " ")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def categorized_tag_string
|
||||||
|
string = []
|
||||||
|
|
||||||
|
if @post.copyright_tags.any?
|
||||||
|
string << @post.copyright_tags.join(" ")
|
||||||
|
end
|
||||||
|
|
||||||
|
if @post.character_tags.any?
|
||||||
|
string << @post.character_tags.join(" ")
|
||||||
|
end
|
||||||
|
|
||||||
|
if @post.artist_tags.any?
|
||||||
|
string << @post.artist_tags.join(" ")
|
||||||
|
end
|
||||||
|
|
||||||
|
if @post.general_tags.any?
|
||||||
|
string << @post.general_tags.join(" ")
|
||||||
|
end
|
||||||
|
|
||||||
|
string.join("\n")
|
||||||
|
end
|
||||||
|
|
||||||
def image_html(template)
|
def image_html(template)
|
||||||
return template.content_tag("p", "The artist requested removal of this image") if @post.is_banned? && !CurrentUser.user.is_privileged?
|
return template.content_tag("p", "The artist requested removal of this image") if @post.is_banned? && !CurrentUser.user.is_privileged?
|
||||||
return template.content_tag("p", template.link_to("You need a privileged account to see this image.", template.upgrade_information_users_path)) if !Danbooru.config.can_user_see_post?(CurrentUser.user, @post)
|
return template.content_tag("p", template.link_to("You need a privileged account to see this image.", template.upgrade_information_users_path)) if !Danbooru.config.can_user_see_post?(CurrentUser.user, @post)
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
<div class="input">
|
<div class="input">
|
||||||
<div>
|
<div>
|
||||||
<%= f.label :tag_string, "Tags" %>
|
<%= f.label :tag_string, "Tags" %>
|
||||||
<%= f.text_area :tag_string , :size => "50x3", :value => post.tag_string + " " %>
|
<%= f.text_area :tag_string , :size => "50x3", :value => post.presenter.categorized_tag_string + " " %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= button_tag "Related tags", :id => "related-tags-button", :type => "button" %>
|
<%= button_tag "Related tags", :id => "related-tags-button", :type => "button" %>
|
||||||
|
|||||||
Reference in New Issue
Block a user