From 9da69a4b010bd13dd4cd9adb0d88f275d3a01ed0 Mon Sep 17 00:00:00 2001 From: Sarah Mei <sarahmei@gmail.com> Date: Sat, 4 Dec 2010 20:45:37 -0800 Subject: [PATCH] Mobile log in form is usable. Also, added mixins for sass. --- app/views/devise/sessions/new.mobile.haml | 29 +++++++++++++++++++ app/views/layouts/application.mobile.haml | 2 +- config/locales/devise/devise.en.yml | 1 + public/javascripts/custom-mobile-scripting.js | 13 ++++----- public/stylesheets/sass/_mixins.sass | 6 ++++ public/stylesheets/sass/mobile.sass | 12 ++++++-- 6 files changed, 53 insertions(+), 10 deletions(-) create mode 100644 app/views/devise/sessions/new.mobile.haml create mode 100644 public/stylesheets/sass/_mixins.sass diff --git a/app/views/devise/sessions/new.mobile.haml b/app/views/devise/sessions/new.mobile.haml new file mode 100644 index 0000000000..41fb9038a9 --- /dev/null +++ b/app/views/devise/sessions/new.mobile.haml @@ -0,0 +1,29 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + +.floating.login_form + %h3 + = t('.login') + = form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| + #user + %p.username + = f.label :username , t('username') + = f.text_field :username + %p.user_network + ="@#{APP_CONFIG[:terse_pod_url]}" + + %p + = f.label :password , t('password') + = f.password_field :password + = f.submit t('.sign_in') + + %p + = render :partial => "devise/shared/links" + +.alpha-warning + %h1 + = t('.alpha_software') + + %h3 + = t('.bugs_and_feedback_mobile') \ No newline at end of file diff --git a/app/views/layouts/application.mobile.haml b/app/views/layouts/application.mobile.haml index e46a04cfc8..bf82adc4d2 100644 --- a/app/views/layouts/application.mobile.haml +++ b/app/views/layouts/application.mobile.haml @@ -11,7 +11,7 @@ %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/ = include_javascripts :mobile - = stylesheet_link_tag 'mobile', 'vendor/jquery_mobile.min' + = stylesheet_link_tag 'vendor/jquery_mobile.min', 'mobile' = csrf_meta_tag :javascript diff --git a/config/locales/devise/devise.en.yml b/config/locales/devise/devise.en.yml index 87ab117ff8..5f6c19109c 100644 --- a/config/locales/devise/devise.en.yml +++ b/config/locales/devise/devise.en.yml @@ -24,6 +24,7 @@ en: remember_me: "Remember me" alpha_software: 'You are about to use alpha software.' bugs_and_feedback: 'Be advised, you will experience bugs. We encourage you to use the Feedback button on the right hand side of your browser to report any hiccups! We will work as fast as we can to resolve any issues you report.' + bugs_and_feedback_mobile: 'Be advised, you will experience bugs. We encourage you to report any hiccups! We will work as fast as we can to resolve any issues you report.' modern_browsers: 'only supports modern browsers.' signed_in: 'Signed in successfully.' signed_out: 'Signed out successfully.' diff --git a/public/javascripts/custom-mobile-scripting.js b/public/javascripts/custom-mobile-scripting.js index 25e614dcd9..60d555ef92 100644 --- a/public/javascripts/custom-mobile-scripting.js +++ b/public/javascripts/custom-mobile-scripting.js @@ -3,10 +3,9 @@ * the COPYRIGHT file. */ -// $(document).bind("mobileinit", function(){ -// $.extend( $.mobile , { -// -// ajaxLinksEnabled : false -// ajaxFormsEnabled : false -// }); -// }); +$(document).bind("mobileinit", function(){ + $.extend( $.mobile , { + ajaxLinksEnabled : false, + ajaxFormsEnabled : false + }); +}); diff --git a/public/stylesheets/sass/_mixins.sass b/public/stylesheets/sass/_mixins.sass new file mode 100644 index 0000000000..59a969f1c3 --- /dev/null +++ b/public/stylesheets/sass/_mixins.sass @@ -0,0 +1,6 @@ +@mixin mobile-box + :margin 10px + :padding 0 15px + :border 1px #999 solid + :'-moz-border-radius' 15px + :border-radius 15px diff --git a/public/stylesheets/sass/mobile.sass b/public/stylesheets/sass/mobile.sass index 215f4330c9..dc622b362b 100644 --- a/public/stylesheets/sass/mobile.sass +++ b/public/stylesheets/sass/mobile.sass @@ -1,3 +1,5 @@ +@import "mixins" + #landing_content :text-align center @@ -29,18 +31,24 @@ :-moz-box-shadow 0 1px 3px #ccc :box-shadow 0 1px 3px #ccc +.alpha-warning + @include mobile-box + +.login_form + @include mobile-box + label + :font-weight bold + img :border-radius 5px ul :list-style none - .avatar :width 50px :height 50px :padding 0 - li.message :width 90% :position relative -- GitLab