css fixes
This commit is contained in:
@@ -10,10 +10,12 @@ article.post-preview {
|
|||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
float: left;
|
float: left;
|
||||||
text-align: center;
|
|
||||||
vertical-align: middle;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@include inline-block;
|
@include inline-block;
|
||||||
|
|
||||||
|
img.wide {
|
||||||
|
margin: 0 -25%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
article.post-preview.blacklisted-active {
|
article.post-preview.blacklisted-active {
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
module Mobile
|
|
||||||
class PostsController < ApplicationController
|
|
||||||
before_filter :member_only, :except => [:show, :index]
|
|
||||||
respond_to :html
|
|
||||||
rescue_from PostSets::SearchError, :with => :search_error
|
|
||||||
layout "mobile"
|
|
||||||
|
|
||||||
def index
|
|
||||||
@post_set = PostSets::Post.new(tag_query, params[:page])
|
|
||||||
@posts = @post_set.posts
|
|
||||||
end
|
|
||||||
|
|
||||||
def show
|
|
||||||
@post = Post.find(params[:id])
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
def search_error(exception)
|
|
||||||
@exception = exception
|
|
||||||
render :action => "error"
|
|
||||||
end
|
|
||||||
|
|
||||||
def tag_query
|
|
||||||
params[:tags] || (params[:post] && params[:post][:tags])
|
|
||||||
end
|
|
||||||
|
|
||||||
def save_recent_tags
|
|
||||||
if tag_query
|
|
||||||
tags = Tag.scan_tags(tag_query)
|
|
||||||
tags = TagAlias.to_aliased(tags) + Tag.scan_tags(session[:recent_tags])
|
|
||||||
session[:recent_tags] = tags.uniq.slice(0, 40).join(" ")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -15,7 +15,7 @@ module PaginationHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def use_sequential_paginator?(records)
|
def use_sequential_paginator?(records)
|
||||||
params[:page] =~ /[ab]/ || records.current_page > Danbooru.config.max_numbered_pages
|
params[:page] =~ /[ab]/ || records.current_page >= Danbooru.config.max_numbered_pages
|
||||||
end
|
end
|
||||||
|
|
||||||
def numbered_paginator(records, switch_to_sequential = true)
|
def numbered_paginator(records, switch_to_sequential = true)
|
||||||
|
|||||||
@@ -13,7 +13,13 @@ 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 src="#{post.preview_file_url}" alt="#{h(post.tag_string)}">}
|
|
||||||
|
if post.image_width > post.image_height
|
||||||
|
klass = "wide"
|
||||||
|
else
|
||||||
|
klass = "tall"
|
||||||
|
end
|
||||||
|
html << %{<img class="#{klass}" src="#{post.preview_file_url}" alt="#{h(post.tag_string)}">}
|
||||||
html << %{</a>}
|
html << %{</a>}
|
||||||
html << %{</article>}
|
html << %{</article>}
|
||||||
html.html_safe
|
html.html_safe
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
<meta name="default-image-size" content="<%= CurrentUser.user.default_image_size %>">
|
<meta name="default-image-size" content="<%= CurrentUser.user.default_image_size %>">
|
||||||
<%= auto_discovery_link_tag :atom, posts_path(:format => "atom", :tags => params[:tags]) %>
|
<%= auto_discovery_link_tag :atom, posts_path(:format => "atom", :tags => params[:tags]) %>
|
||||||
<%= stylesheet_link_tag "application", :media => "screen" %>
|
<%= stylesheet_link_tag "application", :media => "screen" %>
|
||||||
<%#= stylesheet_link_tag "mobile", :media => "only screen and (max-width: 480px), only screen and (max-device-width: 480px)" %>
|
|
||||||
<%= javascript_include_tag "application" %>
|
<%= javascript_include_tag "application" %>
|
||||||
<%= Danbooru.config.custom_html_header_content %>
|
<%= Danbooru.config.custom_html_header_content %>
|
||||||
<%= yield :html_header %>
|
<%= yield :html_header %>
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
<div id="c-posts">
|
|
||||||
<div id="a-index">
|
|
||||||
<%= render "posts/partials/index/posts", :post_set => @post_set %>
|
|
||||||
<%= render "posts/partials/common/secondary_links" %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% content_for(:page_title) do %>
|
|
||||||
<% if @post_set.tag_string.present? %>
|
|
||||||
<%= @post_set.tag_string %> - <%= Danbooru.config.app_name %>
|
|
||||||
<% else %>
|
|
||||||
<%= Danbooru.config.app_name %>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
@@ -176,12 +176,6 @@ Danbooru::Application.routes.draw do
|
|||||||
end
|
end
|
||||||
resources :wiki_page_versions, :only => [:index, :show]
|
resources :wiki_page_versions, :only => [:index, :show]
|
||||||
|
|
||||||
namespace :mobile do
|
|
||||||
resources :posts
|
|
||||||
resource :session
|
|
||||||
resources :favorites
|
|
||||||
end
|
|
||||||
|
|
||||||
# aliases
|
# aliases
|
||||||
resources :wpages, :controller => "wiki_pages"
|
resources :wpages, :controller => "wiki_pages"
|
||||||
resources :ftopics, :controller => "forum_topics"
|
resources :ftopics, :controller => "forum_topics"
|
||||||
|
|||||||
Reference in New Issue
Block a user