From 6674873478c9fe221d2fd78f76cabc6d4b03c0aa Mon Sep 17 00:00:00 2001 From: Matt Amos Date: Tue, 18 Aug 2009 16:06:26 +0000 Subject: [PATCH] Experimental CSS media queries to support iPhone and other small-screen devices. --- app/views/layouts/site.html.erb | 7 +++- app/views/user/login.html.erb | 2 +- public/stylesheets/site-sml.css | 65 +++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 public/stylesheets/site-sml.css diff --git a/app/views/layouts/site.html.erb b/app/views/layouts/site.html.erb index 59b7c304b..ed8c1456b 100644 --- a/app/views/layouts/site.html.erb +++ b/app/views/layouts/site.html.erb @@ -1,11 +1,14 @@ + <%= javascript_include_tag 'prototype' %> <%= javascript_include_tag 'site' %> - <%= stylesheet_link_tag 'site' %> - <%= stylesheet_link_tag 'print', :media => "print" %> + + <%= stylesheet_link_tag 'site-sml', :media => "only screen and (max-width: 481px)" %> + <%= stylesheet_link_tag 'site', :media => "screen and (min-width: 482px)" %> + <%= stylesheet_link_tag 'print', :media => "print" %> <%= tag("link", { :rel => "search", :type => "application/opensearchdescription+xml", :title => "OpenStreetMap Search", :href => "/opensearch/osm.xml" }) %> <%= tag("meta", { :name => "description", :content => "OpenStreetMap is the free wiki world map." }) %> <%= yield :head %> diff --git a/app/views/user/login.html.erb b/app/views/user/login.html.erb index dc1001117..9b6d62f92 100644 --- a/app/views/user/login.html.erb +++ b/app/views/user/login.html.erb @@ -5,7 +5,7 @@ <% form_tag :action => 'login' do %> <%= hidden_field_tag('referer', h(params[:referer])) %> - + diff --git a/public/stylesheets/site-sml.css b/public/stylesheets/site-sml.css new file mode 100644 index 000000000..e3f371594 --- /dev/null +++ b/public/stylesheets/site-sml.css @@ -0,0 +1,65 @@ +body { + font-family: Arial,sans-serif; + color: #000; + background-color: #fff; + font-size: 12px; +} + +#left { + display: none; +} + +#greeting { + position: absolute; + top: 0px; + right: 0px; + height: 16px; + margin: 0px; + padding-right: 10px; + font-size: 13px; + line-height: 14px; +} + +#content { + padding-top: 16px; + height: 640px; +} + +#tabnav { +/* display: none;*/ +} + +#sidebar { + display: none; +} + +#permalink { + display: none; +} + +input[type="text"], input[type="password"], textarea { + border: 1px solid black; + font-size: 12px; +} + +.olControlPanZoomBar { + display: none; +} + +.olControlLayerSwitcher { + display: none; +} + +.olControlAttribution { + display: none !important; +} + +#attribution { + font-size: 10px; + text-align: center; +} + +#map { + border: 1px solid black; + height: 480px; +} -- 2.39.5
<%= t 'user.login.email or username' %><%= text_field('user', 'email',{:size => 50, :maxlength => 255, :tabindex => 1}) %>
<%= t 'user.login.email or username' %><%= text_field('user', 'email',{:size => 28, :maxlength => 255, :tabindex => 1}) %>
<%= t 'user.login.password' %><%= password_field('user', 'password',{:size => 28, :maxlength => 255, :tabindex => 2}) %> (<%= link_to t('user.login.lost password link'), :controller => 'user', :action => 'lost_password' %>)
 
<%= submit_tag t('user.login.login_button'), :tabindex => 3 %>