summaryrefslogtreecommitdiffstats
path: root/app/views/wiki
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-09-09 17:05:38 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-09-09 17:05:38 +0000
commitb4d9ca8875898500ca198bff501dfc7d1c28bd71 (patch)
tree8d9ebcf80cd56b427211b6b769514ab8d66f33a2 /app/views/wiki
parentf6fe15716e4714c5f6d4d88149927b7dfa5c6fce (diff)
downloadredmine-b4d9ca8875898500ca198bff501dfc7d1c28bd71.tar.gz
redmine-b4d9ca8875898500ca198bff501dfc7d1c28bd71.zip
Added the ability to rename wiki pages (specific permission required).
Existing links that point to the old page are preserved and automatically redirected to the new page (this behaviour can be disabled when renaming the page). git-svn-id: http://redmine.rubyforge.org/svn/trunk@720 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/wiki')
-rw-r--r--app/views/wiki/rename.rhtml11
-rw-r--r--app/views/wiki/show.rhtml5
2 files changed, 14 insertions, 2 deletions
diff --git a/app/views/wiki/rename.rhtml b/app/views/wiki/rename.rhtml
new file mode 100644
index 000000000..0c069f43d
--- /dev/null
+++ b/app/views/wiki/rename.rhtml
@@ -0,0 +1,11 @@
+<h2><%= l(:button_rename) %>: <%= @original_title %></h2>
+
+<%= error_messages_for 'page' %>
+
+<% labelled_tabular_form_for :wiki_page, @page, :url => { :action => 'rename' } do |f| %>
+<div class="box">
+<p><%= f.text_field :title, :required => true, :size => 255 %></p>
+<p><%= f.check_box :redirect_existing_links %></p>
+</div>
+<%= submit_tag l(:button_rename) %>
+<% end %>
diff --git a/app/views/wiki/show.rhtml b/app/views/wiki/show.rhtml
index 4041ec018..de28ff1e2 100644
--- a/app/views/wiki/show.rhtml
+++ b/app/views/wiki/show.rhtml
@@ -1,5 +1,6 @@
<div class="contextual">
<%= link_to_if_authorized(l(:button_edit), {:action => 'edit', :page => @page.title}, :class => 'icon icon-edit') if @content.version == @page.content.version %>
+<%= link_to_if_authorized(l(:button_rename), {:action => 'rename', :page => @page.title}, :class => 'icon icon-move') if @content.version == @page.content.version %>
<%= link_to_if_authorized(l(:button_delete), {:action => 'destroy', :page => @page.title}, :method => :post, :confirm => l(:text_are_you_sure), :class => 'icon icon-del') %>
<%= link_to_if_authorized(l(:button_rollback), {:action => 'edit', :page => @page.title, :version => @content.version }, :class => 'icon icon-cancel') if @content.version < @page.content.version %>
<%= link_to(l(:label_history), {:action => 'history', :page => @page.title}, :class => 'icon icon-history') %>
@@ -26,8 +27,8 @@
<div class="contextual">
<%= l(:label_export_to) %>
-<%= link_to 'HTML', {:export => 'html', :version => @content.version}, :class => 'icon icon-html' %>,
-<%= link_to 'TXT', {:export => 'txt', :version => @content.version}, :class => 'icon icon-txt' %>
+<%= link_to 'HTML', {:page => @page.title, :export => 'html', :version => @content.version}, :class => 'icon icon-html' %>,
+<%= link_to 'TXT', {:page => @page.title, :export => 'txt', :version => @content.version}, :class => 'icon icon-txt' %>
</div>
<% if authorize_for('wiki', 'add_attachment') %>