removed /m/ codepath, added mobile override stylesheet

This commit is contained in:
albert
2011-11-14 17:55:53 -05:00
parent eb58773089
commit 99a48dc242
16 changed files with 56 additions and 303 deletions

View File

@@ -1,7 +1,7 @@
/*
*= require "smoothness/jquery-ui-1.8.5.custom.css"
*= require_self
*= require "./common/010_reset"
*= require "./common/020_base"
*= require "./common/030_links"
*= require_tree "./common"
*= require_tree "./specific"
*= require_tree "./mobile"
*/

View 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;
}
}
}

View File

@@ -1,38 +1,15 @@
@import "../common/000_vars.css.scss";
div.paginator {
display: block;
padding: 2em 0 1em 0;
font-size: 2em;
text-align: center;
font-size: $h2_size;
font-weight: bold;
clear: both;
li {
margin: 1em 0;
}
a {
margin: 0 0.25em;
padding: 0 0.5em;
a, span {
padding: 0.5em 1em;
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;
}
}

View File

@@ -1,135 +1,33 @@
@import "../common/000_vars.css.scss";
$default_font_size: 30pt;
div#main {
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#c-posts {
section#mode-box {
display: none;
}
div#sign-in-item {
float: left;
font-size: $default_font_size;
font-weight: bold;
margin-top: 15px;
}
}
footer {
div.paginator {
overflow: visible;
font-size: $default_font_size;
li {
a {
border: none;
section#tag-box {
ul {
font-size: $h2_size;
font-weight: bold;
li {
margin: 0.5em 0;
}
}
li:first-child {
float: left;
a.search-tag {
}
li:last-child {
float: right;
a.search-inc-tag {
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;
}
}
}

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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

View File

@@ -51,7 +51,7 @@ private
humanized_tag = tag.tr("_", " ")
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]
html << %{<span class="post-count">} + counts[tag].to_s + %{</span>}

View File

@@ -17,6 +17,7 @@
<meta name="default-image-size" content="<%= CurrentUser.user.default_image_size %>">
<%= auto_discovery_link_tag :atom, posts_path(:format => "atom", :tags => params[:tags]) %>
<%= stylesheet_link_tag "application", :media => "screen" %>
<%= stylesheet_link_tag "mobile", :media => "handheld" %>
<%= javascript_include_tag "application" %>
<%= Danbooru.config.custom_html_header_content %>
<%= yield :html_header %>

View File

@@ -1,16 +0,0 @@
<header>
<div id="sign-in-item">
<%= link_to Danbooru.config.app_name, posts_path %>
<% if CurrentUser.is_anonymous? %>
&ndash; <%= link_to "Sign in", new_m_session_path(:url => request.fullpath) %>
<% else %>
&ndash; <%= 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>

View File

@@ -1,3 +0,0 @@
<div id="tag-list">
<%= post.presenter.tag_list_html(self, :name_only => true, :path_prefix => "/m/posts") %>
</div>

View File

@@ -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 %>

View File

@@ -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 %>

View File

@@ -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 %>

View File

@@ -1,17 +1,17 @@
<% content_for(:secondary_links) do %>
<menu>
<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 "Hot", posts_path(:tags => "order:rank") %></li>
<% unless CurrentUser.is_anonymous? %>
<li><%= link_to "Favorites", favorites_path %></li>
<li><%= link_to "Subscriptions", posts_tag_subscription_path(CurrentUser.id) %></li>
<% end %>
<li><%= link_to "Changes", post_versions_path %></li>
<li class="nonessential"><%= link_to "Changes", post_versions_path %></li>
<% 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 %>
<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>
<% end %>

View File

@@ -163,11 +163,6 @@ Danbooru::Application.routes.draw do
end
resources :wiki_page_versions, :only => [:index, :show]
namespace :m do
resources :posts
resource :session
end
# aliases
resources :wpages, :controller => "wiki_pages"
resources :ftopics, :controller => "forum_topics"