You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rename.html.erb 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <%= wiki_page_breadcrumb(@page) %>
  2. <h2><%= @original_title %></h2>
  3. <%= error_messages_for 'page' %>
  4. <%= labelled_form_for :wiki_page, @page,
  5. :url => { :action => 'rename' },
  6. :html => { :method => :post } do |f| %>
  7. <div class="box tabular">
  8. <p><%= f.text_field :title, :required => true, :size => 100 %></p>
  9. <% if @page.safe_attribute? 'is_start_page' %>
  10. <p><%= f.check_box :is_start_page, :label => :field_start_page, :disabled => @page.is_start_page %></p>
  11. <% end %>
  12. <p><%= f.check_box :redirect_existing_links %></p>
  13. <% if @page.safe_attribute? 'wiki_id' %>
  14. <p><%= f.select :wiki_id, wiki_page_wiki_options_for_select(@page), :label => :label_project %></p>
  15. <% end %>
  16. <p><%= f.select :parent_id,
  17. content_tag('option', '', :value => '') +
  18. wiki_page_options_for_select(
  19. @wiki.pages.includes(:parent).to_a - @page.self_and_descendants,
  20. @page.parent),
  21. :label => :field_parent_title %></p>
  22. </div>
  23. <%= submit_tag l(:button_rename) %>
  24. <% end %>
  25. <%= javascript_tag do %>
  26. $('#wiki_page_wiki_id').change(function() {
  27. $.ajax({
  28. url: '<%= rename_project_wiki_page_path(@wiki, :format => 'js') %>',
  29. type: 'get',
  30. data: { 'wiki_page[wiki_id]': $('#wiki_page_wiki_id').val() }
  31. });
  32. });
  33. <% end %>