From 56ac9222eff587ddaf4546b1b4f4637355d2e101 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 22 Oct 2014 10:16:08 +0800 Subject: [PATCH] =?UTF-8?q?#1384=E4=BF=AE=E5=A4=8Dwiki=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E8=B6=85=E5=87=BA=E8=BE=B9=E6=A1=86=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/wiki/edit.html.erb | 71 +++++++++++++----------- app/views/wiki/history.html.erb | 74 +++++++++++++++---------- app/views/wiki/show.html.erb | 97 ++++++++++++++++----------------- 3 files changed, 131 insertions(+), 111 deletions(-) diff --git a/app/views/wiki/edit.html.erb b/app/views/wiki/edit.html.erb index 30e8b73ae..89dcfdb7a 100644 --- a/app/views/wiki/edit.html.erb +++ b/app/views/wiki/edit.html.erb @@ -1,57 +1,62 @@ <%= wiki_page_breadcrumb(@page) %> -
<%=text_area_tag 'content[text]', @text, :required => true, :id => 'editor02', :cols => 100, :rows => 25 %>
++ <%=text_area_tag 'content[text]', @text, :required => true, :id => 'editor02', :cols => 100, :rows => 25 %> +
+ + <%= fp.select :parent_id,content_tag('option', '', :value => '') + wiki_page_options_for_select(@wiki.pages.all(:include => :parent) - @page.self_and_descendants, @page.parent) %> +
+ <% end %> + <% end %> - ++ + <%= f.text_field :comments, :style => "width:75%;" %> +
++ + <%= render :partial => 'attachments/form' %> +
+- - <%= fp.select :parent_id, - content_tag('option', '', :value => '') + - wiki_page_options_for_select(@wiki.pages.all(:include => :parent) - - @page.self_and_descendants, @page.parent) %> + <%= submit_tag l(:button_save) %>
- <% end %> + <%= wikitoolbar_for 'content_text' %> <% end %> - -<%= f.text_field :comments, :style => "width:75%;" %>
-<%= render :partial => 'attachments/form' %>
-<%= submit_tag l(:button_save) %> - <%#= preview_link({:controller => 'wiki', :action => 'preview', :project_id => @project, :id => @page.title }, 'wiki_form') %>
-<%= wikitoolbar_for 'content_text' %> -<% end %> - - <% content_for :header_tags do %> <%= robot_exclusion_tag %> <% end %> - <% html_title @page.pretty_title %> diff --git a/app/views/wiki/history.html.erb b/app/views/wiki/history.html.erb index 17cb19118..19a577d69 100644 --- a/app/views/wiki/history.html.erb +++ b/app/views/wiki/history.html.erb @@ -8,35 +8,51 @@ :project_id => @page.project, :id => @page.title}, :method => :get) do %># | -- | - | <%= l(:field_updated_on) %> | -<%= l(:field_author) %> | -<%= l(:field_comments) %> | -- |
---|---|---|---|---|---|---|
<%= link_to h(ver.version), :action => 'show', :id => @page.title, :project_id => @page.project, :version => ver.version %> | -<%= radio_button_tag('version', ver.version, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('#cbto-#{line_num+1}').attr('checked', true);") if show_diff && (line_num < @versions.size) %> | -<%= radio_button_tag('version_from', ver.version, (line_num==2), :id => "cbto-#{line_num}") if show_diff && (line_num > 1) %> | -<%= format_time(ver.updated_on) %> | -<%= link_to_user ver.author %> | -<%=h ver.comments %> | -- <%= link_to l(:button_annotate), :action => 'annotate', :id => @page.title, :version => ver.version %> - <%= delete_link wiki_page_path(@page, :version => ver.version) if User.current.allowed_to?(:delete_wiki_pages, @page.project) && @version_count > 1 %> - | -
# | ++ | + | <%= l(:field_updated_on) %> | +<%= l(:field_author) %> | +<%= l(:field_comments) %> | ++ |
+ <%= link_to h(ver.version), :action => 'show', :id => @page.title, :project_id => @page.project, :version => ver.version %> + | ++ <%= radio_button_tag('version', ver.version, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('#cbto-#{line_num+1}').attr('checked', true);") if show_diff && (line_num < @versions.size) %> + | ++ <%= radio_button_tag('version_from', ver.version, (line_num==2), :id => "cbto-#{line_num}") if show_diff && (line_num > 1) %> + | ++ <%= format_time(ver.updated_on) %> + | ++ <%= link_to_user ver.author %> + | ++ <%=h ver.comments.truncate(25,ommision:'...') %> + | ++ <%= link_to l(:button_annotate), :action => 'annotate', :id => @page.title, :version => ver.version %> + <%= delete_link wiki_page_path(@page, :version => ver.version) if User.current.allowed_to?(:delete_wiki_pages, @page.project) && @version_count > 1 %> + | +
- <%= link_to(("\xc2\xab " + l(:label_previous)),
- :action => 'show', :id => @page.title, :project_id => @page.project,
- :version => @content.previous.version) + " - " if @content.previous %>
- <%= "#{l(:label_version)} #{@content.version}/#{@page.content.version}" %>
- <%= '('.html_safe + link_to(l(:label_diff), :controller => 'wiki', :action => 'diff',
- :id => @page.title, :project_id => @page.project,
- :version => @content.version) + ')'.html_safe if @content.previous %> -
- <%= link_to((l(:label_next) + " \xc2\xbb"), :action => 'show',
- :id => @page.title, :project_id => @page.project,
- :version => @content.next.version) + " - " if @content.next %>
- <%= link_to(l(:label_current_version), :action => 'show', :id => @page.title, :project_id => @page.project, :version => nil) %>
-
- <%= @content.author ? link_to_user(@content.author) : l(:label_user_anonymous)
- %>, <%= format_time(@content.updated_on) %>
- <%=h @content.comments %>
+ <%= link_to(("\xc2\xab " + l(:label_previous)),
+ :action => 'show', :id => @page.title, :project_id => @page.project,
+ :version => @content.previous.version) + " - " if @content.previous %>
+ <%= "#{l(:label_version)} #{@content.version}/#{@page.content.version}" %>
+ <%= '('.html_safe + link_to(l(:label_diff), :controller => 'wiki', :action => 'diff',
+ :id => @page.title, :project_id => @page.project,
+ :version => @content.version) + ')'.html_safe if @content.previous %> -
+ <%= link_to((l(:label_next) + " \xc2\xbb"), :action => 'show',
+ :id => @page.title, :project_id => @page.project,
+ :version => @content.next.version) + " - " if @content.next %>
+ <%= link_to(l(:label_current_version), :action => 'show', :id => @page.title, :project_id => @page.project, :version => nil) %>
+
+
+ <%= @content.author ? link_to_user(@content.author) : l(:label_user_anonymous)%>,
+ <%= format_time(@content.updated_on) %>
+
+
+ <%=h @content.comments %>
<%= link_to l(:label_attachment_new), {}, :onclick => "$('#add_attachment_form').show(); return false;", - :id => 'attach_files_link' %>
-<%= form_tag({:controller => 'wiki', :action => 'add_attachment', - :project_id => @project, :id => @page.title}, - :multipart => true, :id => "add_attachment_form", - :style => "display:none;") do %> -<%= render :partial => 'attachments/form' %>
-+ <%= link_to l(:label_attachment_new), {}, :onclick => "$('#add_attachment_form').show(); return false;", + :id => 'attach_files_link' %>
+ <%= form_tag({:controller => 'wiki', :action => 'add_attachment', + :project_id => @project, :id => @page.title}, + :multipart => true, :id => "add_attachment_form", + :style => "display:none;") do %> ++ <%= render :partial => 'attachments/form' %> +
+