diff --git a/app/assets/stylesheets/specific/comments.css.scss b/app/assets/stylesheets/specific/comments.css.scss index f2cddfa14..0416652b9 100644 --- a/app/assets/stylesheets/specific/comments.css.scss +++ b/app/assets/stylesheets/specific/comments.css.scss @@ -62,7 +62,7 @@ div.comments-for-post { } div#c-comments { - div#a-index { + div#a-index, div#a-show { div.header { span.info { margin-right: 1.5em; diff --git a/app/assets/stylesheets/specific/posts.css.scss b/app/assets/stylesheets/specific/posts.css.scss index 9c78725fc..8327bb04b 100644 --- a/app/assets/stylesheets/specific/posts.css.scss +++ b/app/assets/stylesheets/specific/posts.css.scss @@ -302,11 +302,19 @@ div#c-post-versions, div#c-artist-versions { margin-right: 0.5em; } + ins.obsolete, ins.obsolete a { + color: darkGreen; + } + del, del a { color: red; text-decoration: line-through; margin-right: 0.5em; } + + del.obsolete, del.obsolete a { + color: darkRed; + } } } diff --git a/app/helpers/post_versions_helper.rb b/app/helpers/post_versions_helper.rb index a9ce482d1..cf2e0d9c8 100644 --- a/app/helpers/post_versions_helper.rb +++ b/app/helpers/post_versions_helper.rb @@ -5,9 +5,15 @@ module PostVersionsHelper diff[:added_tags].each do |tag| html << '+' + link_to(tag, posts_path(:tags => tag)) + '' end + diff[:obsolete_added_tags].each do |tag| + html << '+' + link_to(tag, posts_path(:tags => tag)) + '' + end diff[:removed_tags].each do |tag| html << '-' + link_to(tag, posts_path(:tags => tag)) + '' end + diff[:obsolete_removed_tags].each do |tag| + html << '-' + link_to(tag, posts_path(:tags => tag)) + '' + end diff[:unchanged_tags].each do |tag| html << '' + link_to(tag, posts_path(:tags => tag)) + '' end diff --git a/app/models/post_version.rb b/app/models/post_version.rb index 1e7dff2e8..ee316ca29 100644 --- a/app/models/post_version.rb +++ b/app/models/post_version.rb @@ -84,12 +84,15 @@ class PostVersion < ActiveRecord::Base old_tags << "source:#{version.source}" if version.source.present? end + added_tags = new_tags - old_tags + removed_tags = old_tags - new_tags + return { - :added_tags => new_tags - old_tags, - :removed_tags => old_tags - new_tags, + :added_tags => added_tags & latest_tags, + :removed_tags => removed_tags - latest_tags, + :obsolete_added_tags => added_tags - latest_tags, + :obsolete_removed_tags => removed_tags & latest_tags, :unchanged_tags => new_tags & old_tags, - :obsolete_added_tags => new_tags - latest_tags, - :obsolete_removed_tags => old_tags & latest_tags, } end diff --git a/app/models/tag.rb b/app/models/tag.rb index 1a3e3488d..db176a746 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -1,5 +1,5 @@ class Tag < ActiveRecord::Base - METATAGS = "-user|user|-approver|approver|commenter|comm|noter|-pool|pool|-fav|fav|sub|md5|-rating|rating|-locked|locked|width|height|mpixels|score|filesize|source|id|date|order|-status|status|tagcount|gentags|arttags|chartags|copytags|parent|pixiv_id" + METATAGS = "-user|user|-approver|approver|commenter|comm|noter|-pool|pool|-fav|fav|sub|md5|-rating|rating|-locked|locked|width|height|mpixels|score|filesize|source|id|date|order|-status|status|tagcount|gentags|arttags|chartags|copytags|parent|pixiv_id|pixiv" attr_accessible :category has_one :wiki_page, :foreign_key => "name", :primary_key => "title" @@ -268,27 +268,29 @@ class Tag < ActiveRecord::Base case $1 when "-user" q[:uploader_id_neg] ||= [] - q[:uploader_id_neg] << User.name_to_id($2) + user_id = User.name_to_id($2) + q[:uploader_id_neg] << user_id unless user_id.blank? when "user" q[:uploader_id] = User.name_to_id($2) - q[:uploader_id] = -1 if q[:uploader_id].nil? + q[:uploader_id] = -1 if q[:uploader_id].blank? when "-approver" q[:approver_id_neg] ||= [] - q[:approver_id_neg] << User.name_to_id($2) + user_id = User.name_to_id($2) + q[:approver_id_neg] << user_id unless user_id.blank? when "approver" q[:approver_id] = User.name_to_id($2) - q[:approver_id] = -1 if q[:approver_id].nil? + q[:approver_id] = -1 if q[:approver_id].blank? when "commenter", "comm" q[:commenter_id] = User.name_to_id($2) - q[:commenter_id] = -1 if q[:commenter_id].nil? + q[:commenter_id] = -1 if q[:commenter_id].blank? when "noter" q[:noter_id] = User.name_to_id($2) - q[:noter_id] = -1 if q[:noter_id].nil? + q[:noter_id] = -1 if q[:noter_id].blank? when "-pool" q[:tags][:exclude] << "pool:#{Pool.name_to_id($2)}" @@ -372,7 +374,7 @@ class Tag < ActiveRecord::Base when "status" q[:status] = $2.downcase - when "pixiv_id" + when "pixiv_id", "pixiv" q[:pixiv_id] = parse_helper($2) end diff --git a/app/views/bans/index.html.erb b/app/views/bans/index.html.erb index d42692787..2d88d3d44 100644 --- a/app/views/bans/index.html.erb +++ b/app/views/bans/index.html.erb @@ -14,7 +14,7 @@ <% @bans.each do |ban| %> - <%= ban.user.name %> + <%= link_to(ban.user.name, user_path(ban.user_id), { :class => ban.user.level_class }) %> <%= ban.expires_at %> <%= ban.reason %> diff --git a/app/views/bans/show.html.erb b/app/views/bans/show.html.erb index 1e898bc61..7291b088a 100644 --- a/app/views/bans/show.html.erb +++ b/app/views/bans/show.html.erb @@ -2,7 +2,7 @@

Show Ban

diff --git a/app/views/comments/show.html.erb b/app/views/comments/show.html.erb index 66937e472..f78ba1a33 100644 --- a/app/views/comments/show.html.erb +++ b/app/views/comments/show.html.erb @@ -2,10 +2,20 @@
- <%= render "comments/partials/show/comment", :post => @comment.post, :comment => @comment, :show_header => false %> +
+
+ <%= link_to(image_tag(@comment.post.preview_file_url), post_path(@comment.post)) %> +
+ <%= render :partial => "comments/partials/show/comment", :collection => [@comment] %> +
+
-<%= render "secondary_links" %> \ No newline at end of file +<%= render "secondary_links" %> + +<% content_for(:page_title) do %> + Comment - <%= Danbooru.config.app_name %> +<% end %> diff --git a/app/views/static/contact.html.erb b/app/views/static/contact.html.erb index 83b5c9a40..80819d9cc 100644 --- a/app/views/static/contact.html.erb +++ b/app/views/static/contact.html.erb @@ -3,3 +3,7 @@

Questions & Comments

You can reach the administrator of this site at <%= mail_to Danbooru.config.contact_email, nil, :encode => :hex %>.

+ +<% content_for(:page_title) do %> + Contact - <%= Danbooru.config.app_name %> +<% end %> diff --git a/app/views/static/keyboard_shortcuts.html.erb b/app/views/static/keyboard_shortcuts.html.erb index 25bd31521..ada8fa0fb 100644 --- a/app/views/static/keyboard_shortcuts.html.erb +++ b/app/views/static/keyboard_shortcuts.html.erb @@ -24,4 +24,8 @@ - \ No newline at end of file + + +<% content_for(:page_title) do %> + Keyboard Shortcuts - <%= Danbooru.config.app_name %> +<% end %> diff --git a/app/views/static/mrtg.html.erb b/app/views/static/mrtg.html.erb index 6e630f8b9..e4f11a515 100644 --- a/app/views/static/mrtg.html.erb +++ b/app/views/static/mrtg.html.erb @@ -32,4 +32,8 @@

1 day

- \ No newline at end of file + + +<% content_for(:page_title) do %> + MRTG - <%= Danbooru.config.app_name %> +<% end %> diff --git a/app/views/static/name_change.html.erb b/app/views/static/name_change.html.erb index f09c5aea8..b8907620c 100644 --- a/app/views/static/name_change.html.erb +++ b/app/views/static/name_change.html.erb @@ -7,3 +7,7 @@

For this reason user name changes are not supported.

+ +<% content_for(:page_title) do %> + Name Change - <%= Danbooru.config.app_name %> +<% end %> diff --git a/app/views/static/terms_of_service.html.erb b/app/views/static/terms_of_service.html.erb index b50d71b75..81cb2d859 100644 --- a/app/views/static/terms_of_service.html.erb +++ b/app/views/static/terms_of_service.html.erb @@ -52,3 +52,6 @@ +<% content_for(:page_title) do %> + Rules - <%= Danbooru.config.app_name %> +<% end %>