Merge branch 'development' of gitlab.tp.rulingcom.com:saurabh/orbit4-5 into gravity

Conflicts:
	app/views/admin/members/show.html.erb
This commit is contained in:
Harry Bomrah 2015-03-04 20:33:22 +08:00
commit a6c7652851
3 changed files with 6 additions and 4 deletions

View File

@ -65,7 +65,7 @@ class SessionsController < ApplicationController
end
def google_remove
current_user.google.destroy
current_user.google.destroy rescue ""
redirect_to admin_member_path(current_user.member_profile.to_param) and return
end

View File

@ -2,7 +2,7 @@
<h4><span><%= t("social_profile_connections")%></span></h4>
<dl>
<% if current_site.google_oauth_enabled %>
<dt id="google_connection"><div class="main_text">Google <span class="pull-right"><input <%= (!@member.user.google.nil? ? "checked=checked" : "") %> type="checkbox" id="google_connect_box" class="toggle-check set-sidebar-state" data-disabled="true"></span></div><div class="wait_text" style="text-align:center; display:none;">Please wait...</div></dt>
<dt id="google_connection"><div class="main_text">Google <span class="pull-right"><input <%= (!@member.user.google.nil? ? "checked=checked" : "") %> type="checkbox" id="google_connect_box" class="set-sidebar-state" data-disabled="true"></span></div><div class="wait_text" style="text-align:center; display:none;">Please wait...</div></dt>
<% end %>
</dl>
</div>

View File

@ -72,8 +72,10 @@
$("#google_connect_box").on("click",function(){
$("#google_connection div.main_text").css("opacity","0.5");
$("#google_connection div.wait_text").show();
if($(this).parent().hasClass("disable")){
if(confirm("Are you sure?")){
if($(this).is(":checked")){
window.location.href = "/auth/google_oauth2";
}else{
if(confirm("Are you sure?")){
window.location.href = "/auth/google_oauth2/remove";
}else{
$("#google_connection div.main_text").css("opacity","1");