diff --git a/app/assets/stylesheets/specific/posts.css.scss b/app/assets/stylesheets/specific/posts.css.scss
index b343cd421..876a55487 100644
--- a/app/assets/stylesheets/specific/posts.css.scss
+++ b/app/assets/stylesheets/specific/posts.css.scss
@@ -75,6 +75,10 @@ div#c-posts {
color: #666;
}
}
+
+ aside#sidebar > section > ul {
+ margin-bottom: 1em;
+ }
aside#sidebar > section > ul li {
list-style-type: none;
diff --git a/app/presenters/post_presenter.rb b/app/presenters/post_presenter.rb
index fbe67bd63..04cb4dc0c 100644
--- a/app/presenters/post_presenter.rb
+++ b/app/presenters/post_presenter.rb
@@ -43,6 +43,11 @@ class PostPresenter < Presenter
@tag_set_presenter.tag_list_html(template, options.merge(:show_extra_links => CurrentUser.user.is_privileged?))
end
+ def split_tag_list_html(template, options = {})
+ @tag_set_presenter ||= TagSetPresenter.new(@post.tag_array)
+ @tag_set_presenter.split_tag_list_html(template, options.merge(:show_extra_links => CurrentUser.user.is_privileged?))
+ end
+
def post_footer_for_pool_html(template)
if template.params[:pool_id]
pool = Pool.where(:id => template.params[:pool_id]).first
@@ -91,7 +96,7 @@ class PostPresenter < Presenter
end
html << " "
- html << template.link_to(pool.name, template.pool_path(pool))
+ html << template.link_to(pool.pretty_name, template.pool_path(pool))
html << ""
html
end
diff --git a/app/presenters/tag_set_presenter.rb b/app/presenters/tag_set_presenter.rb
index 50fa767b3..951110126 100644
--- a/app/presenters/tag_set_presenter.rb
+++ b/app/presenters/tag_set_presenter.rb
@@ -11,15 +11,76 @@ class TagSetPresenter < Presenter
def tag_list_html(template, options = {})
html = ""
- html << "
"
- Array(@tags).each do |tag|
- html << build_list_item(tag, template, options)
+ if @tags.present?
+ html << ""
+ @tags.each do |tag|
+ html << build_list_item(tag, template, options)
+ end
+ html << "
"
end
- html << "
"
+
+ html.html_safe
+ end
+
+ def split_tag_list_html(template, options = {})
+ html = ""
+
+ if copyright_tags.any?
+ html << 'Copyrights
'
+ html << ""
+ copyright_tags.keys.each do |tag|
+ html << build_list_item(tag, template, options)
+ end
+ html << "
"
+ end
+
+ if character_tags.any?
+ html << 'Characters
'
+ html << ""
+ character_tags.keys.each do |tag|
+ html << build_list_item(tag, template, options)
+ end
+ html << "
"
+ end
+
+ if artist_tags.any?
+ html << 'Artist
'
+ html << ""
+ artist_tags.keys.each do |tag|
+ html << build_list_item(tag, template, options)
+ end
+ html << "
"
+ end
+
+ if general_tags.any?
+ html << 'Tags
'
+ html << ""
+ general_tags.keys.each do |tag|
+ html << build_list_item(tag, template, options)
+ end
+ html << "
"
+ end
+
html.html_safe
end
private
+ def general_tags
+ @general_tags ||= categories.select {|k, v| v == Tag.categories.general}
+ end
+
+ def copyright_tags
+ @copyright_tags ||= categories.select {|k, v| v == Tag.categories.copyright}
+ end
+
+ def character_tags
+ @character_tags ||= categories.select {|k, v| v == Tag.categories.character}
+ end
+
+ def artist_tags
+ @artist_tags ||= categories.select {|k, v| v == Tag.categories.artist}
+ end
+
def categories
@categories ||= Tag.categories_for(@tags)
end
@@ -37,7 +98,7 @@ private
current_query = template.params[:tags] || ""
unless options[:name_only]
- if categories[tag] == 1
+ if categories[tag] == Tag.categories.artist
html << %{? }
else
html << %{? }
diff --git a/app/views/posts/partials/show/_edit.html.erb b/app/views/posts/partials/show/_edit.html.erb
index 2a39a832f..3f5e8d013 100644
--- a/app/views/posts/partials/show/_edit.html.erb
+++ b/app/views/posts/partials/show/_edit.html.erb
@@ -5,7 +5,7 @@
<% end %>
<%= form_for(post, :html => {:class => "simple_form"}) do |f| %>
- <%= f.hidden_field :old_tags, :value => post.tag_string %>
+ <%= f.hidden_field :old_tag_string, :value => post.tag_string %>
<% if post.is_rating_locked? %>
diff --git a/app/views/posts/show.html.erb b/app/views/posts/show.html.erb
index b34ff2270..61f02d5bf 100644
--- a/app/views/posts/show.html.erb
+++ b/app/views/posts/show.html.erb
@@ -11,8 +11,7 @@
<% end %>
- Tags
- <%= @post.presenter.tag_list_html(self) %>
+ <%= @post.presenter.split_tag_list_html(self) %>