From 2147d87dfed3a8ad9590ed3776625b773c8352fb Mon Sep 17 00:00:00 2001 From: Saurabh Bhatia Date: Thu, 10 Apr 2014 17:13:42 +0800 Subject: [PATCH] added stylesto signup --- app/assets/stylesheets/sign_up.css | 100 ++++++++++++++++++++++ app/controllers/users_controller.rb | 1 + app/models/user.rb | 1 + app/views/layouts/authentication.html.erb | 29 +++++++ app/views/users/create.html.erb | 2 - app/views/users/new.html.erb | 63 +++++++++++++- config/initializers/keyword_constraint.rb | 2 +- config/locales/en.yml | 35 +++++++- config/locales/zh_tw.yml | 38 +++++++- config/routes.rb | 6 +- 10 files changed, 267 insertions(+), 10 deletions(-) create mode 100644 app/assets/stylesheets/sign_up.css create mode 100644 app/views/layouts/authentication.html.erb delete mode 100644 app/views/users/create.html.erb diff --git a/app/assets/stylesheets/sign_up.css b/app/assets/stylesheets/sign_up.css new file mode 100644 index 0000000..d51deb2 --- /dev/null +++ b/app/assets/stylesheets/sign_up.css @@ -0,0 +1,100 @@ +.sign-up{ + margin: 150px auto 0; + position: relative; + /*text-align: center;*/ + width: 600px; +} +.sign-up.facebook-form{ + text-align: center; +} +.sign-up .form{ + background-color: #FFFFFF; + box-shadow: 0 10px 20px #CBCBCB; + margin-bottom: 20px; + padding: 15px; +} + +.sign-up .login-logo{ + border-bottom: 1px solid #EDEDED; + margin: 0; + padding-bottom: 15px; +} + +.sign-up .option-block{ + margin-top: 15px; +} +.sign-up .or{ + margin-top: 15px; + margin-bottom: 15px; +} +.sign-up .or span{ + margin-left: 5px; + margin-right: 5px; +} + +.sign-up .or .left{ + margin-top: 10px; + margin-left: 60px; + width: 160px; + float: left; +} +.sign-up .or .right{ + margin-top: 10px; + margin-right: 60px; + width: 160px; + float: right; +} +.sign-up .facebook:hover{ + opacity: 0.8; +} + +.sign-up .role-label{ + display: inline; + margin-left: 3px; + margin-right: 10px; +} + +.sign-up .notify{ + font-size: 15px; +} + +.notify.alert{ + padding: 5px 10px 5px 3px; +} + +.notify .icon-ok{ + color: green; + margin-right: 3px; + margin-left: 3px; +} + +.notify .icon-remove{ + color: red; + margin-right: 3px; + margin-left: 3px; +} + +.sign-up input[type=checkbox]{ + margin-top: 0; +} + +.sign-up .error{ + border-color: #E9322D; + box-shadow: 0 0 6px #F8B987; + color: #B94A48; +} + +.line{ + border-bottom: 1px solid #EDEDED; +} + +.links{ + text-align: left; +} + +.loader{ + width:100px; + margin-left: 3px; +} + + diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 7f3b7da..592a509 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,4 +1,5 @@ class UsersController < ApplicationController + layout "authentication" def new @user = User.new end diff --git a/app/models/user.rb b/app/models/user.rb index 7ccce77..d999006 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,3 +1,4 @@ +#this class handles user login and password. User has the attributes user name, email and password which he / she can choose class User include Mongoid::Document include Mongoid::Timestamps diff --git a/app/views/layouts/authentication.html.erb b/app/views/layouts/authentication.html.erb new file mode 100644 index 0000000..161bd59 --- /dev/null +++ b/app/views/layouts/authentication.html.erb @@ -0,0 +1,29 @@ + + + + + RulingOrbit | <%= current_site.title %> + + <%= render 'shared/meta' %> + <%= render 'shared/google_font' %> + <%= stylesheet_link_tag "basic/global" %> + <%= stylesheet_link_tag "basic" %> + <%= stylesheet_link_tag "sign_up" %> + + <%= render 'shared/ie_html5_fix' %> + <%= javascript_include_tag "basic" %> + <%= yield :page_specific_css %> + <%= yield :page_specific_javascript %> + + + <%= csrf_meta_tag %> + + + <%= render 'layouts/orbit_bar_backend' %> + <%= yield %> + + diff --git a/app/views/users/create.html.erb b/app/views/users/create.html.erb deleted file mode 100644 index 48ea02e..0000000 --- a/app/views/users/create.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -

Users#create

-

Find me in app/views/users/create.html.erb

diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 3b5b874..b681b21 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -1,3 +1,64 @@ +
+ +
+ + \ No newline at end of file diff --git a/config/initializers/keyword_constraint.rb b/config/initializers/keyword_constraint.rb index adb8472..41a0b52 100644 --- a/config/initializers/keyword_constraint.rb +++ b/config/initializers/keyword_constraint.rb @@ -1,6 +1,6 @@ class KeywordConstraint def matches?(request) - keywords = %w{admin member desktop user} + keywords = %w{admin member desktop user signup login} keywords.all? { |k| !request.url.include?(k) } end end \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index b9c5176..08eb537 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -44,4 +44,37 @@ en: site: system_preference: System Preference - settings: Site Settings \ No newline at end of file + settings: Site Settings + + users: + admin_change_password: You cannot change your own password here! + avatar: Profile Picture + change_passwd: Password + setting_privilege: Privilege + email: Email + first_name: First Name + last_name: Last Name + male: Male + name: Name + valid_old_password: Current password doesn't match confirmation + new_password: New password + new_password_note: At least 6 characters + new_password_confirmation: Confirm new password + female: Female + unknown: Information Not Available + office_tel: Office Tel No. + office_tel_note: Public available + sid: ID No. + sid_note: Faculty ID No. or Student ID No. + sex: Gender + user_id: User Account + user_id_note: Should be more than 3 characters and less than 50 characters + user_id_not_null: User account cannot be null + user_id_length: User account should be more than 3 characters + user_id_error: Someone already use that user account + user_basic_id_form: Account Info. + user_basic_data: Personal Profile + + dots: ●●●●●● + register: Register + registered: Registered diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index 96872f0..47f53a0 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -18,6 +18,40 @@ zh_tw: logout: 登出 dashboard_: 儀表版 desktop: 桌面 -site: - system_preference: 系統狀態 + site: + system_preference: 系統狀態 + + users: + admin_change_password: 您不能在此處修改自己的密碼! + avatar: 大頭貼照 + change_passwd: 變更密碼 + setting_privilege: 權限設定 + email: 電子郵件 + first_name: 名字 + male: 男性 + name: 姓名 + valid_old_password: 目前的密碼不符合確認值 + new_password: 新密碼 + new_password_note: 至少6個字元 + new_password_confirmation: 確認新密碼 + female: 女性 + unknown: 未知 + last_name: 姓氏 + office_tel: 辦公室電話 + office_tel_note: 將公開於網頁 + sid: 編號 + sid_note: 教職員工編號或學生學號 + sex: 性別 + user_id: 使用者帳號 + user_id_note: 需介於3個字元至50個字元之間 + user_id_not_null: 使用者帳號不能是空值 + user_id_length: 使用者帳號至少需要3個字元 + user_id_error: 該使用者帳號已被使用 + user_basic_id_form: 帳號資料 + user_basic_data: 個人資料 + + dots: ●●●●●● + register: 註冊 + registered: 已註冊 + diff --git a/config/routes.rb b/config/routes.rb index 7afa392..669fd70 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,7 +1,5 @@ OrbitStore::Application.routes.draw do - resources :users - get "/pages/edit_view" => "pages#edit_view" get "/pages/preview" => "pages#preview" @@ -20,9 +18,11 @@ OrbitStore::Application.routes.draw do # You can have the root of your site routed with "root" root 'pages#home' - locales = Site.find_by(site_active: true).in_use_locales + locales = Site.find_by(site_active: true).in_use_locales rescue nil scope "(:locale)", locale: Regexp.new(locales.join("|")) do + resources :users + namespace :admin do resources :dashboards resources :items