removed /m/ codepath, added mobile override stylesheet
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
|
*= require "smoothness/jquery-ui-1.8.5.custom.css"
|
||||||
*= require_self
|
*= require_self
|
||||||
*= require "./common/010_reset"
|
*= require_tree "./common"
|
||||||
*= require "./common/020_base"
|
*= require_tree "./specific"
|
||||||
*= require "./common/030_links"
|
|
||||||
*= require_tree "./mobile"
|
*= require_tree "./mobile"
|
||||||
*/
|
*/
|
||||||
|
|||||||
16
app/assets/stylesheets/mobile/page_header.css.scss
Normal file
16
app/assets/stylesheets/mobile/page_header.css.scss
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
@import "../common/000_vars.css.scss";
|
||||||
|
|
||||||
|
header#top {
|
||||||
|
h1 {
|
||||||
|
font-size: 2.5em;
|
||||||
|
margin: 5px 30px 0 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
menu {
|
||||||
|
font-size: $h2_size;
|
||||||
|
|
||||||
|
li.nonessential {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,38 +1,15 @@
|
|||||||
|
@import "../common/000_vars.css.scss";
|
||||||
|
|
||||||
div.paginator {
|
div.paginator {
|
||||||
display: block;
|
font-size: $h2_size;
|
||||||
padding: 2em 0 1em 0;
|
|
||||||
font-size: 2em;
|
|
||||||
text-align: center;
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
clear: both;
|
|
||||||
|
li {
|
||||||
|
margin: 1em 0;
|
||||||
|
}
|
||||||
|
|
||||||
a {
|
a, span {
|
||||||
margin: 0 0.25em;
|
padding: 0.5em 1em;
|
||||||
padding: 0 0.5em;
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
border: 1px solid #EAEAEA;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.arrow {
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.arrow:hover {
|
|
||||||
background: white;
|
|
||||||
color: #9093FF;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.current {
|
|
||||||
border: 1px solid #AAA;
|
|
||||||
}
|
|
||||||
|
|
||||||
a:hover {
|
|
||||||
background: rgb(60, 60, 220);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
span {
|
|
||||||
margin: 0 3px;
|
|
||||||
padding: 2px 6px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,135 +1,33 @@
|
|||||||
@import "../common/000_vars.css.scss";
|
@import "../common/000_vars.css.scss";
|
||||||
|
|
||||||
$default_font_size: 30pt;
|
div#c-posts {
|
||||||
|
section#mode-box {
|
||||||
div#main {
|
display: none;
|
||||||
max-width: 960px;
|
|
||||||
}
|
|
||||||
|
|
||||||
header {
|
|
||||||
background: #eee;
|
|
||||||
height: 50px;
|
|
||||||
padding: 0 10px;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
div {
|
|
||||||
height: 50px;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
div#search-item {
|
|
||||||
float: right;
|
|
||||||
|
|
||||||
input {
|
|
||||||
margin-top: 10%;
|
|
||||||
font-size: $default_font_size;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
div#sign-in-item {
|
section#tag-box {
|
||||||
float: left;
|
ul {
|
||||||
font-size: $default_font_size;
|
font-size: $h2_size;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-top: 15px;
|
|
||||||
}
|
li {
|
||||||
}
|
margin: 0.5em 0;
|
||||||
|
|
||||||
footer {
|
|
||||||
div.paginator {
|
|
||||||
overflow: visible;
|
|
||||||
font-size: $default_font_size;
|
|
||||||
|
|
||||||
li {
|
|
||||||
a {
|
|
||||||
border: none;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
li:first-child {
|
a.search-tag {
|
||||||
float: left;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
li:last-child {
|
a.search-inc-tag {
|
||||||
float: right;
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.search-exl-tag {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
span.post-count {
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
div#posts {
|
|
||||||
overflow: visible;
|
|
||||||
clear: both;
|
|
||||||
padding-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.post-previews {
|
|
||||||
overflow: visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
article.post-preview {
|
|
||||||
height: 188px;
|
|
||||||
width: 188px;
|
|
||||||
float: left;
|
|
||||||
text-align: center;
|
|
||||||
vertical-align: middle;
|
|
||||||
@include inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
article.post-preview.blacklisted-active {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
article.post-preview img {
|
|
||||||
border: 3px solid transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
article.post-preview.post-status-has-parent img {
|
|
||||||
border: 3px solid #CC0;
|
|
||||||
}
|
|
||||||
|
|
||||||
article.post-preview.post-status-has-children img {
|
|
||||||
border: 3px solid #0F0;
|
|
||||||
}
|
|
||||||
|
|
||||||
article.post-preview.post-status-pending img {
|
|
||||||
border: 3px solid #00F;
|
|
||||||
}
|
|
||||||
|
|
||||||
article.post-preview.post-status-flagged img {
|
|
||||||
border: 3px solid #F00;
|
|
||||||
}
|
|
||||||
|
|
||||||
img#image {
|
|
||||||
margin: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div#tag-list {
|
|
||||||
padding: 10px;
|
|
||||||
|
|
||||||
li {
|
|
||||||
margin: 2.5em 0.5em;
|
|
||||||
@include inline-block;
|
|
||||||
|
|
||||||
a {
|
|
||||||
background: #eee;
|
|
||||||
font-size: $default_font_size;
|
|
||||||
font-weight: bold;
|
|
||||||
padding: 0.2em 0.5em;
|
|
||||||
border: 1px solid #666;
|
|
||||||
@include border-radius(0.5em);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
div#c-posts {
|
|
||||||
li.category-1 a {
|
|
||||||
color: #A00;
|
|
||||||
}
|
|
||||||
|
|
||||||
li.category-3 a {
|
|
||||||
color: #A0A;
|
|
||||||
}
|
|
||||||
|
|
||||||
li.category-4 a {
|
|
||||||
color: #0A0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
@import "../common/000_vars.css.scss";
|
|
||||||
@import "../common/simple_form.css.scss";
|
|
||||||
|
|
||||||
div#main {
|
|
||||||
max-width: 960px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div#c-m-sessions {
|
|
||||||
margin: 10px;
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
module M
|
|
||||||
class PostsController < ApplicationController
|
|
||||||
layout "mobile"
|
|
||||||
|
|
||||||
def index
|
|
||||||
@post_set = PostSets::Post.new(params[:tags], params[:page])
|
|
||||||
@posts = @post_set.posts
|
|
||||||
end
|
|
||||||
|
|
||||||
def show
|
|
||||||
@post = Post.find(params[:id])
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
module M
|
|
||||||
class SessionsController < ApplicationController
|
|
||||||
layout "mobile"
|
|
||||||
|
|
||||||
def new
|
|
||||||
@user = User.new
|
|
||||||
end
|
|
||||||
|
|
||||||
def create
|
|
||||||
session_creator = SessionCreator.new(session, cookies, params[:name], params[:password], params[:remember])
|
|
||||||
|
|
||||||
if session_creator.authenticate
|
|
||||||
redirect_to(params[:url] || session[:previous_uri] || m_posts_path)
|
|
||||||
else
|
|
||||||
redirect_to(new_m_session_path, :notice => "Password was incorrect.")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def destroy
|
|
||||||
session.delete(:user_id)
|
|
||||||
cookies.delete(:cookie_password_hash)
|
|
||||||
cookies.delete(:user_name)
|
|
||||||
redirect_to(m_posts_path, :notice => "You are now logged out.")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -51,7 +51,7 @@ private
|
|||||||
|
|
||||||
humanized_tag = tag.tr("_", " ")
|
humanized_tag = tag.tr("_", " ")
|
||||||
path = options[:path_prefix] || "/posts"
|
path = options[:path_prefix] || "/posts"
|
||||||
html << %{<a href="#{path}?tags=#{u(tag)}">#{h(humanized_tag)}</a> }
|
html << %{<a class="search-tag" href="#{path}?tags=#{u(tag)}">#{h(humanized_tag)}</a> }
|
||||||
|
|
||||||
unless options[:name_only]
|
unless options[:name_only]
|
||||||
html << %{<span class="post-count">} + counts[tag].to_s + %{</span>}
|
html << %{<span class="post-count">} + counts[tag].to_s + %{</span>}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
<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 => "handheld" %>
|
||||||
<%= 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,16 +0,0 @@
|
|||||||
<header>
|
|
||||||
<div id="sign-in-item">
|
|
||||||
<%= link_to Danbooru.config.app_name, posts_path %>
|
|
||||||
|
|
||||||
<% if CurrentUser.is_anonymous? %>
|
|
||||||
– <%= link_to "Sign in", new_m_session_path(:url => request.fullpath) %>
|
|
||||||
<% else %>
|
|
||||||
– <%= link_to "Sign out", m_session_path, :remote => true, :method => :delete %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
<div id="search-item">
|
|
||||||
<%= form_tag(m_posts_path, :method => :get) do %>
|
|
||||||
<%= search_field_tag :tags, params[:tags], :placeholder => "Search" %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
<div id="tag-list">
|
|
||||||
<%= post.presenter.tag_list_html(self, :name_only => true, :path_prefix => "/m/posts") %>
|
|
||||||
</div>
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
<div id="c-m-posts">
|
|
||||||
<%= render "header" %>
|
|
||||||
|
|
||||||
<div id="posts">
|
|
||||||
<% @post_set.posts.each do |post| %>
|
|
||||||
<%= PostPresenter.preview(post, :path_prefix => "/m/posts") %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
<%= sequential_paginator(@post_set.posts) %>
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% content_for(:page_title) do %>
|
|
||||||
<% if params[:tags].present? %>
|
|
||||||
<%= params[:tags] %> - <%= Danbooru.config.app_name %>
|
|
||||||
<% else %>
|
|
||||||
<%= Danbooru.config.app_name %>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
<div id="c-m-posts">
|
|
||||||
<%= render "header" %>
|
|
||||||
|
|
||||||
<%= image_tag(@post.large_file_url, :width => @post.large_image_width, :height => @post.large_image_height, :id => "image") %>
|
|
||||||
|
|
||||||
<%= render "tags", :post => @post %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% content_for(:page_title) do %>
|
|
||||||
<%= @post.tag_string %> - <%= Danbooru.config.app_name %>
|
|
||||||
<% end %>
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
<div id="c-m-sessions">
|
|
||||||
<div id="a-new">
|
|
||||||
<section>
|
|
||||||
<h1>Sign in</h1>
|
|
||||||
<%= form_tag(session_path, :class => "simple_form") do %>
|
|
||||||
<%= hidden_field_tag "url", params[:url] %>
|
|
||||||
|
|
||||||
<div class="input">
|
|
||||||
<label for="name">Name</label>
|
|
||||||
<%= text_field_tag :name %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="input">
|
|
||||||
<label for="password">Password</label>
|
|
||||||
<%= password_field_tag :password %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="input">
|
|
||||||
<label for="remember" id="remember-label">Remember</label>
|
|
||||||
<%= check_box_tag :remember %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="input">
|
|
||||||
<%= submit_tag "Submit" %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% content_for(:page_title) do %>
|
|
||||||
Sign in - <%= Danbooru.config.app_name %>
|
|
||||||
<% end %>
|
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
<% content_for(:secondary_links) do %>
|
<% content_for(:secondary_links) do %>
|
||||||
<menu>
|
<menu>
|
||||||
<li><%= link_to "Listing", posts_path %></li>
|
<li><%= link_to "Listing", posts_path %></li>
|
||||||
<li><%= link_to "Upload", new_upload_path %></li>
|
<li class="nonessential"><%= link_to "Upload", new_upload_path %></li>
|
||||||
<li><%= link_to "Popular", popular_explore_posts_path %></li>
|
<li><%= link_to "Popular", popular_explore_posts_path %></li>
|
||||||
<li><%= link_to "Hot", posts_path(:tags => "order:rank") %></li>
|
<li><%= link_to "Hot", posts_path(:tags => "order:rank") %></li>
|
||||||
<% unless CurrentUser.is_anonymous? %>
|
<% unless CurrentUser.is_anonymous? %>
|
||||||
<li><%= link_to "Favorites", favorites_path %></li>
|
<li><%= link_to "Favorites", favorites_path %></li>
|
||||||
<li><%= link_to "Subscriptions", posts_tag_subscription_path(CurrentUser.id) %></li>
|
<li><%= link_to "Subscriptions", posts_tag_subscription_path(CurrentUser.id) %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<li><%= link_to "Changes", post_versions_path %></li>
|
<li class="nonessential"><%= link_to "Changes", post_versions_path %></li>
|
||||||
<% if CurrentUser.is_janitor? %>
|
<% if CurrentUser.is_janitor? %>
|
||||||
<li><%= link_to "Moderate", moderator_post_queue_path %></li>
|
<li class="nonessential"><%= link_to "Moderate", moderator_post_queue_path %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<li><%= link_to "Help", wiki_pages_path(:title => "help:posts") %></li>
|
<li class="nonessential"><%= link_to "Help", wiki_pages_path(:title => "help:posts") %></li>
|
||||||
</menu>
|
</menu>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -163,11 +163,6 @@ Danbooru::Application.routes.draw do
|
|||||||
end
|
end
|
||||||
resources :wiki_page_versions, :only => [:index, :show]
|
resources :wiki_page_versions, :only => [:index, :show]
|
||||||
|
|
||||||
namespace :m do
|
|
||||||
resources :posts
|
|
||||||
resource :session
|
|
||||||
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