##// END OF EJS Templates
code layout cleanup app/views/wiki/edit.html.erb...
Toshi MARUYAMA -
r8673:d360ca4e145d
parent child
Show More
@@ -1,47 +1,49
1 <%= wiki_page_breadcrumb(@page) %>
1 <%= wiki_page_breadcrumb(@page) %>
2
2
3 <h2><%=h @page.pretty_title %></h2>
3 <h2><%= h @page.pretty_title %></h2>
4
4
5 <% form_for :content, @content, :url => {:action => 'update', :id => @page.title}, :html => {:method => :put, :multipart => true, :id => 'wiki_form'} do |f| %>
5 <% form_for :content, @content,
6 :url => {:action => 'update', :id => @page.title},
7 :html => {:method => :put, :multipart => true, :id => 'wiki_form'} do |f| %>
6 <%= f.hidden_field :version %>
8 <%= f.hidden_field :version %>
7 <% if @section %>
9 <% if @section %>
8 <%= hidden_field_tag 'section', @section %>
10 <%= hidden_field_tag 'section', @section %>
9 <%= hidden_field_tag 'section_hash', @section_hash %>
11 <%= hidden_field_tag 'section_hash', @section_hash %>
10 <% end %>
12 <% end %>
11 <%= error_messages_for 'content' %>
13 <%= error_messages_for 'content' %>
12
14
13 <div class="box tabular">
15 <div class="box tabular">
14 <%= text_area_tag 'content[text]', @text, :cols => 100, :rows => 25, :class => 'wiki-edit', :accesskey => accesskey(:edit) %>
16 <%= text_area_tag 'content[text]', @text, :cols => 100, :rows => 25, :class => 'wiki-edit', :accesskey => accesskey(:edit) %>
15
17
16 <% if @page.safe_attribute_names.include?('parent_id') && @wiki.pages.any? %>
18 <% if @page.safe_attribute_names.include?('parent_id') && @wiki.pages.any? %>
17 <% fields_for @page do |fp| %>
19 <% fields_for @page do |fp| %>
18 <p>
20 <p>
19 <label><%= l(:field_parent_title) %></label>
21 <label><%= l(:field_parent_title) %></label>
20 <%= fp.select :parent_id, "<option value=''></option>" + wiki_page_options_for_select(@wiki.pages.all(:include => :parent) - @page.self_and_descendants, @page.parent) %>
22 <%= fp.select :parent_id, "<option value=''></option>" + wiki_page_options_for_select(@wiki.pages.all(:include => :parent) - @page.self_and_descendants, @page.parent) %>
21 </p>
23 </p>
22 <% end %>
24 <% end %>
23 <% end %>
25 <% end %>
24
26
25 <p><label><%= l(:field_comments) %></label><%= f.text_field :comments, :size => 120 %></p>
27 <p><label><%= l(:field_comments) %></label><%= f.text_field :comments, :size => 120 %></p>
26 <p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p>
28 <p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p>
27 </div>
29 </div>
28
30
29 <p><%= submit_tag l(:button_save) %>
31 <p><%= submit_tag l(:button_save) %>
30 <%= link_to_remote l(:label_preview),
32 <%= link_to_remote l(:label_preview),
31 { :url => { :controller => 'wiki', :action => 'preview', :project_id => @project, :id => @page.title },
33 { :url => { :controller => 'wiki', :action => 'preview', :project_id => @project, :id => @page.title },
32 :method => :post,
34 :method => :post,
33 :update => 'preview',
35 :update => 'preview',
34 :with => "Form.serialize('wiki_form')",
36 :with => "Form.serialize('wiki_form')",
35 :complete => "Element.scrollTo('preview')"
37 :complete => "Element.scrollTo('preview')"
36 }, :accesskey => accesskey(:preview) %></p>
38 }, :accesskey => accesskey(:preview) %></p>
37 <%= wikitoolbar_for 'content_text' %>
39 <%= wikitoolbar_for 'content_text' %>
38 <% end %>
40 <% end %>
39
41
40 <div id="preview" class="wiki"></div>
42 <div id="preview" class="wiki"></div>
41
43
42 <% content_for :header_tags do %>
44 <% content_for :header_tags do %>
43 <%= stylesheet_link_tag 'scm' %>
45 <%= stylesheet_link_tag 'scm' %>
44 <%= robot_exclusion_tag %>
46 <%= robot_exclusion_tag %>
45 <% end %>
47 <% end %>
46
48
47 <% html_title @page.pretty_title %>
49 <% html_title @page.pretty_title %>
General Comments 0
You need to be logged in to leave comments. Login now