Skip to content
Extraits de code Groupes Projets
Valider 4ec11691 rédigé par danielvincent's avatar danielvincent
Parcourir les fichiers

user has a getting_started flag, set true by default. aspect#index checks to...

user has a getting_started flag, set true by default.  aspect#index checks to see if getting_started flag is set.
parent b320f5df
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -11,6 +11,10 @@ class AspectsController < ApplicationController
def index
@posts = current_user.visible_posts(:by_members_of => :all).paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC'
@aspect = :all
if current_user.getting_started == true
redirect_to getting_started_path(1)
end
end
def create
......
......@@ -20,14 +20,23 @@ class UsersController < ApplicationController
def update
@user = current_user
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?
if params[:user][:password] && params[:user][:password_confirmation]
if @user.update_attributes(:password => params[:user][:password], :password_confirmation => params[:user][:password_confirmation])
flash[:notice] = "Password Changed"
else
flash[:error] = "Password Change Failed"
if params[:user][:getting_started]
puts "here"
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_confirmation) if params[:user][:password].blank? and params[:user][:password_confirmation].blank?
if params[:user][:password] && params[:user][:password_confirmation]
if @user.update_attributes(:password => params[:user][:password], :password_confirmation => params[:user][:password_confirmation])
flash[:notice] = "Password Changed"
else
flash[:error] = "Password Change Failed"
end
end
end
......
......@@ -40,7 +40,7 @@ class User
key :invite_messages, Hash
key :getting_started, Boolean, :default => false
key :getting_started, Boolean, :default => true
before_validation :strip_username, :on => :create
validates_presence_of :username
......
......@@ -69,5 +69,3 @@
.span-24.last
= render "posts/debug"
#getting_started_button
= link_to "Getting started", getting_started_path(1)
......@@ -71,3 +71,5 @@
.submit_block
= person.submit "Save and continue →"
.bottom_notification
= link_to "skip getting started →", '#', :id => "getting_started_skip"
......@@ -65,3 +65,7 @@
.submit_block
= link_to "Back", getting_started_path(1), :class => "button"
= link_to "Save and continue →", getting_started_path(3), :class => "button"
.bottom_notification
= link_to "skip getting started →", '#'
......@@ -39,3 +39,6 @@
.submit_block
= link_to "Back", getting_started_path(2), :class => "button"
= link_to "Save and continue →", getting_started_path(4), :class => "button"
.bottom_notification
= link_to "skip getting started →", '#'
......@@ -3,6 +3,14 @@
-# the COPYRIGHT file.
- content_for :head do
- if current_user.getting_started == true
:javascript
$.ajax({
type: "PUT",
url: "/users/#{current_user.id}",
data: {"user":{"getting_started":'false'}}
})
.span-8.append-1.last
%h1{:style => "text-align:right;"}
......@@ -31,7 +39,6 @@
%br
%br
%h3
= link_to "Continue on to your everyone page, an overview of all of your aspects.", root_path
......
......@@ -1246,23 +1246,6 @@ ul#breadcrumb
&:after
:content ''
#getting_started_button
:position fixed
:bottom 4px
:margin
:left 680px
a
:padding 10px
:background #333
:color #eee
:-webkit-border-radius 5px 5px 0 0
:-moz-border-radius 5px 5px 0 0
:border-radius 5px 5px 0 0
:-webkit-box-shadow 0 0 2px #666
ul.aspects
:margin 0
:padding 0
......@@ -1328,10 +1311,22 @@ ul.aspects
:text
:align center
:font
:size 16px
:size 14px
:weight bold
:color #fff
:padding 21px
:padding 12px
:bottom 10px
a
:color #fafafa
:background
:color rgb(16,127,201)
:padding 8px
:border-radius 10px
&:hover
:background
:color #22AAE0
.inline_aspect_listing
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter