diff --git a/.gitignore b/.gitignore index 023345b6..82809a67 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ uploads/**/* *.supported mongoid.yml *. +sftp-config.json diff --git a/app/assets/images/availability-check-loader.gif b/app/assets/images/availability-check-loader.gif new file mode 100644 index 00000000..49b6d853 Binary files /dev/null and b/app/assets/images/availability-check-loader.gif differ diff --git a/app/assets/stylesheets/sign_up.css b/app/assets/stylesheets/sign_up.css index e681da25..d51deb25 100644 --- a/app/assets/stylesheets/sign_up.css +++ b/app/assets/stylesheets/sign_up.css @@ -1,10 +1,12 @@ .sign-up{ margin: 150px auto 0; position: relative; - text-align: center; - width: 500px; + /*text-align: center;*/ + width: 600px; +} +.sign-up.facebook-form{ + text-align: center; } - .sign-up .form{ background-color: #FFFFFF; box-shadow: 0 10px 20px #CBCBCB; @@ -52,10 +54,36 @@ 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; } @@ -64,3 +92,9 @@ text-align: left; } +.loader{ + width:100px; + margin-left: 3px; +} + + diff --git a/app/controllers/admin/users_new_interface_controller.rb b/app/controllers/admin/users_new_interface_controller.rb index 77045ed3..c492083f 100644 --- a/app/controllers/admin/users_new_interface_controller.rb +++ b/app/controllers/admin/users_new_interface_controller.rb @@ -7,6 +7,18 @@ class Admin::UsersNewInterfaceController < OrbitMemberController open_for_user :only => [:setting_account, :edit_user_data, :update] open_for_visitor :only => [:index, :show] + def registration_approval + page_num = params[:page] || 1 + @users = User.approval_pending.page(page_num).per(12).desc("_id") + end + + def approve_registration + user = User.find(params[:users_new_interface_id]) + user.approved = true + user.save + redirect_to admin_users_new_interface_registration_approval_path + end + def index get_tags get_sub_roles @@ -385,6 +397,8 @@ class Admin::UsersNewInterfaceController < OrbitMemberController end @users = User.not_guest_user end + + protected def get_tags diff --git a/app/controllers/basic_infos_controller.rb b/app/controllers/basic_infos_controller.rb index 8386e13d..bda825e9 100644 --- a/app/controllers/basic_infos_controller.rb +++ b/app/controllers/basic_infos_controller.rb @@ -35,4 +35,20 @@ class BasicInfosController < ApplicationController end end + def check_availability + response = {} + case params[:type] + when "user_id" + response["success"] = User.where(:user_id => params[:value]).count > 0 ? false : true + when "user_email" + response["success"] = User.where(:email => params[:value]).count > 0? false : true + end + render :json => response.to_json + end + + + + + + end \ No newline at end of file diff --git a/app/controllers/facebook_controller.rb b/app/controllers/facebook_controller.rb index c2cc4d03..4662301c 100644 --- a/app/controllers/facebook_controller.rb +++ b/app/controllers/facebook_controller.rb @@ -69,14 +69,12 @@ class FacebookController< ApplicationController u.first_name_translations = firstname u.last_name_translations = lastname u.office_tel = user["phone"] - u.email = user["email"] - # u.email = "xyz@zyx.com" u.sex = user["gender"] || "unknown" u.remote_avatar_url = user["picture"] if user["picture"] if u.save render :json=>{"success"=>true,"user"=>user}.to_json else - render :json=>{"success"=>false,"message"=>"Email already occupied."}.to_json + render :json=>{"success"=>false,"message"=>"There was an error imporing data."}.to_json end else diff --git a/app/models/user/user.rb b/app/models/user/user.rb index 815ff355..ee5b08db 100644 --- a/app/models/user/user.rb +++ b/app/models/user/user.rb @@ -17,6 +17,7 @@ class User field :last_name, localize: true field :email field :sex, :default => 'unknown' + field :approved, type: Boolean, :default => false field :office_tel field :cache_dept,type: Hash field :status_record,type: Hash @@ -56,7 +57,8 @@ class User before_save :assign_default_position, :if => :assign_default_position? before_save :rebuild_status_record scope :remote_account, where(:nccu_id.ne => nil) - scope :not_guest_user, all_of(:name.ne => "guest") + scope :not_guest_user, all_of(:name.ne => "guest").and(:approved => true) + scope :approval_pending, where(:approved => false) validates :user_id, :presence => { :message => I18n.t("users.user_id_not_null") } , diff --git a/app/views/admin/users_new_interface/_not_approved_listing.html.erb b/app/views/admin/users_new_interface/_not_approved_listing.html.erb new file mode 100644 index 00000000..2a53aceb --- /dev/null +++ b/app/views/admin/users_new_interface/_not_approved_listing.html.erb @@ -0,0 +1,29 @@ + <% + if not_approved_listing.sex == 'male' + @user_sex = 'gender-man' + elsif not_approved_listing.sex == 'female' + @user_sex = 'gender-woman' + else + @user_sex = 'gender-none' + end + %> +
+ | Roles | +Name | +|
---|---|---|---|
Hooray! No pending registration approvals left. |