<%= javascript_tag do %>
  $('#maintained_project').autocomplete({source: '<%= url_for :controller => 'project', :action => 'autocomplete_projects' %>', search: function(event, ui) {
    $(this).addClass('loading-spinner');
  },
  response: function(event, ui) {
    $(this).removeClass('loading-spinner');
  }, minLength: 2});
<% end %>

<div>
  <div class="dialog darkgrey_box">
    <div class="box box-shadow">
      <h2 class="box-header">Add Project to Maintenance</h2>
      <div class="dialog-content">
        <p>Do you want to maintain <%= project_or_package_link project: @project.name %>?</p>

        <%= form_tag({:controller => 'project', :action => 'add_maintained_project'}) do %>
          <%= hidden_field_tag(:project, @project) %>
          <p>
            <%= label_tag(:maintained_project, 'Project to maintain:') %><br/>
            <%= text_field_tag(:maintained_project, '', :size => 40) %>
          </p>
          <%= render partial: '/webui/shared/dialog_action_buttons' %>
        <% end %>
      </div>
    </div>
  </div>
</div>
