gitlabhq/app/views/admin/team_members/_form.html.haml
2011-12-07 10:04:57 +02:00

43 lines
1.4 KiB
Plaintext

= 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
- if @admin_team_member.new_record?
.span-6
= f.label :user_id
.span-6
= 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
%b Project Access:
.span-6
= f.select :project_access, options_for_select(Project.access_options, @admin_team_member.project_access), {}, :class => "project-access-select"
.span-6
%b Repository Access:
.span-6
= f.select :repo_access, options_for_select(Repository.access_options, @admin_team_member.repo_access), {}, :class => "repo-access-select"
%br
.actions
= f.submit 'Save', :class => "grey-button"
:css
form select {
width:300px;
}
:javascript
$('select#team_member_user_id').chosen();
$('select#team_member_project_id').chosen();
$('select#team_member_repo_access').chosen();
$('select#team_member_project_access').chosen();