skip getting started is not ajaxy
This commit is contained in:
parent
544ab993ac
commit
34a1a35bf1
3 changed files with 33 additions and 46 deletions
|
|
@ -19,12 +19,6 @@ class UsersController < ApplicationController
|
||||||
def update
|
def update
|
||||||
@user = current_user
|
@user = current_user
|
||||||
|
|
||||||
if params[:user][:getting_started]
|
|
||||||
boolean = params[:user][:getting_started] == "true"
|
|
||||||
@user.update_attributes( :getting_started => boolean )
|
|
||||||
redirect_to root_path
|
|
||||||
|
|
||||||
else
|
|
||||||
params[:user].delete(:password) if params[:user][:password].blank?
|
params[:user].delete(:password) if params[:user][:password].blank?
|
||||||
params[:user].delete(:password_confirmation) if params[:user][:password].blank? and params[:user][:password_confirmation].blank?
|
params[:user].delete(:password_confirmation) if params[:user][:password].blank? and params[:user][:password_confirmation].blank?
|
||||||
params[:user].delete(:language) if params[:user][:language].blank?
|
params[:user].delete(:language) if params[:user][:language].blank?
|
||||||
|
|
@ -50,7 +44,6 @@ class UsersController < ApplicationController
|
||||||
else
|
else
|
||||||
flash[:error] = I18n.t 'users.update.language_not_changed'
|
flash[:error] = I18n.t 'users.update.language_not_changed'
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
redirect_to edit_user_path(@user)
|
redirect_to edit_user_path(@user)
|
||||||
end
|
end
|
||||||
|
|
@ -96,6 +89,12 @@ class UsersController < ApplicationController
|
||||||
render "users/getting_started"
|
render "users/getting_started"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def getting_started_completed
|
||||||
|
user = current_user
|
||||||
|
user.update_attributes( :getting_started => false )
|
||||||
|
redirect_to root_path
|
||||||
|
end
|
||||||
|
|
||||||
def export
|
def export
|
||||||
exporter = Diaspora::Exporter.new(Diaspora::Exporters::XML)
|
exporter = Diaspora::Exporter.new(Diaspora::Exporters::XML)
|
||||||
send_data exporter.execute(current_user), :filename => "#{current_user.username}_diaspora_data.xml", :type => :xml
|
send_data exporter.execute(current_user), :filename => "#{current_user.username}_diaspora_data.xml", :type => :xml
|
||||||
|
|
|
||||||
|
|
@ -18,19 +18,6 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
- if current_user.getting_started == true
|
|
||||||
:javascript
|
|
||||||
$("#getting_started_skip").live("click", function(evt){
|
|
||||||
evt.preventDefault();
|
|
||||||
$.ajax({
|
|
||||||
type: "PUT",
|
|
||||||
url: "/users/#{current_user.id}",
|
|
||||||
data: {"user":{"getting_started":'false'}},
|
|
||||||
success: function() { window.location = "#{root_path}"}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
.span-8.append-1.last
|
.span-8.append-1.last
|
||||||
%h1{:style => "text-align:right;"}
|
%h1{:style => "text-align:right;"}
|
||||||
= t('.welcome')
|
= t('.welcome')
|
||||||
|
|
@ -71,4 +58,4 @@
|
||||||
|
|
||||||
- if @user.getting_started
|
- if @user.getting_started
|
||||||
.bottom_notification
|
.bottom_notification
|
||||||
= link_to "#{t('.skip')} →", '#', :id => "getting_started_skip"
|
= link_to "#{t('.skip')} →", getting_started_completed_path
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ Diaspora::Application.routes.draw do
|
||||||
# added public route to user
|
# added public route to user
|
||||||
match 'public/:username', :to => 'users#public'
|
match 'public/:username', :to => 'users#public'
|
||||||
match 'getting_started', :to => 'users#getting_started', :as => 'getting_started'
|
match 'getting_started', :to => 'users#getting_started', :as => 'getting_started'
|
||||||
|
match 'getting_started_completed', :to => 'users#getting_started_completed'
|
||||||
match 'users/export', :to => 'users#export'
|
match 'users/export', :to => 'users#export'
|
||||||
match 'users/export_photos', :to => 'users#export_photos'
|
match 'users/export_photos', :to => 'users#export_photos'
|
||||||
match 'login', :to => 'users#sign_up'
|
match 'login', :to => 'users#sign_up'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue