@@ -1,35 +1,41 | |||||
1 | # Redmine - project management software |
|
1 | # Redmine - project management software | |
2 | # Copyright (C) 2006-2011 Jean-Philippe Lang |
|
2 | # Copyright (C) 2006-2011 Jean-Philippe Lang | |
3 | # |
|
3 | # | |
4 | # This program is free software; you can redistribute it and/or |
|
4 | # This program is free software; you can redistribute it and/or | |
5 | # modify it under the terms of the GNU General Public License |
|
5 | # modify it under the terms of the GNU General Public License | |
6 | # as published by the Free Software Foundation; either version 2 |
|
6 | # as published by the Free Software Foundation; either version 2 | |
7 | # of the License, or (at your option) any later version. |
|
7 | # of the License, or (at your option) any later version. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU General Public License |
|
14 | # You should have received a copy of the GNU General Public License | |
15 | # along with this program; if not, write to the Free Software |
|
15 | # along with this program; if not, write to the Free Software | |
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
17 |
|
17 | |||
18 | module WikiHelper |
|
18 | module WikiHelper | |
19 |
|
19 | |||
20 | def wiki_page_options_for_select(pages, selected = nil, parent = nil, level = 0) |
|
20 | def wiki_page_options_for_select(pages, selected = nil, parent = nil, level = 0) | |
21 | pages = pages.group_by(&:parent) unless pages.is_a?(Hash) |
|
21 | pages = pages.group_by(&:parent) unless pages.is_a?(Hash) | |
22 | s = '' |
|
22 | s = '' | |
23 | if pages.has_key?(parent) |
|
23 | if pages.has_key?(parent) | |
24 | pages[parent].each do |page| |
|
24 | pages[parent].each do |page| | |
25 | attrs = "value='#{page.id}'" |
|
25 | attrs = "value='#{page.id}'" | |
26 | attrs << " selected='selected'" if selected == page |
|
26 | attrs << " selected='selected'" if selected == page | |
27 | indent = (level > 0) ? (' ' * level * 2 + '» ') : nil |
|
27 | indent = (level > 0) ? (' ' * level * 2 + '» ') : nil | |
28 |
|
28 | |||
29 | s << "<option #{attrs}>#{indent}#{h page.pretty_title}</option>\n" + |
|
29 | s << "<option #{attrs}>#{indent}#{h page.pretty_title}</option>\n" + | |
30 | wiki_page_options_for_select(pages, selected, page, level + 1) |
|
30 | wiki_page_options_for_select(pages, selected, page, level + 1) | |
31 | end |
|
31 | end | |
32 | end |
|
32 | end | |
33 | s |
|
33 | s | |
34 | end |
|
34 | end | |
|
35 | ||||
|
36 | def wiki_page_breadcrumb(page) | |||
|
37 | breadcrumb(page.ancestors.reverse.collect {|parent| | |||
|
38 | link_to(h(parent.pretty_title), {:controller => 'wiki', :action => 'show', :id => parent.title, :project_id => parent.project}) | |||
|
39 | }) | |||
|
40 | end | |||
35 | end |
|
41 | end |
@@ -1,32 +1,34 | |||||
1 | <div class="contextual"> |
|
1 | <div class="contextual"> | |
2 | <%= link_to(l(:button_edit), {:action => 'edit', :id => @page.title}, :class => 'icon icon-edit') %> |
|
2 | <%= link_to(l(:button_edit), {:action => 'edit', :id => @page.title}, :class => 'icon icon-edit') %> | |
3 | <%= link_to(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %> |
|
3 | <%= link_to(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %> | |
4 | </div> |
|
4 | </div> | |
5 |
|
5 | |||
6 | <h2><%= @page.pretty_title %></h2> |
|
6 | <%= wiki_page_breadcrumb(@page) %> | |
|
7 | ||||
|
8 | <h2><%=h @page.pretty_title %></h2> | |||
7 |
|
9 | |||
8 | <p> |
|
10 | <p> | |
9 | <%= l(:label_version) %> <%= link_to @annotate.content.version, :action => 'show', :id => @page.title, :version => @annotate.content.version %> |
|
11 | <%= l(:label_version) %> <%= link_to @annotate.content.version, :action => 'show', :id => @page.title, :version => @annotate.content.version %> | |
10 | <em>(<%= @annotate.content.author ? @annotate.content.author.name : "anonyme" %>, <%= format_time(@annotate.content.updated_on) %>)</em> |
|
12 | <em>(<%= @annotate.content.author ? @annotate.content.author.name : "anonyme" %>, <%= format_time(@annotate.content.updated_on) %>)</em> | |
11 | </p> |
|
13 | </p> | |
12 |
|
14 | |||
13 | <% colors = Hash.new {|k,v| k[v] = (k.size % 12) } %> |
|
15 | <% colors = Hash.new {|k,v| k[v] = (k.size % 12) } %> | |
14 |
|
16 | |||
15 | <table class="filecontent annotate"> |
|
17 | <table class="filecontent annotate"> | |
16 | <tbody> |
|
18 | <tbody> | |
17 | <% line_num = 1 %> |
|
19 | <% line_num = 1 %> | |
18 | <% @annotate.lines.each do |line| -%> |
|
20 | <% @annotate.lines.each do |line| -%> | |
19 | <tr class="bloc-<%= colors[line[0]] %>"> |
|
21 | <tr class="bloc-<%= colors[line[0]] %>"> | |
20 | <th class="line-num"><%= line_num %></th> |
|
22 | <th class="line-num"><%= line_num %></th> | |
21 | <td class="revision"><%= link_to line[0], :controller => 'wiki', :action => 'show', :project_id => @project, :id => @page.title, :version => line[0] %></td> |
|
23 | <td class="revision"><%= link_to line[0], :controller => 'wiki', :action => 'show', :project_id => @project, :id => @page.title, :version => line[0] %></td> | |
22 | <td class="author"><%= h(line[1]) %></td> |
|
24 | <td class="author"><%= h(line[1]) %></td> | |
23 | <td class="line-code"><pre><%=h line[2] %></pre></td> |
|
25 | <td class="line-code"><pre><%=h line[2] %></pre></td> | |
24 | </tr> |
|
26 | </tr> | |
25 | <% line_num += 1 %> |
|
27 | <% line_num += 1 %> | |
26 | <% end -%> |
|
28 | <% end -%> | |
27 | </tbody> |
|
29 | </tbody> | |
28 | </table> |
|
30 | </table> | |
29 |
|
31 | |||
30 | <% content_for :header_tags do %> |
|
32 | <% content_for :header_tags do %> | |
31 | <%= stylesheet_link_tag 'scm' %> |
|
33 | <%= stylesheet_link_tag 'scm' %> | |
32 | <% end %> |
|
34 | <% end %> |
@@ -1,19 +1,21 | |||||
|
1 | <%= wiki_page_breadcrumb(@page) %> | |||
|
2 | ||||
1 | <h2><%=h @page.pretty_title %></h2> |
|
3 | <h2><%=h @page.pretty_title %></h2> | |
2 |
|
4 | |||
3 | <% form_tag({}, :method => :delete) do %> |
|
5 | <% form_tag({}, :method => :delete) do %> | |
4 | <div class="box"> |
|
6 | <div class="box"> | |
5 | <p><strong><%= l(:text_wiki_page_destroy_question, :descendants => @descendants_count) %></strong></p> |
|
7 | <p><strong><%= l(:text_wiki_page_destroy_question, :descendants => @descendants_count) %></strong></p> | |
6 | <p><label><%= radio_button_tag 'todo', 'nullify', true %> <%= l(:text_wiki_page_nullify_children) %></label><br /> |
|
8 | <p><label><%= radio_button_tag 'todo', 'nullify', true %> <%= l(:text_wiki_page_nullify_children) %></label><br /> | |
7 | <label><%= radio_button_tag 'todo', 'destroy', false %> <%= l(:text_wiki_page_destroy_children) %></label> |
|
9 | <label><%= radio_button_tag 'todo', 'destroy', false %> <%= l(:text_wiki_page_destroy_children) %></label> | |
8 | <% if @reassignable_to.any? %> |
|
10 | <% if @reassignable_to.any? %> | |
9 | <br /> |
|
11 | <br /> | |
10 | <label><%= radio_button_tag 'todo', 'reassign', false %> <%= l(:text_wiki_page_reassign_children) %></label>: |
|
12 | <label><%= radio_button_tag 'todo', 'reassign', false %> <%= l(:text_wiki_page_reassign_children) %></label>: | |
11 | <%= select_tag 'reassign_to_id', wiki_page_options_for_select(@reassignable_to), |
|
13 | <%= select_tag 'reassign_to_id', wiki_page_options_for_select(@reassignable_to), | |
12 | :onclick => "$('todo_reassign').checked = true;" %> |
|
14 | :onclick => "$('todo_reassign').checked = true;" %> | |
13 | <% end %> |
|
15 | <% end %> | |
14 | </p> |
|
16 | </p> | |
15 | </div> |
|
17 | </div> | |
16 |
|
18 | |||
17 | <%= submit_tag l(:button_apply) %> |
|
19 | <%= submit_tag l(:button_apply) %> | |
18 | <%= link_to l(:button_cancel), :controller => 'wiki', :action => 'show', :project_id => @project, :id => @page.title %> |
|
20 | <%= link_to l(:button_cancel), :controller => 'wiki', :action => 'show', :project_id => @project, :id => @page.title %> | |
19 | <% end %> |
|
21 | <% end %> |
@@ -1,17 +1,19 | |||||
1 | <div class="contextual"> |
|
1 | <div class="contextual"> | |
2 | <%= link_to(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %> |
|
2 | <%= link_to(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %> | |
3 | </div> |
|
3 | </div> | |
4 |
|
4 | |||
5 | <h2><%= @page.pretty_title %></h2> |
|
5 | <%= wiki_page_breadcrumb(@page) %> | |
|
6 | ||||
|
7 | <h2><%=h @page.pretty_title %></h2> | |||
6 |
|
8 | |||
7 | <p> |
|
9 | <p> | |
8 | <%= l(:label_version) %> <%= link_to @diff.content_from.version, :action => 'show', :id => @page.title, :project_id => @page.project, :version => @diff.content_from.version %> |
|
10 | <%= l(:label_version) %> <%= link_to @diff.content_from.version, :action => 'show', :id => @page.title, :project_id => @page.project, :version => @diff.content_from.version %> | |
9 | <em>(<%= @diff.content_from.author ? @diff.content_from.author.name : "anonyme" %>, <%= format_time(@diff.content_from.updated_on) %>)</em> |
|
11 | <em>(<%= @diff.content_from.author ? @diff.content_from.author.name : "anonyme" %>, <%= format_time(@diff.content_from.updated_on) %>)</em> | |
10 | → |
|
12 | → | |
11 | <%= l(:label_version) %> <%= link_to @diff.content_to.version, :action => 'show', :id => @page.title, :project_id => @page.project, :version => @diff.content_to.version %>/<%= @page.content.version %> |
|
13 | <%= l(:label_version) %> <%= link_to @diff.content_to.version, :action => 'show', :id => @page.title, :project_id => @page.project, :version => @diff.content_to.version %>/<%= @page.content.version %> | |
12 | <em>(<%= @diff.content_to.author ? @diff.content_to.author.name : "anonyme" %>, <%= format_time(@diff.content_to.updated_on) %>)</em> |
|
14 | <em>(<%= @diff.content_to.author ? @diff.content_to.author.name : "anonyme" %>, <%= format_time(@diff.content_to.updated_on) %>)</em> | |
13 | </p> |
|
15 | </p> | |
14 |
|
16 | |||
15 | <div class="text-diff"> |
|
17 | <div class="text-diff"> | |
16 | <%= simple_format_without_paragraph @diff.to_html %> |
|
18 | <%= simple_format_without_paragraph @diff.to_html %> | |
17 | </div> |
|
19 | </div> |
@@ -1,29 +1,31 | |||||
|
1 | <%= wiki_page_breadcrumb(@page) %> | |||
|
2 | ||||
1 | <h2><%=h @page.pretty_title %></h2> |
|
3 | <h2><%=h @page.pretty_title %></h2> | |
2 |
|
4 | |||
3 | <% 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, :url => {:action => 'update', :id => @page.title}, :html => {:method => :put, :multipart => true, :id => 'wiki_form'} do |f| %> | |
4 | <%= f.hidden_field :version %> |
|
6 | <%= f.hidden_field :version %> | |
5 | <%= error_messages_for 'content' %> |
|
7 | <%= error_messages_for 'content' %> | |
6 |
|
8 | |||
7 | <p><%= f.text_area :text, :cols => 100, :rows => 25, :class => 'wiki-edit', :accesskey => accesskey(:edit) %></p> |
|
9 | <p><%= f.text_area :text, :cols => 100, :rows => 25, :class => 'wiki-edit', :accesskey => accesskey(:edit) %></p> | |
8 | <p><label><%= l(:field_comments) %></label><br /><%= f.text_field :comments, :size => 120 %></p> |
|
10 | <p><label><%= l(:field_comments) %></label><br /><%= f.text_field :comments, :size => 120 %></p> | |
9 | <p><label><%=l(:label_attachment_plural)%></label><br /><%= render :partial => 'attachments/form' %></p> |
|
11 | <p><label><%=l(:label_attachment_plural)%></label><br /><%= render :partial => 'attachments/form' %></p> | |
10 |
|
12 | |||
11 | <p><%= submit_tag l(:button_save) %> |
|
13 | <p><%= submit_tag l(:button_save) %> | |
12 | <%= link_to_remote l(:label_preview), |
|
14 | <%= link_to_remote l(:label_preview), | |
13 | { :url => { :controller => 'wiki', :action => 'preview', :project_id => @project, :id => @page.title }, |
|
15 | { :url => { :controller => 'wiki', :action => 'preview', :project_id => @project, :id => @page.title }, | |
14 | :method => :post, |
|
16 | :method => :post, | |
15 | :update => 'preview', |
|
17 | :update => 'preview', | |
16 | :with => "Form.serialize('wiki_form')", |
|
18 | :with => "Form.serialize('wiki_form')", | |
17 | :complete => "Element.scrollTo('preview')" |
|
19 | :complete => "Element.scrollTo('preview')" | |
18 | }, :accesskey => accesskey(:preview) %></p> |
|
20 | }, :accesskey => accesskey(:preview) %></p> | |
19 | <%= wikitoolbar_for 'content_text' %> |
|
21 | <%= wikitoolbar_for 'content_text' %> | |
20 | <% end %> |
|
22 | <% end %> | |
21 |
|
23 | |||
22 | <div id="preview" class="wiki"></div> |
|
24 | <div id="preview" class="wiki"></div> | |
23 |
|
25 | |||
24 | <% content_for :header_tags do %> |
|
26 | <% content_for :header_tags do %> | |
25 | <%= stylesheet_link_tag 'scm' %> |
|
27 | <%= stylesheet_link_tag 'scm' %> | |
26 | <%= robot_exclusion_tag %> |
|
28 | <%= robot_exclusion_tag %> | |
27 | <% end %> |
|
29 | <% end %> | |
28 |
|
30 | |||
29 | <% html_title @page.pretty_title %> |
|
31 | <% html_title @page.pretty_title %> |
@@ -1,35 +1,37 | |||||
1 | <h2><%= @page.pretty_title %></h2> |
|
1 | <%= wiki_page_breadcrumb(@page) %> | |
|
2 | ||||
|
3 | <h2><%=h @page.pretty_title %></h2> | |||
2 |
|
4 | |||
3 | <h3><%= l(:label_history) %></h3> |
|
5 | <h3><%= l(:label_history) %></h3> | |
4 |
|
6 | |||
5 | <% form_tag({:action => "diff"}, :method => :get) do %> |
|
7 | <% form_tag({:action => "diff"}, :method => :get) do %> | |
6 | <table class="list wiki-page-versions"> |
|
8 | <table class="list wiki-page-versions"> | |
7 | <thead><tr> |
|
9 | <thead><tr> | |
8 | <th>#</th> |
|
10 | <th>#</th> | |
9 | <th></th> |
|
11 | <th></th> | |
10 | <th></th> |
|
12 | <th></th> | |
11 | <th><%= l(:field_updated_on) %></th> |
|
13 | <th><%= l(:field_updated_on) %></th> | |
12 | <th><%= l(:field_author) %></th> |
|
14 | <th><%= l(:field_author) %></th> | |
13 | <th><%= l(:field_comments) %></th> |
|
15 | <th><%= l(:field_comments) %></th> | |
14 | <th></th> |
|
16 | <th></th> | |
15 | </tr></thead> |
|
17 | </tr></thead> | |
16 | <tbody> |
|
18 | <tbody> | |
17 | <% show_diff = @versions.size > 1 %> |
|
19 | <% show_diff = @versions.size > 1 %> | |
18 | <% line_num = 1 %> |
|
20 | <% line_num = 1 %> | |
19 | <% @versions.each do |ver| %> |
|
21 | <% @versions.each do |ver| %> | |
20 | <tr class="wiki-page-version <%= cycle("odd", "even") %>"> |
|
22 | <tr class="wiki-page-version <%= cycle("odd", "even") %>"> | |
21 | <td class="id"><%= link_to ver.version, :action => 'show', :id => @page.title, :project_id => @page.project, :version => ver.version %></td> |
|
23 | <td class="id"><%= link_to ver.version, :action => 'show', :id => @page.title, :project_id => @page.project, :version => ver.version %></td> | |
22 | <td class="checkbox"><%= radio_button_tag('version', ver.version, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('cbto-#{line_num+1}').checked=true;") if show_diff && (line_num < @versions.size) %></td> |
|
24 | <td class="checkbox"><%= radio_button_tag('version', ver.version, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('cbto-#{line_num+1}').checked=true;") if show_diff && (line_num < @versions.size) %></td> | |
23 | <td class="checkbox"><%= radio_button_tag('version_from', ver.version, (line_num==2), :id => "cbto-#{line_num}") if show_diff && (line_num > 1) %></td> |
|
25 | <td class="checkbox"><%= radio_button_tag('version_from', ver.version, (line_num==2), :id => "cbto-#{line_num}") if show_diff && (line_num > 1) %></td> | |
24 | <td class="updated_on"><%= format_time(ver.updated_on) %></td> |
|
26 | <td class="updated_on"><%= format_time(ver.updated_on) %></td> | |
25 | <td class="author"><%= link_to_user ver.author %></td> |
|
27 | <td class="author"><%= link_to_user ver.author %></td> | |
26 | <td class="comments"><%=h ver.comments %></td> |
|
28 | <td class="comments"><%=h ver.comments %></td> | |
27 | <td class="buttons"><%= link_to l(:button_annotate), :action => 'annotate', :id => @page.title, :version => ver.version %></td> |
|
29 | <td class="buttons"><%= link_to l(:button_annotate), :action => 'annotate', :id => @page.title, :version => ver.version %></td> | |
28 | </tr> |
|
30 | </tr> | |
29 | <% line_num += 1 %> |
|
31 | <% line_num += 1 %> | |
30 | <% end %> |
|
32 | <% end %> | |
31 | </tbody> |
|
33 | </tbody> | |
32 | </table> |
|
34 | </table> | |
33 | <%= submit_tag l(:label_view_diff), :class => 'small' if show_diff %> |
|
35 | <%= submit_tag l(:label_view_diff), :class => 'small' if show_diff %> | |
34 | <span class="pagination"><%= pagination_links_full @version_pages, @version_count, :page_param => :p %></span> |
|
36 | <span class="pagination"><%= pagination_links_full @version_pages, @version_count, :page_param => :p %></span> | |
35 | <% end %> |
|
37 | <% end %> |
@@ -1,12 +1,14 | |||||
1 | <h2><%= l(:button_rename) %>: <%= @original_title %></h2> |
|
1 | <%= wiki_page_breadcrumb(@page) %> | |
|
2 | ||||
|
3 | <h2><%=h @original_title %></h2> | |||
2 |
|
4 | |||
3 | <%= error_messages_for 'page' %> |
|
5 | <%= error_messages_for 'page' %> | |
4 |
|
6 | |||
5 | <% labelled_tabular_form_for :wiki_page, @page, :url => { :action => 'rename' } do |f| %> |
|
7 | <% labelled_tabular_form_for :wiki_page, @page, :url => { :action => 'rename' } do |f| %> | |
6 | <div class="box"> |
|
8 | <div class="box"> | |
7 | <p><%= f.text_field :title, :required => true, :size => 100 %></p> |
|
9 | <p><%= f.text_field :title, :required => true, :size => 100 %></p> | |
8 | <p><%= f.check_box :redirect_existing_links %></p> |
|
10 | <p><%= f.check_box :redirect_existing_links %></p> | |
9 | <p><%= f.select :parent_id, "<option value=''></option>" + wiki_page_options_for_select(@wiki.pages.all(:include => :parent) - @page.self_and_descendants, @page.parent), :label => :field_parent_title %></p> |
|
11 | <p><%= f.select :parent_id, "<option value=''></option>" + wiki_page_options_for_select(@wiki.pages.all(:include => :parent) - @page.self_and_descendants, @page.parent), :label => :field_parent_title %></p> | |
10 | </div> |
|
12 | </div> | |
11 | <%= submit_tag l(:button_rename) %> |
|
13 | <%= submit_tag l(:button_rename) %> | |
12 | <% end %> |
|
14 | <% end %> |
@@ -1,61 +1,61 | |||||
1 | <div class="contextual"> |
|
1 | <div class="contextual"> | |
2 | <% if @editable %> |
|
2 | <% if @editable %> | |
3 | <%= link_to_if_authorized(l(:button_edit), {:action => 'edit', :id => @page.title}, :class => 'icon icon-edit', :accesskey => accesskey(:edit)) if @content.version == @page.content.version %> |
|
3 | <%= link_to_if_authorized(l(:button_edit), {:action => 'edit', :id => @page.title}, :class => 'icon icon-edit', :accesskey => accesskey(:edit)) if @content.version == @page.content.version %> | |
4 | <%= watcher_tag(@page, User.current) %> |
|
4 | <%= watcher_tag(@page, User.current) %> | |
5 | <%= link_to_if_authorized(l(:button_lock), {:action => 'protect', :id => @page.title, :protected => 1}, :method => :post, :class => 'icon icon-lock') if !@page.protected? %> |
|
5 | <%= link_to_if_authorized(l(:button_lock), {:action => 'protect', :id => @page.title, :protected => 1}, :method => :post, :class => 'icon icon-lock') if !@page.protected? %> | |
6 | <%= link_to_if_authorized(l(:button_unlock), {:action => 'protect', :id => @page.title, :protected => 0}, :method => :post, :class => 'icon icon-unlock') if @page.protected? %> |
|
6 | <%= link_to_if_authorized(l(:button_unlock), {:action => 'protect', :id => @page.title, :protected => 0}, :method => :post, :class => 'icon icon-unlock') if @page.protected? %> | |
7 | <%= link_to_if_authorized(l(:button_rename), {:action => 'rename', :id => @page.title}, :class => 'icon icon-move') if @content.version == @page.content.version %> |
|
7 | <%= link_to_if_authorized(l(:button_rename), {:action => 'rename', :id => @page.title}, :class => 'icon icon-move') if @content.version == @page.content.version %> | |
8 | <%= link_to_if_authorized(l(:button_delete), {:action => 'destroy', :id => @page.title}, :method => :delete, :confirm => l(:text_are_you_sure), :class => 'icon icon-del') %> |
|
8 | <%= link_to_if_authorized(l(:button_delete), {:action => 'destroy', :id => @page.title}, :method => :delete, :confirm => l(:text_are_you_sure), :class => 'icon icon-del') %> | |
9 | <%= link_to_if_authorized(l(:button_rollback), {:action => 'edit', :id => @page.title, :version => @content.version }, :class => 'icon icon-cancel') if @content.version < @page.content.version %> |
|
9 | <%= link_to_if_authorized(l(:button_rollback), {:action => 'edit', :id => @page.title, :version => @content.version }, :class => 'icon icon-cancel') if @content.version < @page.content.version %> | |
10 | <% end %> |
|
10 | <% end %> | |
11 | <%= link_to_if_authorized(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %> |
|
11 | <%= link_to_if_authorized(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %> | |
12 | </div> |
|
12 | </div> | |
13 |
|
13 | |||
14 | <%= breadcrumb(@page.ancestors.reverse.collect {|parent| link_to h(parent.pretty_title), {:id => parent.title, :project_id => parent.project}}) %> |
|
14 | <%= wiki_page_breadcrumb(@page) %> | |
15 |
|
15 | |||
16 | <% if @content.version != @page.content.version %> |
|
16 | <% if @content.version != @page.content.version %> | |
17 | <p> |
|
17 | <p> | |
18 | <%= link_to(('« ' + l(:label_previous)), :action => 'show', :id => @page.title, :project_id => @page.project, :version => (@content.version - 1)) + " - " if @content.version > 1 %> |
|
18 | <%= link_to(('« ' + l(:label_previous)), :action => 'show', :id => @page.title, :project_id => @page.project, :version => (@content.version - 1)) + " - " if @content.version > 1 %> | |
19 | <%= "#{l(:label_version)} #{@content.version}/#{@page.content.version}" %> |
|
19 | <%= "#{l(:label_version)} #{@content.version}/#{@page.content.version}" %> | |
20 | <%= '(' + link_to('diff', :controller => 'wiki', :action => 'diff', :id => @page.title, :project_id => @page.project, :version => @content.version) + ')' if @content.version > 1 %> - |
|
20 | <%= '(' + link_to('diff', :controller => 'wiki', :action => 'diff', :id => @page.title, :project_id => @page.project, :version => @content.version) + ')' if @content.version > 1 %> - | |
21 | <%= link_to((l(:label_next) + ' »'), :action => 'show', :id => @page.title, :project_id => @page.project, :version => (@content.version + 1)) + " - " if @content.version < @page.content.version %> |
|
21 | <%= link_to((l(:label_next) + ' »'), :action => 'show', :id => @page.title, :project_id => @page.project, :version => (@content.version + 1)) + " - " if @content.version < @page.content.version %> | |
22 | <%= link_to(l(:label_current_version), :action => 'show', :id => @page.title, :project_id => @page.project) %> |
|
22 | <%= link_to(l(:label_current_version), :action => 'show', :id => @page.title, :project_id => @page.project) %> | |
23 | <br /> |
|
23 | <br /> | |
24 | <em><%= @content.author ? @content.author.name : "anonyme" %>, <%= format_time(@content.updated_on) %> </em><br /> |
|
24 | <em><%= @content.author ? @content.author.name : "anonyme" %>, <%= format_time(@content.updated_on) %> </em><br /> | |
25 | <%=h @content.comments %> |
|
25 | <%=h @content.comments %> | |
26 | </p> |
|
26 | </p> | |
27 | <hr /> |
|
27 | <hr /> | |
28 | <% end %> |
|
28 | <% end %> | |
29 |
|
29 | |||
30 | <%= render(:partial => "wiki/content", :locals => {:content => @content}) %> |
|
30 | <%= render(:partial => "wiki/content", :locals => {:content => @content}) %> | |
31 |
|
31 | |||
32 | <%= link_to_attachments @page %> |
|
32 | <%= link_to_attachments @page %> | |
33 |
|
33 | |||
34 | <% if @editable && authorize_for('wiki', 'add_attachment') %> |
|
34 | <% if @editable && authorize_for('wiki', 'add_attachment') %> | |
35 | <div id="wiki_add_attachment"> |
|
35 | <div id="wiki_add_attachment"> | |
36 | <p><%= link_to l(:label_attachment_new), {}, :onclick => "Element.show('add_attachment_form'); Element.hide(this); Element.scrollTo('add_attachment_form'); return false;", |
|
36 | <p><%= link_to l(:label_attachment_new), {}, :onclick => "Element.show('add_attachment_form'); Element.hide(this); Element.scrollTo('add_attachment_form'); return false;", | |
37 | :id => 'attach_files_link' %></p> |
|
37 | :id => 'attach_files_link' %></p> | |
38 | <% form_tag({ :controller => 'wiki', :action => 'add_attachment', :project_id => @project, :id => @page.title }, :multipart => true, :id => "add_attachment_form", :style => "display:none;") do %> |
|
38 | <% form_tag({ :controller => 'wiki', :action => 'add_attachment', :project_id => @project, :id => @page.title }, :multipart => true, :id => "add_attachment_form", :style => "display:none;") do %> | |
39 | <div class="box"> |
|
39 | <div class="box"> | |
40 | <p><%= render :partial => 'attachments/form' %></p> |
|
40 | <p><%= render :partial => 'attachments/form' %></p> | |
41 | </div> |
|
41 | </div> | |
42 | <%= submit_tag l(:button_add) %> |
|
42 | <%= submit_tag l(:button_add) %> | |
43 | <%= link_to l(:button_cancel), {}, :onclick => "Element.hide('add_attachment_form'); Element.show('attach_files_link'); return false;" %> |
|
43 | <%= link_to l(:button_cancel), {}, :onclick => "Element.hide('add_attachment_form'); Element.show('attach_files_link'); return false;" %> | |
44 | <% end %> |
|
44 | <% end %> | |
45 | </div> |
|
45 | </div> | |
46 | <% end %> |
|
46 | <% end %> | |
47 |
|
47 | |||
48 | <% other_formats_links do |f| %> |
|
48 | <% other_formats_links do |f| %> | |
49 | <%= f.link_to 'HTML', :url => {:id => @page.title, :version => @content.version} %> |
|
49 | <%= f.link_to 'HTML', :url => {:id => @page.title, :version => @content.version} %> | |
50 | <%= f.link_to 'TXT', :url => {:id => @page.title, :version => @content.version} %> |
|
50 | <%= f.link_to 'TXT', :url => {:id => @page.title, :version => @content.version} %> | |
51 | <% end if User.current.allowed_to?(:export_wiki_pages, @project) %> |
|
51 | <% end if User.current.allowed_to?(:export_wiki_pages, @project) %> | |
52 |
|
52 | |||
53 | <% content_for :header_tags do %> |
|
53 | <% content_for :header_tags do %> | |
54 | <%= stylesheet_link_tag 'scm' %> |
|
54 | <%= stylesheet_link_tag 'scm' %> | |
55 | <% end %> |
|
55 | <% end %> | |
56 |
|
56 | |||
57 | <% content_for :sidebar do %> |
|
57 | <% content_for :sidebar do %> | |
58 | <%= render :partial => 'sidebar' %> |
|
58 | <%= render :partial => 'sidebar' %> | |
59 | <% end %> |
|
59 | <% end %> | |
60 |
|
60 | |||
61 | <% html_title @page.pretty_title %> |
|
61 | <% html_title @page.pretty_title %> |
General Comments 0
You need to be logged in to leave comments.
Login now