summaryrefslogtreecommitdiffstats
path: root/app/views/wiki/rename.html.erb
blob: 13fb41a702b620ec1f12938cca7e301b6265a1f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<%= wiki_page_breadcrumb(@page) %>

<h2><%= @original_title %></h2>

<%= error_messages_for 'page' %>

<%= labelled_form_for :wiki_page, @page,
                     :url => { :action => 'rename' },
                     :html => { :method => :post } do |f| %>
<div class="box tabular">
<p><%= f.text_field :title, :required => true, :size => 100  %></p>
<% if @page.safe_attribute? 'is_start_page' %>
<p><%= f.check_box :is_start_page, :label => :field_start_page, :disabled => @page.is_start_page %></p>
<% end %>
<p><%= f.check_box :redirect_existing_links %></p>
<% if @page.safe_attribute? 'wiki_id' %>
<p><%= f.select :wiki_id, wiki_page_wiki_options_for_select(@page), :label => :label_project %></p>
<% end %>
<p><%= f.select :parent_id,
                content_tag('option', '', :value => '') + 
                  wiki_page_options_for_select(
                    @wiki.pages.includes(:parent).to_a - @page.self_and_descendants,
                    @page.parent),
                :label => :field_parent_title %></p>

</div>
<%= submit_tag l(:button_rename) %>
<% end %>

<%= javascript_tag do %>
$('#wiki_page_wiki_id').change(function() {
  $.ajax({
    url: '<%= rename_project_wiki_page_path(@wiki, :format => 'js') %>',
    type: 'get',
    data: { 'wiki_page[wiki_id]': $('#wiki_page_wiki_id').val() }
  });
});
<% end %>