Moved foodcoop/workgroups into new namespace foodcoop. Closes #20
This commit is contained in:
parent
1a8026c5a7
commit
0d910dfbbd
13 changed files with 196 additions and 38 deletions
26
app/controllers/foodcoop/workgroups_controller.rb
Normal file
26
app/controllers/foodcoop/workgroups_controller.rb
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
class Foodcoop::WorkgroupsController < ApplicationController
|
||||
|
||||
before_filter :authenticate_membership_or_admin,
|
||||
:except => [:index]
|
||||
|
||||
def index
|
||||
@workgroups = Workgroup.all :order => "name"
|
||||
end
|
||||
|
||||
def edit
|
||||
@workgroup = Workgroup.find(params[:id])
|
||||
end
|
||||
|
||||
def update
|
||||
@workgroup = Workgroup.find(params[:id])
|
||||
if @workgroup.update_attributes(params[:workgroup])
|
||||
flash[:notice] = "Arbeitsgruppe wurde aktualisiert"
|
||||
redirect_to foodcoop_workgroups_url
|
||||
else
|
||||
render :action => 'edit'
|
||||
end
|
||||
end
|
||||
|
||||
def memberships
|
||||
end
|
||||
end
|
||||
|
|
@ -1,8 +1,7 @@
|
|||
class FoodcoopController < ApplicationController
|
||||
|
||||
before_filter :authenticate_membership_or_admin,
|
||||
:only => [:edit_group, :update_group, :memberships, :invite, :send_invitation]
|
||||
|
||||
before_filter :authenticate_membership_or_admin, :except => [:members]
|
||||
|
||||
# gives a view to list all members of the foodcoop
|
||||
def members
|
||||
|
||||
|
|
@ -39,25 +38,11 @@ class FoodcoopController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
# gives an overview for the workgroups and its members
|
||||
def workgroups
|
||||
@groups = Workgroup.find :all, :order => "name"
|
||||
end
|
||||
|
||||
def group
|
||||
end
|
||||
|
||||
def edit_group
|
||||
end
|
||||
|
||||
def memberships
|
||||
end
|
||||
|
||||
# Invites a new user to join foodsoft in this group.
|
||||
def invite
|
||||
@invite = Invite.new
|
||||
end
|
||||
|
||||
|
||||
# Sends an email
|
||||
def send_invitation
|
||||
@invite = Invite.new(:user => @current_user, :group => @group, :email => params[:invite][:email])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue