reverted post thumbnail change, fix for mod queue
This commit is contained in:
@@ -8,18 +8,18 @@ div#c-moderator-post-queues {
|
|||||||
|
|
||||||
aside {
|
aside {
|
||||||
float: left;
|
float: left;
|
||||||
width: 520px;
|
width: 220px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
padding-right: 20px;
|
padding-right: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
section {
|
section {
|
||||||
float: left;
|
float: left;
|
||||||
width: 300px;
|
width: 600px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#moderation-guideline {
|
div#moderation-guideline {
|
||||||
width: 60em;
|
width: 900px;
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: $h2_size;
|
font-size: $h2_size;
|
||||||
|
|||||||
@@ -12,10 +12,6 @@ article.post-preview {
|
|||||||
float: left;
|
float: left;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@include inline-block;
|
@include inline-block;
|
||||||
|
|
||||||
img.wide {
|
|
||||||
margin-left: -25%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
article.post-preview.blacklisted-active {
|
article.post-preview.blacklisted-active {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ module Moderator
|
|||||||
before_filter :janitor_only
|
before_filter :janitor_only
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@search = ::Post.order("id asc").pending_or_flagged.available_for_moderation(params[:hidden]).search(:tag_match => params[:query])
|
@search = ::Post.order("id asc").pending_or_flagged.available_for_moderation(params[:hidden]).search(:tag_match => "#{params[:query]} status:any")
|
||||||
@posts = @search.paginate(params[:page])
|
@posts = @search.paginate(params[:page])
|
||||||
respond_with(@posts)
|
respond_with(@posts)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -13,32 +13,12 @@ class PostPresenter < Presenter
|
|||||||
|
|
||||||
html = %{<article class="post-preview" id="post_#{post.id}" data-id="#{post.id}" data-tags="#{h(post.tag_string)}" data-uploader="#{h(post.uploader_name)}" data-rating="#{post.rating}" data-width="#{post.image_width}" data-height="#{post.image_height}" data-flags="#{flags.join(' ')}" data-parent-id="#{post.parent_id}" data-has-children="#{post.has_children?}">}
|
html = %{<article class="post-preview" id="post_#{post.id}" data-id="#{post.id}" data-tags="#{h(post.tag_string)}" data-uploader="#{h(post.uploader_name)}" data-rating="#{post.rating}" data-width="#{post.image_width}" data-height="#{post.image_height}" data-flags="#{flags.join(' ')}" data-parent-id="#{post.parent_id}" data-has-children="#{post.has_children?}">}
|
||||||
html << %{<a href="#{path}/#{post.id}">}
|
html << %{<a href="#{path}/#{post.id}">}
|
||||||
html << %{<img style="margin-left: #{margin_left(post)}; margin-top: #{margin_top(post)};" src="#{post.preview_file_url}" alt="#{h(post.tag_string)}">}
|
html << %{<img src="#{post.preview_file_url}" alt="#{h(post.tag_string)}">}
|
||||||
html << %{</a>}
|
html << %{</a>}
|
||||||
html << %{</article>}
|
html << %{</article>}
|
||||||
html.html_safe
|
html.html_safe
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.margin_top(post)
|
|
||||||
if post.is_image? && post.image_height > post.image_width && post.image_height > Danbooru.config.small_image_width && post.image_height < 1.5 * post.image_width
|
|
||||||
ratio = Danbooru.config.small_image_width.to_f / post.image_width.to_f
|
|
||||||
offset = ((ratio * post.image_height) - Danbooru.config.small_image_width).to_i / 2
|
|
||||||
return "-#{offset}px"
|
|
||||||
else
|
|
||||||
0
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.margin_left(post)
|
|
||||||
if post.is_image? && post.image_width > post.image_height && post.image_width > Danbooru.config.small_image_width
|
|
||||||
ratio = Danbooru.config.small_image_width.to_f / post.image_height.to_f
|
|
||||||
offset = ((ratio * post.image_width) - Danbooru.config.small_image_width).to_i / 2
|
|
||||||
return "-#{offset}px"
|
|
||||||
else
|
|
||||||
return 0
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def initialize(post)
|
def initialize(post)
|
||||||
@post = post
|
@post = post
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<% @posts.each do |post| %>
|
<% @posts.each do |post| %>
|
||||||
<div class="post">
|
<div class="post">
|
||||||
<div class="preview">
|
<div class="preview">
|
||||||
<%= link_to(image_tag(post.preview_file_url, :style => "margin-left: #{PostPresenter.margin_left(post)}; margin-top: #{PostPresenter.margin_top(post)};"), post_path(post)) %>
|
<%= link_to(image_tag(post.preview_file_url, post_path(post)) %>
|
||||||
</div>
|
</div>
|
||||||
<%= render "comments/partials/index/list", :post => post, :comments => post.comments.visible(CurrentUser.user).recent, :show_header => true %>
|
<%= render "comments/partials/index/list", :post => post, :comments => post.comments.visible(CurrentUser.user).recent, :show_header => true %>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ module Danbooru
|
|||||||
image = Magick::Image.read(read_path).first
|
image = Magick::Image.read(read_path).first
|
||||||
geometry = "#{width}x>"
|
geometry = "#{width}x>"
|
||||||
|
|
||||||
if width == Danbooru.config.small_image_width && image.rows < image.columns
|
if width == Danbooru.config.small_image_width
|
||||||
# wider than it is tall
|
# wider than it is tall
|
||||||
geometry = ">x#{height}"
|
geometry = "#{Danbooru.config.small_image_width}x#{Danbooru.config.small_image_width}>"
|
||||||
end
|
end
|
||||||
|
|
||||||
image.change_geometry(geometry) do |new_width, new_height, img|
|
image.change_geometry(geometry) do |new_width, new_height, img|
|
||||||
|
|||||||
Reference in New Issue
Block a user