mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-05-30 16:30:59 +00:00
Can now join teams from the teams pages individually. If you already have a request active, it will remove that request and replace it with a new one (with a confirmation). I left the Agenda way of joining/cancelling join of teams.
This commit is contained in:
parent
062d00c072
commit
9adf362f6b
6 changed files with 35 additions and 3 deletions
|
@ -13,6 +13,16 @@ class TeamersController < ApplicationController
|
|||
redirect_to_back
|
||||
end
|
||||
|
||||
def edit
|
||||
logger.info params
|
||||
logger.info "hello world"
|
||||
teamer_id = params["teamer"]
|
||||
@teamer = Teamer.find(teamer_id)
|
||||
@teamer.team_id = params["id"]
|
||||
@teamer.save
|
||||
redirect_to_back
|
||||
end
|
||||
|
||||
def destroy
|
||||
@teamer = Teamer.find params[:id]
|
||||
raise AccessError unless @teamer.can_destroy? cuser
|
||||
|
|
|
@ -6,6 +6,8 @@ class TeamsController < ApplicationController
|
|||
end
|
||||
|
||||
def show
|
||||
@teamer = Teamer.new
|
||||
@teamer.user = @user
|
||||
end
|
||||
|
||||
def new
|
||||
|
@ -13,6 +15,12 @@ class TeamsController < ApplicationController
|
|||
raise AccessError unless @team.can_create? cuser
|
||||
end
|
||||
|
||||
def replace_teamer
|
||||
logger.info params
|
||||
logger.info "hello"
|
||||
redirect_to_back
|
||||
end
|
||||
|
||||
def edit
|
||||
raise AccessError unless @team.can_update? cuser
|
||||
end
|
||||
|
|
|
@ -53,7 +53,7 @@ class UsersController < ApplicationController
|
|||
if @user.valid? and @user.save
|
||||
@user.profile = Profile.new
|
||||
@user.profile.user = @user
|
||||
@user.profile.save
|
||||
@user.profile.save!
|
||||
redirect_to action: :show, id: @user.id
|
||||
save_session @user
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue