forked from saurabh/orbit4-5
new error and success pages for google auth and also spinner fixed for update manager
This commit is contained in:
parent
e881d02bee
commit
dfd7865bd5
Binary file not shown.
After Width: | Height: | Size: 4.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 110 KiB |
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
|
@ -0,0 +1,65 @@
|
|||
@charset "utf-8";
|
||||
@import url(http://fonts.googleapis.com/css?family=Ubuntu:400,400italic);
|
||||
body {
|
||||
font-family: "Ubuntu", sans-serif;
|
||||
font-size: 100%;
|
||||
padding: 8rem 0 0 0;
|
||||
background: url(/assets/google-message-background.jpg) center center fixed;
|
||||
background-size: cover;
|
||||
}
|
||||
.message-wrap {
|
||||
width: 80%;
|
||||
max-width: 366px;
|
||||
margin: auto;
|
||||
padding: 2rem;
|
||||
text-align: center;
|
||||
border: 2px solid rgba(255, 255, 255, .1);
|
||||
border-radius: 4px;
|
||||
background: rgba(255, 255, 255, .1);
|
||||
}
|
||||
.message-image-wrap {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 100px;
|
||||
}
|
||||
.message-image {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
margin: 3rem 0 1.875rem 0;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.message-body .message-icon {
|
||||
font-size: 1.2rem;
|
||||
line-height: 50px;
|
||||
position: absolute;
|
||||
right: -1.625rem;
|
||||
bottom: 1rem;
|
||||
display: block;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
color: #fff;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.message-heading {
|
||||
font-size: 1.75rem;
|
||||
font-weight: normal;
|
||||
margin-bottom: .5rem;
|
||||
text-transform: uppercase;
|
||||
color: #fff;
|
||||
}
|
||||
.message-paragraph {
|
||||
font-size: .9rem;
|
||||
font-style: italic;
|
||||
margin-bottom: 1rem;
|
||||
color: rgba(255, 255, 255, .8);
|
||||
}
|
||||
.success-skin {
|
||||
background: #37be1c;
|
||||
}
|
||||
.fail-skin {
|
||||
background: #cc1c1c;
|
||||
}
|
||||
.info-skin {
|
||||
background: #1cadcc;
|
||||
}
|
||||
|
|
@ -36,6 +36,10 @@ class SessionsController < ApplicationController
|
|||
end
|
||||
|
||||
def google_callback
|
||||
error = params[:error] rescue nil
|
||||
if error == "access_denied"
|
||||
redirect_to auth_failure_path and return
|
||||
end
|
||||
auth = env["omniauth.auth"]
|
||||
user = Google.find_by("google_uid" => auth.uid).user rescue nil
|
||||
if user.nil? && current_user.nil?
|
||||
|
@ -69,6 +73,11 @@ class SessionsController < ApplicationController
|
|||
redirect_to admin_member_path(current_user.member_profile.to_param) and return
|
||||
end
|
||||
|
||||
def google_faliure
|
||||
@code = 2
|
||||
render "google_result"
|
||||
end
|
||||
|
||||
def connect_account(auth)
|
||||
if !current_user.nil?
|
||||
google = Google.new
|
||||
|
|
|
@ -12,7 +12,7 @@ class User
|
|||
has_many :assets
|
||||
has_many :user_actions, :dependent => :destroy
|
||||
|
||||
index({ confirmation_token: 1}, { unique: true })
|
||||
# index({ confirmation_token: 1}, { unique: true })
|
||||
scope :unapproved, ->{ where(approved: false) }
|
||||
|
||||
has_secure_password
|
||||
|
|
|
@ -166,7 +166,7 @@
|
|||
<i class="icon-remove"> <%= t("update_manager_.update_faild") %></i>
|
||||
</div>
|
||||
<div id="update_progress">
|
||||
<img src="http://ridepal.com/images/homeimg/preloader_transparent.gif" width="50"><br/>
|
||||
<img src="/assets/spin.gif" width="50"><br/>
|
||||
<span id="progress_msg"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<%#= content_for :page_specific_css do -%>
|
||||
<%# content_for :page_specific_css do -%>
|
||||
<%= stylesheet_link_tag "basic/icon" %>
|
||||
<%= stylesheet_link_tag "lib/orbit_bar/orbit-bar" %>
|
||||
<%# end -%>
|
||||
|
|
|
@ -1 +1,14 @@
|
|||
Google account successfully connected.
|
||||
<!-- Successful message -->
|
||||
<div class="message-wrap google-success">
|
||||
<div class="message-body">
|
||||
<div class="message-image-wrap state-success">
|
||||
<img class="message-image" src="/assets/google-account.png" alt="Google Account">
|
||||
<i class="icon-ok message-icon success-skin"></i>
|
||||
</div>
|
||||
<h3 class="message-heading">Connected</h3>
|
||||
<p class="message-paragraph">Google account is sucessfully connected.</p>
|
||||
<div class="message-button-wrap">
|
||||
<a class="google-btn btn btn-success btn-large" href="<%= admin_member_path(current_user.member_profile.to_param) %>">Got it!</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1 +1,14 @@
|
|||
Google account could not be connected.
|
||||
<!-- Failure message -->
|
||||
<div class="message-wrap google-fail">
|
||||
<div class="message-body">
|
||||
<div class="message-image-wrap">
|
||||
<img class="message-image" src="/assets/google-account.png" alt="Google Account">
|
||||
<i class="icon-remove message-icon fail-skin"></i>
|
||||
</div>
|
||||
<h3 class="message-heading">Failed</h3>
|
||||
<p class="message-paragraph">Sorry, Google could not be connected successfully.</p>
|
||||
<div class="message-button-wrap">
|
||||
<a class="google-btn btn btn-danger btn-large" href="<%= admin_member_path(current_user.member_profile.to_param) %>">Profile</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1 +1,14 @@
|
|||
Google account is not connected. Please login using your username and password and then connect google account in your member profile.
|
||||
<!-- Login require -->
|
||||
<div class="message-wrap google-login-require">
|
||||
<div class="message-body">
|
||||
<div class="message-image-wrap state-login-require">
|
||||
<img class="message-image" src="/assets/google-account.png" alt="Google Account">
|
||||
<i class="icons-question message-icon info-skin"></i>
|
||||
</div>
|
||||
<h3 class="message-heading">Failed</h3>
|
||||
<p class="message-paragraph">Google account is not connected. Please login using your username and password and then connect google account in your member profile.</p>
|
||||
<div class="message-button-wrap">
|
||||
<a class="google-btn btn btn-info btn-large" href="<%= new_session_path %>">Login</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,3 +1,5 @@
|
|||
<section id="main-wrap">
|
||||
<%= render :partial => "google_code_#{@code}" %>
|
||||
</section>
|
||||
<% content_for :page_specific_css do -%>
|
||||
<%= stylesheet_link_tag "google_oauth" %>
|
||||
<% end %>
|
||||
<%= render :partial => "google_code_#{@code}" %>
|
||||
|
||||
|
|
|
@ -22,6 +22,8 @@ Orbit::Application.routes.draw do
|
|||
get 'auth/:provider/callback', to: 'sessions#google_callback'
|
||||
get 'auth/:provider/remove', to: 'sessions#google_remove'
|
||||
get 'auth/google/result', to: 'sessions#google_result'
|
||||
get 'auth/google/result', to: 'sessions#google_result'
|
||||
get 'auth/failure', to: 'sessions#google_faliure'
|
||||
resources :pages
|
||||
resources :page_parts do
|
||||
member do
|
||||
|
|
Loading…
Reference in New Issue