mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-20 17:20:12 +01:00
A few minor changes and bug fixes:
* On first user signup, the user no longer needs to login and after signing up. They are automatically logged in. * The Projects page was showing the name of the last project listed in the new project form. It is now appropriately blank. * When trying to create a new action, an error was occurring trying to update tags if the action failed to save. We now only try to update tags if the action saved. I wonder if we should be using some sort of ActiveRecord transaction here. If anyone knows about this, please contact me. git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@481 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
38b2e336a8
commit
5a878b3e84
6 changed files with 11 additions and 5 deletions
|
|
@ -136,6 +136,7 @@ class ProjectsController < ApplicationController
|
||||||
@active_projects = @projects.select{ |p| p.active? }
|
@active_projects = @projects.select{ |p| p.active? }
|
||||||
@hidden_projects = @projects.select{ |p| p.hidden? }
|
@hidden_projects = @projects.select{ |p| p.hidden? }
|
||||||
@completed_projects = @projects.select{ |p| p.completed? }
|
@completed_projects = @projects.select{ |p| p.completed? }
|
||||||
|
@new_project = @user.projects.build
|
||||||
render
|
render
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,10 @@ class TodosController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
@saved = @todo.save
|
@saved = @todo.save
|
||||||
@todo.tag_with(params[:tag_list],@user)
|
if @saved
|
||||||
@todo.reload
|
@todo.tag_with(params[:tag_list],@user)
|
||||||
|
@todo.reload
|
||||||
|
end
|
||||||
|
|
||||||
respond_to do |wants|
|
respond_to do |wants|
|
||||||
wants.html { redirect_to :action => "index" }
|
wants.html { redirect_to :action => "index" }
|
||||||
|
|
|
||||||
|
|
@ -80,11 +80,13 @@ class UsersController < ApplicationController
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
user.is_admin = true if User.no_users_yet?
|
first_user_signing_up = User.no_users_yet?
|
||||||
|
user.is_admin = true if first_user_signing_up
|
||||||
if user.save
|
if user.save
|
||||||
@user = User.authenticate(user.login, params['user']['password'])
|
@user = User.authenticate(user.login, params['user']['password'])
|
||||||
@user.create_preference
|
@user.create_preference
|
||||||
@user.save
|
@user.save
|
||||||
|
session['user_id'] = @user.id if first_user_signing_up
|
||||||
notify :notice, "Signup successful for user #{@user.login}."
|
notify :notice, "Signup successful for user #{@user.login}."
|
||||||
redirect_back_or_home
|
redirect_back_or_home
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
<%= render :partial => 'project_state_group', :object => @completed_projects, :locals => { :state => 'completed'} %>
|
<%= render :partial => 'project_state_group', :object => @completed_projects, :locals => { :state => 'completed'} %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<% @project = @new_project -%>
|
||||||
<div id="input_box">
|
<div id="input_box">
|
||||||
<%= link_to_function("Create a new project »",
|
<%= link_to_function("Create a new project »",
|
||||||
"Element.toggle('project_new');Form.focusFirstElement('project-form');",
|
"Element.toggle('project_new');Form.focusFirstElement('project-form');",
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,4 @@ type "user_login", "admin"
|
||||||
type "user_password", "abracadabra"
|
type "user_password", "abracadabra"
|
||||||
type "user_password_confirmation", "abracadabra"
|
type "user_password_confirmation", "abracadabra"
|
||||||
click_and_wait "signup"
|
click_and_wait "signup"
|
||||||
assert_title 'exact:TRACKS::Login'
|
|
||||||
include_partial 'login/login', :username => 'admin', :password => 'abracadabra'
|
|
||||||
assert_title 'exact:TRACKS::List tasks'
|
assert_title 'exact:TRACKS::List tasks'
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ type "//div[@id='edit_project_2'] //input[@name='project[name]']", "become a bil
|
||||||
click "//div[@id='edit_project_2'] //input[@value='Update']"
|
click "//div[@id='edit_project_2'] //input[@value='Update']"
|
||||||
wait_for_not_visible "edit_project_2"
|
wait_for_not_visible "edit_project_2"
|
||||||
wait_for_visible "project_2"
|
wait_for_visible "project_2"
|
||||||
|
wait_for_visible "flash"
|
||||||
|
wait_for_not_visible "flash"
|
||||||
click "css=#project_2 .buttons img.delete_item"
|
click "css=#project_2 .buttons img.delete_item"
|
||||||
assert_confirmation "Are you sure that you want to delete the project 'become a billionaire'?"
|
assert_confirmation "Are you sure that you want to delete the project 'become a billionaire'?"
|
||||||
wait_for_visible "flash"
|
wait_for_visible "flash"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue