Merge branch 'master' of https://github.com/r888888888/danbooru
This commit is contained in:
@@ -119,17 +119,9 @@ class Post < ActiveRecord::Base
|
|||||||
|
|
||||||
def file_url_for(user)
|
def file_url_for(user)
|
||||||
if CurrentUser.mobile_mode?
|
if CurrentUser.mobile_mode?
|
||||||
return large_file_url
|
large_file_url
|
||||||
end
|
elsif user.default_image_size == "large" && image_width > Danbooru.config.large_image_width
|
||||||
|
large_file_url
|
||||||
case user.default_image_size
|
|
||||||
when "large"
|
|
||||||
if image_width > Danbooru.config.large_image_width
|
|
||||||
large_file_url
|
|
||||||
else
|
|
||||||
file_url
|
|
||||||
end
|
|
||||||
|
|
||||||
else
|
else
|
||||||
file_url
|
file_url
|
||||||
end
|
end
|
||||||
@@ -137,17 +129,9 @@ class Post < ActiveRecord::Base
|
|||||||
|
|
||||||
def file_path_for(user)
|
def file_path_for(user)
|
||||||
if CurrentUser.mobile_mode?
|
if CurrentUser.mobile_mode?
|
||||||
return large_file_path
|
large_file_path
|
||||||
end
|
elsif user.default_image_size == "large" && image_width > Danbooru.config.large_image_width
|
||||||
|
large_file_path
|
||||||
case user.default_image_size
|
|
||||||
when "large"
|
|
||||||
if image_width > Danbooru.config.large_image_width
|
|
||||||
large_file_path
|
|
||||||
else
|
|
||||||
file_path
|
|
||||||
end
|
|
||||||
|
|
||||||
else
|
else
|
||||||
file_path
|
file_path
|
||||||
end
|
end
|
||||||
@@ -197,28 +181,16 @@ class Post < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def image_width_for(user)
|
def image_width_for(user)
|
||||||
if CurrentUser.mobile_mode?
|
if CurrentUser.mobile_mode? || user.default_image_size == "large"
|
||||||
return large_image_width
|
|
||||||
end
|
|
||||||
|
|
||||||
case user.default_image_size
|
|
||||||
when "large"
|
|
||||||
large_image_width
|
large_image_width
|
||||||
|
|
||||||
else
|
else
|
||||||
image_width
|
image_width
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def image_height_for(user)
|
def image_height_for(user)
|
||||||
if CurrentUser.mobile_mode?
|
if CurrentUser.mobile_mode? || user.default_image_size == "large"
|
||||||
return large_image_height
|
|
||||||
end
|
|
||||||
|
|
||||||
case user.default_image_size
|
|
||||||
when "large"
|
|
||||||
large_image_height
|
large_image_height
|
||||||
|
|
||||||
else
|
else
|
||||||
image_height
|
image_height
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -11,6 +11,6 @@
|
|||||||
|
|
||||||
<li><%= link_to "Random post", random_posts_path(:tags => params[:tags]) %></li>
|
<li><%= link_to "Random post", random_posts_path(:tags => params[:tags]) %></li>
|
||||||
|
|
||||||
<li><%= link_to "Mobile version", m_posts_path(:tags => params[:tags]) %></li>
|
<li><%= link_to "Mobile version", mobile_posts_path(:tags => params[:tags]) %></li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
Reference in New Issue
Block a user