= form_for @project_member, as: :project_member, url: namespace_project_project_members_path(@project.namespace, @project), html: { class: 'form-horizontal users-project-form' } do |f|
  .form-group
    = f.label :user_ids, "People", class: 'control-label'
    .col-sm-10
      = users_select_tag(:user_ids, multiple: true, class: 'input-large', scope: :all, email_user: true)
      .help-block
        Search for users by name, username, or email, or invite new ones using their email address.

  .form-group
    = f.label :access_level, "Project Access", class: 'control-label'
    .col-sm-10
      = select_tag :access_level, options_for_select(ProjectMember.access_level_roles, @project_member.access_level), class: "project-access-select select2"
      .help-block
        Read more about role permissions
        %strong= link_to "here", help_page_path("user/permissions"), class: "vlink"

  .form-group
    = f.label :expires_at, 'Access expiration date', class: 'control-label'
    .col-sm-10
      .clearable-input
        = text_field_tag :expires_at, nil, class: 'form-control js-access-expiration-date', placeholder: 'Select access expiration date'
        %i.clear-icon.js-clear-input
      .help-block
        On this date, the user(s) will automatically lose access to this project.

  .form-actions
    = f.submit 'Add users to project', class: "btn btn-create"
