diff options
Diffstat (limited to 'app/views/wiki/edit.html.erb')
-rw-r--r-- | app/views/wiki/edit.html.erb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/views/wiki/edit.html.erb b/app/views/wiki/edit.html.erb index 00d243a13..3bee3dcc8 100644 --- a/app/views/wiki/edit.html.erb +++ b/app/views/wiki/edit.html.erb @@ -13,8 +13,13 @@ <div class="box tabular"> <%= text_area_tag 'content[text]', @text, :cols => 100, :rows => 25, :class => 'wiki-edit', :accesskey => accesskey(:edit) %> -<% if @page.new_record? && @page.parent %> -<p><label><%= check_box_tag 'page[parent_id]', @page.parent.id, true %> <%= l(:field_parent_title) %></label> <%=h @page.parent.pretty_title %></p> +<% if @page.safe_attribute_names.include?('parent_id') && @wiki.pages.any? %> + <% fields_for @page do |fp| %> + <p> + <label><%= l(:field_parent_title) %></label> + <%= fp.select :parent_id, "<option value=''></option>" + wiki_page_options_for_select(@wiki.pages.all(:include => :parent) - @page.self_and_descendants, @page.parent) %> + </p> + <% end %> <% end %> <p><label><%= l(:field_comments) %></label><%= f.text_field :comments, :size => 120 %></p> |