<%#-- copyright OpenProject is a project management system. Copyright (C) 2012-2013 the OpenProject Team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3. See doc/COPYRIGHT.rdoc for more details. ++#%>

<%= t(:button_change_parent_page) %>: <%= h(@page.title) %>

<%= error_messages_for 'page' %> <%= labelled_tabular_form_for @page, :url => { :action => 'update_parent_page' } do |f| %>

<%= f.select :parent_id, "".html_safe + wiki_page_options_for_select(@parent_pages, @page.parent), {:label => WikiPage.human_attribute_name(:parent_title) }, {:size => "#{@parent_pages.size + 1}", :class => "parent-select"} %>

<%= javascript_tag do -%> jQuery(function() { var parent_select = jQuery('#wiki_page_parent_id'); parent_select.attr('size', parent_select.children().length); } )); <% end -%>
<%= submit_tag t(:button_save) %> <% end %>