more work on mobile view
This commit is contained in:
@@ -1,34 +1,43 @@
|
|||||||
@import "../common/000_vars.css.scss";
|
@import "../common/000_vars.css.scss";
|
||||||
|
|
||||||
|
$default_font_size: 30pt;
|
||||||
|
|
||||||
div#main {
|
div#main {
|
||||||
max-width: 960px;
|
max-width: 960px;
|
||||||
}
|
}
|
||||||
|
|
||||||
header {
|
header {
|
||||||
margin: 10px;
|
background: #eee;
|
||||||
padding: 0;
|
height: 50px;
|
||||||
overflow: visible;
|
padding: 0 10px;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
div {
|
||||||
|
height: 50px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
div#search-item {
|
div#search-item {
|
||||||
float: right;
|
float: right;
|
||||||
|
|
||||||
input {
|
input {
|
||||||
font-size: 2em;
|
margin-top: 10%;
|
||||||
|
font-size: $default_font_size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
div#sign-in-item {
|
div#sign-in-item {
|
||||||
float: left;
|
float: left;
|
||||||
font-size: 3em;
|
font-size: $default_font_size;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-top: 0.3em;
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
footer {
|
footer {
|
||||||
div.paginator {
|
div.paginator {
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
font-size: 3em;
|
font-size: $default_font_size;
|
||||||
|
|
||||||
li {
|
li {
|
||||||
a {
|
a {
|
||||||
@@ -102,13 +111,13 @@ div#tag-list {
|
|||||||
|
|
||||||
a {
|
a {
|
||||||
background: #eee;
|
background: #eee;
|
||||||
font-size: 3em;
|
font-size: $default_font_size;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
padding: 0.2em 0.5em;
|
padding: 0.2em 0.5em;
|
||||||
border: 1px solid #666;
|
border: 1px solid #666;
|
||||||
-moz-border-radius: 3px;
|
-moz-border-radius: 0.5em;
|
||||||
-webkit-border-radius: 3px;
|
-webkit-border-radius: 0.5em;
|
||||||
border-radius: 3px;
|
border-radius: 0.5em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
10
app/assets/stylesheets/mobile/sesssions.css.scss
Normal file
10
app/assets/stylesheets/mobile/sesssions.css.scss
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
@import "../common/000_vars.css.scss";
|
||||||
|
@import "../common/simple_form.css.scss";
|
||||||
|
|
||||||
|
div#main {
|
||||||
|
max-width: 960px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#c-m-sessions {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
26
app/controllers/m/sessions_controller.rb
Normal file
26
app/controllers/m/sessions_controller.rb
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
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
|
||||||
@@ -1,13 +1,16 @@
|
|||||||
<header>
|
<header>
|
||||||
<div id="sign-in-item">
|
<div id="sign-in-item">
|
||||||
<%= Danbooru.config.app_name %>
|
<%= link_to Danbooru.config.app_name, posts_path %>
|
||||||
<% if true || CurrentUser.is_anonymous? %>
|
|
||||||
- <%= link_to "Sign in", new_m_session_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 %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div id="search-item">
|
<div id="search-item">
|
||||||
<%= form_tag(m_posts_path, :method => :get) do %>
|
<%= form_tag(m_posts_path, :method => :get) do %>
|
||||||
<%= search_field_tag :tags, params[:tags] %>
|
<%= search_field_tag :tags, params[:tags], :placeholder => "Search" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
33
app/views/m/sessions/new.html.erb
Normal file
33
app/views/m/sessions/new.html.erb
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<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 %>
|
||||||
Reference in New Issue
Block a user