%h3= @pagetitle
= form_tag action: :save_group do
  %p
    %label{ for: 'groupid' }
      %b Group:
    %br/
    = text_field_tag 'groupid', params[:groupid], size: '25', required: true
    %br/
    :javascript
      $('#groupid').autocomplete({source: '#{url_for controller: 'groups', action: 'autocomplete'}',
        search: function(event, ui) {
          $(this).addClass('loading-spinner');
        },
        response: function(event, ui) {
          $(this).removeClass('loading-spinner');
        },minLength: 2});
    %b Role:
    %br/
    = select_tag 'role', options_for_select(Role.local_roles, params[:role]), required: true
    %br/
    = hidden_field_tag 'package', @package
    = hidden_field_tag 'project', @project
  %p= submit_tag 'Add group'
