2011-10-08 23:36:38 +02:00
|
|
|
= form_for @admin_team_member, :as => :team_member, :url => @admin_team_member.new_record? ? admin_team_members_path(@admin_team_member) : admin_team_member_path(@admin_team_member) do |f|
|
|
|
|
-if @admin_team_member.errors.any?
|
|
|
|
#error_explanation
|
|
|
|
%h2= "#{pluralize(@admin_team_member.errors.count, "error")} prohibited this admin_project from being saved:"
|
|
|
|
%ul
|
|
|
|
- @admin_team_member.errors.full_messages.each do |msg|
|
|
|
|
%li= msg
|
|
|
|
|
2011-11-21 08:26:10 +01:00
|
|
|
- if @admin_team_member.new_record?
|
|
|
|
.span-6
|
|
|
|
= f.label :user_id
|
2011-10-08 23:36:38 +02:00
|
|
|
.span-6
|
2011-11-21 08:26:10 +01:00
|
|
|
= f.select :user_id, User.all.map { |user| [user.name, user.id] }
|
|
|
|
.span-6
|
|
|
|
= f.label :project_id
|
|
|
|
.span-6
|
|
|
|
= f.select :project_id, Project.all.map { |user| [user.name, user.id] }
|
|
|
|
|
|
|
|
.span-6
|
2011-12-07 09:04:57 +01:00
|
|
|
%b Project Access:
|
2011-11-21 08:26:10 +01:00
|
|
|
.span-6
|
2011-12-07 09:04:57 +01:00
|
|
|
= f.select :project_access, options_for_select(Project.access_options, @admin_team_member.project_access), {}, :class => "project-access-select"
|
|
|
|
|
2011-11-21 08:26:10 +01:00
|
|
|
.span-6
|
2011-12-07 09:04:57 +01:00
|
|
|
%b Repository Access:
|
2011-11-21 08:26:10 +01:00
|
|
|
.span-6
|
2011-12-07 09:04:57 +01:00
|
|
|
= f.select :repo_access, options_for_select(Repository.access_options, @admin_team_member.repo_access), {}, :class => "repo-access-select"
|
2011-11-21 08:26:10 +01:00
|
|
|
%br
|
2011-10-08 23:36:38 +02:00
|
|
|
.actions
|
2011-11-21 08:26:10 +01:00
|
|
|
= f.submit 'Save', :class => "grey-button"
|
|
|
|
|
2011-12-07 09:04:57 +01:00
|
|
|
:css
|
|
|
|
form select {
|
|
|
|
width:300px;
|
|
|
|
}
|
|
|
|
|
2011-11-21 08:26:10 +01:00
|
|
|
:javascript
|
2011-12-07 09:04:57 +01:00
|
|
|
$('select#team_member_user_id').chosen();
|
|
|
|
$('select#team_member_project_id').chosen();
|
|
|
|
$('select#team_member_repo_access').chosen();
|
|
|
|
$('select#team_member_project_access').chosen();
|
2011-11-21 08:26:10 +01:00
|
|
|
|