summaryrefslogtreecommitdiffstats
path: root/app/views/wiki/edit.html.erb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-05 14:35:27 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-05 14:35:27 +0000
commit001b255b081bec908851ac7e8d715f1bb6e61c03 (patch)
tree3ebd6b7728c0edf5300a3ef681dfffb22b804ed3 /app/views/wiki/edit.html.erb
parent6c27093a8bf4263903f53e9ed774b3794fc143b9 (diff)
downloadredmine-001b255b081bec908851ac7e8d715f1bb6e61c03.tar.gz
redmine-001b255b081bec908851ac7e8d715f1bb6e61c03.zip
Ability to edit a wiki page's parent on the edit page (#6449).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8787 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/wiki/edit.html.erb')
-rw-r--r--app/views/wiki/edit.html.erb9
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>