user has a getting_started flag, set true by default. aspect#index checks to see if getting_started flag is set.
This commit is contained in:
parent
b320f5df72
commit
4ec11691cd
9 changed files with 52 additions and 30 deletions
|
|
@ -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,6 +20,14 @@ class UsersController < ApplicationController
|
|||
|
||||
def update
|
||||
@user = current_user
|
||||
|
||||
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?
|
||||
|
||||
|
|
@ -30,6 +38,7 @@ class UsersController < ApplicationController
|
|||
flash[:error] = "Password Change Failed"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
redirect_to edit_user_path(@user)
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue