<div class="contextual">
	<%= link_to l(:button_add), new_contact_contacts_project_path(@contact, :project_id => @project),
		:remote => true if User.current.allowed_to?(:edit_contacts, @project)%>
 </div>


<h3><%= l(:label_project_plural) %> </h3>

<% unless !(@show_form == "true") %>
	 	<%= form_tag(contact_contacts_projects_path(@contact, :project_id => @project),
                 :remote => true,
   	             :method => :post,
  	             :id => 'add-project-form') do %>
	<p><%= select_tag :id, project_tree_options_for_select(Project.allowed_to(:edit_contacts).order(:lft).all), :prompt => "--- #{l(:actionview_instancetag_blank_option)} ---" %>

	<%= submit_tag l(:button_add), :class => "button-small" %>
	<%= link_to l(:button_cancel), {}, :onclick => "$('#add-project-form').hide(); return false;" %>
	</p>
	<% end %>
<% end %>

<%= render_contact_projects_hierarchy @contact.projects %>
