Redmine 3.4.4
This commit is contained in:
commit
64924a6376
2112 changed files with 259028 additions and 0 deletions
4
app/views/wiki/_content.html.erb
Normal file
4
app/views/wiki/_content.html.erb
Normal file
|
@ -0,0 +1,4 @@
|
|||
<div class="wiki wiki-page">
|
||||
<%= textilizable content, :text, :attachments => content.page.attachments,
|
||||
:edit_section_links => (@sections_editable && {:controller => 'wiki', :action => 'edit', :project_id => @page.project, :id => @page.title}) %>
|
||||
</div>
|
21
app/views/wiki/_new_modal.html.erb
Normal file
21
app/views/wiki/_new_modal.html.erb
Normal file
|
@ -0,0 +1,21 @@
|
|||
<h3 class="title"><%=l(:label_wiki_page_new)%></h3>
|
||||
|
||||
<%= labelled_form_for :page, @page,
|
||||
:url => new_project_wiki_page_path(@project),
|
||||
:method => 'post',
|
||||
:remote => true do |f| %>
|
||||
|
||||
<%= render_error_messages @page.errors.full_messages_for(:title) %>
|
||||
|
||||
<div class="box tabular">
|
||||
<p>
|
||||
<%= f.text_field :title, :name => 'title', :size => 60, :required => true %>
|
||||
<em class="info"><%= l(:text_unallowed_characters) %>: , . / ? ; : |</em>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<p class="buttons">
|
||||
<%= submit_tag l(:label_next), :name => nil %>
|
||||
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %>
|
||||
</p>
|
||||
<% end %>
|
14
app/views/wiki/_sidebar.html.erb
Normal file
14
app/views/wiki/_sidebar.html.erb
Normal file
|
@ -0,0 +1,14 @@
|
|||
<% if @wiki && @wiki.sidebar -%>
|
||||
<div class="wiki">
|
||||
<%= textilizable @wiki.sidebar.content, :text %>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
||||
<h3><%= l(:label_wiki) %></h3>
|
||||
<ul>
|
||||
<li><%= link_to(l(:field_start_page), {:action => 'show', :id => nil}) %></li>
|
||||
<li><%= link_to(l(:label_index_by_title), {:action => 'index'}) %></li>
|
||||
<li><%= link_to(l(:label_index_by_date),
|
||||
{:controller => 'wiki', :project_id => @project,
|
||||
:action => 'date_index'}) %></li>
|
||||
</ul>
|
40
app/views/wiki/annotate.html.erb
Normal file
40
app/views/wiki/annotate.html.erb
Normal file
|
@ -0,0 +1,40 @@
|
|||
<div class="contextual">
|
||||
<%= link_to(l(:button_edit), {:action => 'edit', :id => @page.title}, :class => 'icon icon-edit') %>
|
||||
<%= link_to(l(:label_history),
|
||||
{:action => 'history', :id => @page.title}, :class => 'icon icon-history') %>
|
||||
</div>
|
||||
|
||||
<%= wiki_page_breadcrumb(@page) %>
|
||||
|
||||
<%= title [@page.pretty_title, project_wiki_page_path(@page.project, @page.title, :version => nil)],
|
||||
[l(:label_history), history_project_wiki_page_path(@page.project, @page.title)],
|
||||
"#{l(:label_version)} #{@annotate.content.version}" %>
|
||||
|
||||
<p>
|
||||
<em><%= @annotate.content.author ? link_to_user(@annotate.content.author) : l(:label_user_anonymous)
|
||||
%>, <%= format_time(@annotate.content.updated_on) %> </em><br />
|
||||
<%= @annotate.content.comments %>
|
||||
</p>
|
||||
|
||||
<% colors = Hash.new {|k,v| k[v] = (k.size % 12) } %>
|
||||
|
||||
<table class="filecontent annotate">
|
||||
<tbody>
|
||||
<% line_num = 1 %>
|
||||
<% @annotate.lines.each do |line| -%>
|
||||
<tr class="bloc-<%= colors[line[0]] %>">
|
||||
<th class="line-num"><%= line_num %></th>
|
||||
<td class="revision"><%= link_to line[0], :controller => 'wiki',
|
||||
:action => 'show', :project_id => @project,
|
||||
:id => @page.title, :version => line[0] %></td>
|
||||
<td class="author"><%= line[1] %></td>
|
||||
<td class="line-code"><pre><%= line[2] %></pre></td>
|
||||
</tr>
|
||||
<% line_num += 1 %>
|
||||
<% end -%>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= stylesheet_link_tag 'scm' %>
|
||||
<% end %>
|
39
app/views/wiki/date_index.html.erb
Normal file
39
app/views/wiki/date_index.html.erb
Normal file
|
@ -0,0 +1,39 @@
|
|||
<div class="contextual">
|
||||
<% if User.current.allowed_to?(:edit_wiki_pages, @project) %>
|
||||
<%= link_to l(:label_wiki_page_new), new_project_wiki_page_path(@project), :remote => true, :class => 'icon icon-add' %>
|
||||
<% end %>
|
||||
<%= watcher_link(@wiki, User.current) %>
|
||||
</div>
|
||||
|
||||
<h2><%= l(:label_index_by_date) %></h2>
|
||||
|
||||
<% if @pages.empty? %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
|
||||
<% @pages_by_date.keys.sort.reverse.each do |date| %>
|
||||
<h3><%= format_date(date) %></h3>
|
||||
<ul>
|
||||
<% @pages_by_date[date].each do |page| %>
|
||||
<li><%= link_to page.pretty_title, :action => 'show', :id => page.title, :project_id => page.project %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<%= render :partial => 'sidebar' %>
|
||||
<% end %>
|
||||
|
||||
<% unless @pages.empty? %>
|
||||
<% other_formats_links do |f| %>
|
||||
<%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'index', :id => @project, :show_wiki_edits => 1, :key => User.current.rss_key} %>
|
||||
<% if User.current.allowed_to?(:export_wiki_pages, @project) %>
|
||||
<%= f.link_to('PDF', :url => {:action => 'export', :format => 'pdf'}) %>
|
||||
<%= f.link_to('HTML', :url => {:action => 'export'}) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= auto_discovery_link_tag(:atom, :controller => 'activities', :action => 'index', :id => @project, :show_wiki_edits => 1, :format => 'atom', :key => User.current.rss_key) %>
|
||||
<% end %>
|
22
app/views/wiki/destroy.html.erb
Normal file
22
app/views/wiki/destroy.html.erb
Normal file
|
@ -0,0 +1,22 @@
|
|||
<%= wiki_page_breadcrumb(@page) %>
|
||||
|
||||
<h2><%= @page.pretty_title %></h2>
|
||||
|
||||
<%= form_tag({}, :method => :delete) do %>
|
||||
<div class="box">
|
||||
<p><strong><%= l(:text_wiki_page_destroy_question, :descendants => @descendants_count) %></strong></p>
|
||||
<p><label><%= radio_button_tag 'todo', 'nullify', true %> <%= l(:text_wiki_page_nullify_children) %></label><br />
|
||||
<label><%= radio_button_tag 'todo', 'destroy', false %> <%= l(:text_wiki_page_destroy_children) %></label>
|
||||
<% if @reassignable_to.any? %>
|
||||
<br />
|
||||
<label><%= radio_button_tag 'todo', 'reassign', false %> <%= l(:text_wiki_page_reassign_children) %></label>:
|
||||
<%= label_tag "reassign_to_id", l(:description_wiki_subpages_reassign), :class => "hidden-for-sighted" %>
|
||||
<%= select_tag 'reassign_to_id', wiki_page_options_for_select(@reassignable_to),
|
||||
:onclick => "$('#todo_reassign').prop('checked', true);" %>
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<%= submit_tag l(:button_apply) %>
|
||||
<%= link_to l(:button_cancel), :controller => 'wiki', :action => 'show', :project_id => @project, :id => @page.title %>
|
||||
<% end %>
|
29
app/views/wiki/diff.html.erb
Normal file
29
app/views/wiki/diff.html.erb
Normal file
|
@ -0,0 +1,29 @@
|
|||
<div class="contextual">
|
||||
<%= link_to(l(:label_history), {:action => 'history', :id => @page.title},
|
||||
:class => 'icon icon-history') %>
|
||||
</div>
|
||||
|
||||
<%= wiki_page_breadcrumb(@page) %>
|
||||
|
||||
<%= title [@page.pretty_title, project_wiki_page_path(@page.project, @page.title, :version => nil)],
|
||||
[l(:label_history), history_project_wiki_page_path(@page.project, @page.title)],
|
||||
"#{l(:label_version)} #{@diff.content_to.version}" %>
|
||||
|
||||
<p>
|
||||
<%= l(:label_version) %> <%= link_to @diff.content_from.version, :action => 'show', :id => @page.title, :project_id => @page.project, :version => @diff.content_from.version %>
|
||||
<em>(<%= @diff.content_from.author ?
|
||||
@diff.content_from.author.name : l(:label_user_anonymous)
|
||||
%>, <%= format_time(@diff.content_from.updated_on) %>)</em>
|
||||
→
|
||||
<%= 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 %>
|
||||
<em>(<%= @diff.content_to.author ?
|
||||
link_to_user(@diff.content_to.author.name) : l(:label_user_anonymous)
|
||||
%>, <%= format_time(@diff.content_to.updated_on) %>)</em>
|
||||
</p>
|
||||
|
||||
<div class="text-diff">
|
||||
<%= simple_format_without_paragraph @diff.to_html %>
|
||||
</div>
|
50
app/views/wiki/edit.html.erb
Normal file
50
app/views/wiki/edit.html.erb
Normal file
|
@ -0,0 +1,50 @@
|
|||
<%= wiki_page_breadcrumb(@page) %>
|
||||
|
||||
<h2><%= @page.pretty_title %></h2>
|
||||
|
||||
<%= form_for @content, :as => :content,
|
||||
:url => {:action => 'update', :id => @page.title},
|
||||
:html => {:method => :put, :multipart => true, :id => 'wiki_form'} do |f| %>
|
||||
<%= f.hidden_field :version %>
|
||||
<% if @section %>
|
||||
<%= hidden_field_tag 'section', @section %>
|
||||
<%= hidden_field_tag 'section_hash', @section_hash %>
|
||||
<% end %>
|
||||
<%= error_messages_for 'content' %>
|
||||
|
||||
<div class="box tabular">
|
||||
<%= text_area_tag 'content[text]', @text, :cols => 100, :rows => 25,
|
||||
:class => 'wiki-edit', :accesskey => accesskey(:edit) %>
|
||||
|
||||
<% if @page.safe_attribute_names.include?('parent_id') && @wiki.pages.any? %>
|
||||
<%= fields_for @page do |fp| %>
|
||||
<p>
|
||||
<label><%= l(:field_parent_title) %></label>
|
||||
<%= fp.select :parent_id,
|
||||
content_tag('option', '', :value => '') +
|
||||
wiki_page_options_for_select(
|
||||
@wiki.pages.includes(:parent).to_a -
|
||||
@page.self_and_descendants, @page.parent) %>
|
||||
</p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<p><label><%= l(:field_comments) %></label><%= f.text_field :comments, :size => 120, :maxlength => 1024 %></p>
|
||||
<p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<%= preview_link({:controller => 'wiki', :action => 'preview', :project_id => @project, :id => @page.title }, 'wiki_form') %>
|
||||
| <%= link_to l(:button_cancel), wiki_page_edit_cancel_path(@page) %>
|
||||
</p>
|
||||
<%= wikitoolbar_for 'content_text' %>
|
||||
<% end %>
|
||||
|
||||
<div id="preview" class="wiki"></div>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= robot_exclusion_tag %>
|
||||
<% end %>
|
||||
|
||||
<% html_title @page.pretty_title %>
|
21
app/views/wiki/export.html.erb
Normal file
21
app/views/wiki/export.html.erb
Normal file
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title><%= @page.pretty_title %></title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<style>
|
||||
body { font:80% Verdana,Tahoma,Arial,sans-serif; }
|
||||
h1, h2, h3, h4 { font-family: "Trebuchet MS",Georgia,"Times New Roman",serif; }
|
||||
ul.toc { padding: 4px; margin-left: 0; }
|
||||
ul.toc li { list-style-type:none; }
|
||||
ul.toc li.heading2 { margin-left: 1em; }
|
||||
ul.toc li.heading3 { margin-left: 2em; }
|
||||
a.wiki-anchor { display: none; margin-left: 6px; text-decoration: none; }
|
||||
a.wiki-anchor:hover { color: #aaa !important; text-decoration: none; }
|
||||
h1:hover a.wiki-anchor, h2:hover a.wiki-anchor, h3:hover a.wiki-anchor { display: inline; color: #ddd; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<%= textilizable @content, :text, :wiki_links => :local %>
|
||||
</body>
|
||||
</html>
|
1
app/views/wiki/export.pdf.erb
Normal file
1
app/views/wiki/export.pdf.erb
Normal file
|
@ -0,0 +1 @@
|
|||
<%= raw wiki_pages_to_pdf(@pages, @project) %>
|
34
app/views/wiki/export_multiple.html.erb
Normal file
34
app/views/wiki/export_multiple.html.erb
Normal file
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title><%= @wiki.project.name %></title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<style>
|
||||
body { font:80% Verdana,Tahoma,Arial,sans-serif; }
|
||||
h1, h2, h3, h4 { font-family: "Trebuchet MS",Georgia,"Times New Roman",serif; }
|
||||
ul.toc { padding: 4px; margin-left: 0; }
|
||||
ul.toc li { list-style-type:none; }
|
||||
ul.toc li.heading2 { margin-left: 1em; }
|
||||
ul.toc li.heading3 { margin-left: 2em; }
|
||||
a.wiki-anchor { display: none; margin-left: 6px; text-decoration: none; }
|
||||
a.wiki-anchor:hover { color: #aaa !important; text-decoration: none; }
|
||||
h1:hover a.wiki-anchor, h2:hover a.wiki-anchor, h3:hover a.wiki-anchor { display: inline; color: #ddd; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<strong><%= l(:label_index_by_title) %></strong>
|
||||
<ul>
|
||||
<% @pages.each do |page| %>
|
||||
<li><a href="#<%= page.title %>"><%= page.pretty_title %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<% @pages.each do |page| %>
|
||||
<hr />
|
||||
<a name="<%= page.title %>" />
|
||||
<%= textilizable page.content ,:text, :wiki_links => :anchor %>
|
||||
<% end %>
|
||||
|
||||
</body>
|
||||
</html>
|
40
app/views/wiki/history.html.erb
Normal file
40
app/views/wiki/history.html.erb
Normal file
|
@ -0,0 +1,40 @@
|
|||
<%= wiki_page_breadcrumb(@page) %>
|
||||
|
||||
<%= title [@page.pretty_title, project_wiki_page_path(@page.project, @page.title, :version => nil)], l(:label_history) %>
|
||||
|
||||
<%= form_tag({:controller => 'wiki', :action => 'diff',
|
||||
:project_id => @page.project, :id => @page.title},
|
||||
:method => :get) do %>
|
||||
<table class="list wiki-page-versions">
|
||||
<thead><tr>
|
||||
<th>#</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th><%= l(:field_updated_on) %></th>
|
||||
<th><%= l(:field_author) %></th>
|
||||
<th><%= l(:field_comments) %></th>
|
||||
<th></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<% show_diff = @versions.size > 1 %>
|
||||
<% line_num = 1 %>
|
||||
<% @versions.each do |ver| %>
|
||||
<tr class="wiki-page-version">
|
||||
<td class="id"><%= link_to ver.version, :action => 'show', :id => @page.title, :project_id => @page.project, :version => ver.version %></td>
|
||||
<td class="checkbox"><%= radio_button_tag('version', ver.version, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('#cbto-#{line_num+1}').prop('checked', true);") if show_diff && (line_num < @versions.size) %></td>
|
||||
<td class="checkbox"><%= radio_button_tag('version_from', ver.version, (line_num==2), :id => "cbto-#{line_num}") if show_diff && (line_num > 1) %></td>
|
||||
<td class="updated_on"><%= format_time(ver.updated_on) %></td>
|
||||
<td class="author"><%= link_to_user ver.author %></td>
|
||||
<td class="comments"><%= ver.comments %></td>
|
||||
<td class="buttons">
|
||||
<%= 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 %>
|
||||
</td>
|
||||
</tr>
|
||||
<% line_num += 1 %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= submit_tag l(:label_view_diff), :class => 'small' if show_diff %>
|
||||
<span class="pagination"><%= pagination_links_full @version_pages, @version_count %></span>
|
||||
<% end %>
|
13
app/views/wiki/index.api.rsb
Normal file
13
app/views/wiki/index.api.rsb
Normal file
|
@ -0,0 +1,13 @@
|
|||
api.array :wiki_pages do
|
||||
@pages.each do |page|
|
||||
api.wiki_page do
|
||||
api.title page.title
|
||||
if page.parent
|
||||
api.parent :title => page.parent.title
|
||||
end
|
||||
api.version page.version
|
||||
api.created_on page.created_on
|
||||
api.updated_on page.updated_on
|
||||
end
|
||||
end
|
||||
end
|
38
app/views/wiki/index.html.erb
Normal file
38
app/views/wiki/index.html.erb
Normal file
|
@ -0,0 +1,38 @@
|
|||
<div class="contextual">
|
||||
<% if User.current.allowed_to?(:edit_wiki_pages, @project) %>
|
||||
<%= link_to l(:label_wiki_page_new), new_project_wiki_page_path(@project), :remote => true, :class => 'icon icon-add' %>
|
||||
<% end %>
|
||||
<%= watcher_link(@wiki, User.current) %>
|
||||
</div>
|
||||
|
||||
<h2><%= l(:label_index_by_title) %></h2>
|
||||
|
||||
<% if @pages.empty? %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
|
||||
<%= render_page_hierarchy(@pages_by_parent_id, nil, :timestamp => true) %>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<%= render :partial => 'sidebar' %>
|
||||
<% end %>
|
||||
|
||||
<% unless @pages.empty? %>
|
||||
<% other_formats_links do |f| %>
|
||||
<%= f.link_to 'Atom',
|
||||
:url => {:controller => 'activities', :action => 'index',
|
||||
:id => @project, :show_wiki_edits => 1,
|
||||
:key => User.current.rss_key} %>
|
||||
<% if User.current.allowed_to?(:export_wiki_pages, @project) %>
|
||||
<%= f.link_to('PDF', :url => {:action => 'export', :format => 'pdf'}) %>
|
||||
<%= f.link_to('HTML', :url => {:action => 'export'}) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= auto_discovery_link_tag(
|
||||
:atom, :controller => 'activities', :action => 'index',
|
||||
:id => @project, :show_wiki_edits => 1, :format => 'atom',
|
||||
:key => User.current.rss_key) %>
|
||||
<% end %>
|
17
app/views/wiki/new.html.erb
Normal file
17
app/views/wiki/new.html.erb
Normal file
|
@ -0,0 +1,17 @@
|
|||
<%= title l(:label_wiki_page_new) %>
|
||||
|
||||
<%= labelled_form_for :page, @page,
|
||||
:url => new_project_wiki_page_path(@project) do |f| %>
|
||||
|
||||
<%= render_error_messages @page.errors.full_messages_for(:title) %>
|
||||
|
||||
<div class="box tabular">
|
||||
<p>
|
||||
<%= f.text_field :title, :name => 'title', :size => 60, :required => true %>
|
||||
<em class="info"><%= l(:text_unallowed_characters) %>: , . / ? ; : |</em>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<%= submit_tag(l(:label_next)) %>
|
||||
|
||||
<% end %>
|
2
app/views/wiki/new.js.erb
Normal file
2
app/views/wiki/new.js.erb
Normal file
|
@ -0,0 +1,2 @@
|
|||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'wiki/new_modal') %>');
|
||||
showModal('ajax-modal', '600px');
|
26
app/views/wiki/rename.html.erb
Normal file
26
app/views/wiki/rename.html.erb
Normal file
|
@ -0,0 +1,26 @@
|
|||
<%= 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>
|
||||
<p><%= f.check_box :redirect_existing_links %></p>
|
||||
<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>
|
||||
|
||||
<% if @page.safe_attribute? 'wiki_id' %>
|
||||
<p><%= f.select :wiki_id, wiki_page_wiki_options_for_select(@page), :label => :label_project %></p>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<%= submit_tag l(:button_rename) %>
|
||||
<% end %>
|
18
app/views/wiki/show.api.rsb
Normal file
18
app/views/wiki/show.api.rsb
Normal file
|
@ -0,0 +1,18 @@
|
|||
api.wiki_page do
|
||||
api.title @page.title
|
||||
if @page.parent
|
||||
api.parent :title => @page.parent.title
|
||||
end
|
||||
api.text @content.text
|
||||
api.version @content.version
|
||||
api.author(:id => @content.author_id, :name => @content.author.name)
|
||||
api.comments @content.comments
|
||||
api.created_on @page.created_on
|
||||
api.updated_on @content.updated_on
|
||||
|
||||
api.array :attachments do
|
||||
@page.attachments.each do |attachment|
|
||||
render_api_attachment(attachment, api)
|
||||
end
|
||||
end if include_in_api_response?('attachments')
|
||||
end
|
80
app/views/wiki/show.html.erb
Normal file
80
app/views/wiki/show.html.erb
Normal file
|
@ -0,0 +1,80 @@
|
|||
<div class="contextual">
|
||||
<% if User.current.allowed_to?(:edit_wiki_pages, @project) %>
|
||||
<%= link_to l(:label_wiki_page_new), new_project_wiki_page_path(@project), :remote => true, :class => 'icon icon-add' %>
|
||||
<% end %>
|
||||
<% if @editable %>
|
||||
<% if @content.current_version? %>
|
||||
<%= link_to_if_authorized(l(:button_edit), {:action => 'edit', :id => @page.title}, :class => 'icon icon-edit', :accesskey => accesskey(:edit)) %>
|
||||
<%= watcher_link(@page, User.current) %>
|
||||
<%= link_to_if_authorized(l(:button_lock), {:action => 'protect', :id => @page.title, :protected => 1}, :method => :post, :class => 'icon icon-lock') if !@page.protected? %>
|
||||
<%= link_to_if_authorized(l(:button_unlock), {:action => 'protect', :id => @page.title, :protected => 0}, :method => :post, :class => 'icon icon-unlock') if @page.protected? %>
|
||||
<%= link_to_if_authorized(l(:button_rename), {:action => 'rename', :id => @page.title}, :class => 'icon icon-move') %>
|
||||
<%= link_to_if_authorized(l(:button_delete), {:action => 'destroy', :id => @page.title}, :method => :delete, :data => {:confirm => l(:text_are_you_sure)}, :class => 'icon icon-del') %>
|
||||
<% else %>
|
||||
<%= link_to_if_authorized(l(:button_rollback), {:action => 'edit', :id => @page.title, :version => @content.version }, :class => 'icon icon-cancel') %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= link_to_if_authorized(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %>
|
||||
</div>
|
||||
|
||||
<%= wiki_page_breadcrumb(@page) %>
|
||||
|
||||
<% unless @content.current_version? %>
|
||||
<%= title [@page.pretty_title, project_wiki_page_path(@page.project, @page.title, :version => nil)],
|
||||
[l(:label_history), history_project_wiki_page_path(@page.project, @page.title)],
|
||||
"#{l(:label_version)} #{@content.version}" %>
|
||||
|
||||
<p>
|
||||
<%= 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) %>
|
||||
<br />
|
||||
<em><%= @content.author ? link_to_user(@content.author) : l(:label_user_anonymous)
|
||||
%>, <%= format_time(@content.updated_on) %> </em><br />
|
||||
<%= @content.comments %>
|
||||
</p>
|
||||
<hr />
|
||||
<% end %>
|
||||
|
||||
<%= render(:partial => "wiki/content", :locals => {:content => @content}) %>
|
||||
|
||||
<fieldset class="collapsible collapsed">
|
||||
<legend onclick="toggleFieldset(this);"><%= l(:label_attachment_plural) %></legend>
|
||||
<div style="display: none;">
|
||||
|
||||
<%= link_to_attachments @page, :thumbnails => true %>
|
||||
|
||||
<% if @editable && authorize_for('wiki', 'add_attachment') %>
|
||||
<div id="wiki_add_attachment">
|
||||
<%= form_tag({:controller => 'wiki', :action => 'add_attachment',
|
||||
:project_id => @project, :id => @page.title},
|
||||
:multipart => true, :id => "add_attachment_form") do %>
|
||||
<div class="box">
|
||||
<p><%= render :partial => 'attachments/form' %></p>
|
||||
</div>
|
||||
<%= submit_tag l(:button_add) %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<% other_formats_links do |f| %>
|
||||
<%= f.link_to 'PDF', :url => {:id => @page.title, :version => params[:version]} %>
|
||||
<%= f.link_to 'HTML', :url => {:id => @page.title, :version => params[:version]} %>
|
||||
<%= f.link_to 'TXT', :url => {:id => @page.title, :version => params[:version]} %>
|
||||
<% end if User.current.allowed_to?(:export_wiki_pages, @project) %>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<%= render :partial => 'sidebar' %>
|
||||
<% end %>
|
||||
|
||||
<% html_title @page.pretty_title %>
|
1
app/views/wiki/show.pdf.erb
Normal file
1
app/views/wiki/show.pdf.erb
Normal file
|
@ -0,0 +1 @@
|
|||
<%= raw wiki_page_to_pdf(@page, @project) %>
|
Loading…
Add table
Add a link
Reference in a new issue