Revision 912:5e80956cc792 app/views/wiki

View differences:

app/views/wiki/_content.html.erb
1
<div class="wiki wiki-page">
2
  <%= textilizable content, :text, :attachments => content.page.attachments,
3
        :edit_section_links => (@sections_editable && {:controller => 'wiki', :action => 'edit', :project_id => @page.project, :id => @page.title}) %>
4
</div>
app/views/wiki/_content.rhtml
1
<div class="wiki">
2
  <%= textilizable content, :text, :attachments => content.page.attachments %>
3
</div>
app/views/wiki/_sidebar.html.erb
1
<% if @wiki && @wiki.sidebar -%>
2
  <%= textilizable @wiki.sidebar.content, :text %>
3
<% end -%>
4

  
5
<h3><%= l(:label_wiki) %></h3>
6

  
7
<%= link_to l(:field_start_page), {:action => 'show', :id => nil} %><br />
8
<%= link_to l(:label_index_by_title), {:action => 'index'} %><br />
9
<%= link_to l(:label_index_by_date), {:action => 'date_index'} %><br />
app/views/wiki/_sidebar.rhtml
1
<% if @wiki && @wiki.sidebar -%>
2
  <%= textilizable @wiki.sidebar.content, :text %>
3
<% end -%>
4

  
5
<h3><%= l(:label_wiki) %></h3>
6

  
7
<%= link_to l(:field_start_page), {:action => 'show', :id => nil} %><br />
8
<%= link_to l(:label_index_by_title), {:action => 'index'} %><br />
9
<%= link_to l(:label_index_by_date), {:action => 'date_index'} %><br />
app/views/wiki/annotate.html.erb
1
<div class="contextual">
2
<%= link_to(l(:button_edit), {:action => 'edit', :id => @page.title}, :class => 'icon icon-edit') %>
3
<%= link_to(l(:label_history),
4
            {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %>
5
</div>
6

  
7
<%= wiki_page_breadcrumb(@page) %>
8

  
9
<h2><%=h @page.pretty_title %></h2>
10

  
11
<p>
12
<%= l(:label_version) %> <%= link_to h(@annotate.content.version),
13
                                     :action => 'show', :project_id => @project,
14
                                     :id => @page.title, :version => @annotate.content.version %>
15
<em>(<%= h(@annotate.content.author ?
16
             @annotate.content.author.name : l(:label_user_anonymous))
17
      %>, <%= format_time(@annotate.content.updated_on) %>)</em>
18
</p>
19

  
20
<% colors = Hash.new {|k,v| k[v] = (k.size % 12) } %>
21

  
22
<table class="filecontent annotate">
23
<tbody>
24
<% line_num = 1 %>
25
<% @annotate.lines.each do |line| -%>
26
<tr class="bloc-<%= colors[line[0]] %>">
27
    <th class="line-num"><%= line_num %></th>
28
    <td class="revision"><%= link_to line[0], :controller => 'wiki',
29
                             :action => 'show', :project_id => @project,
30
                             :id => @page.title, :version => line[0] %></td>
31
    <td class="author"><%= h(line[1]) %></td>
32
    <td class="line-code"><pre><%=h line[2] %></pre></td>
33
</tr>
34
<% line_num += 1 %>
35
<% end -%>
36
</tbody>
37
</table>
38

  
39
<% content_for :header_tags do %>
40
<%= stylesheet_link_tag 'scm' %>
41
<% end %>
app/views/wiki/annotate.rhtml
1
<div class="contextual">
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') %>
4
</div>
5

  
6
<h2><%= @page.pretty_title %></h2>
7

  
8
<p>
9
<%= 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>
11
</p>
12

  
13
<% colors = Hash.new {|k,v| k[v] = (k.size % 12) } %>
14

  
15
<table class="filecontent annotate">
16
<tbody>
17
<% line_num = 1 %>
18
<% @annotate.lines.each do |line| -%>
19
<tr class="bloc-<%= colors[line[0]] %>">
20
    <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>
22
    <td class="author"><%= h(line[1]) %></td>
23
    <td class="line-code"><pre><%=h line[2] %></pre></td>
24
</tr>
25
<% line_num += 1 %>
26
<% end -%>
27
</tbody>
28
</table>
29

  
30
<% content_for :header_tags do %>
31
<%= stylesheet_link_tag 'scm' %>
32
<% end %>
app/views/wiki/date_index.html.erb
12 12
<h3><%= format_date(date) %></h3>
13 13
<ul>
14 14
<% @pages_by_date[date].each do |page| %>
15
    <li><%= link_to page.pretty_title, :action => 'show', :id => page.title, :project_id => page.project %></li>
15
    <li><%= link_to h(page.pretty_title), :action => 'show', :id => page.title, :project_id => page.project %></li>
16 16
<% end %>
17 17
</ul>
18 18
<% end %>
......
23 23

  
24 24
<% unless @pages.empty? %>
25 25
<% other_formats_links do |f| %>
26
	<%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'index', :id => @project, :show_wiki_edits => 1, :key => User.current.rss_key} %>
27
	<%= f.link_to('HTML', :url => {:action => 'export'}) if User.current.allowed_to?(:export_wiki_pages, @project) %>
26
  <%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'index', :id => @project, :show_wiki_edits => 1, :key => User.current.rss_key} %>
27
  <%= f.link_to('HTML', :url => {:action => 'export'}) if User.current.allowed_to?(:export_wiki_pages, @project) %>
28 28
<% end %>
29 29
<% end %>
30 30

  
app/views/wiki/destroy.html.erb
1
<%= wiki_page_breadcrumb(@page) %>
2

  
3
<h2><%=h @page.pretty_title %></h2>
4

  
5
<% form_tag({}, :method => :delete) do %>
6
<div class="box">
7
<p><strong><%= l(:text_wiki_page_destroy_question, :descendants => @descendants_count) %></strong></p>
8
<p><label><%= radio_button_tag 'todo', 'nullify', true %> <%= l(:text_wiki_page_nullify_children) %></label><br />
9
<label><%= radio_button_tag 'todo', 'destroy', false %> <%= l(:text_wiki_page_destroy_children) %></label>
10
<% if @reassignable_to.any? %>
11
<br />
12
<label><%= radio_button_tag 'todo', 'reassign', false %> <%= l(:text_wiki_page_reassign_children) %></label>:
13
<%= label_tag "reassign_to_id", l(:description_wiki_subpages_reassign), :class => "hidden-for-sighted" %>
14
<%= select_tag 'reassign_to_id', wiki_page_options_for_select(@reassignable_to),
15
                                 :onclick => "$('todo_reassign').checked = true;" %>
16
<% end %>
17
</p>
18
</div>
19

  
20
<%= submit_tag l(:button_apply) %>
21
<%= link_to l(:button_cancel), :controller => 'wiki', :action => 'show', :project_id => @project, :id => @page.title %>
22
<% end %>
app/views/wiki/destroy.rhtml
1
<h2><%=h @page.pretty_title %></h2>
2

  
3
<% form_tag({}, :method => :delete) do %>
4
<div class="box">
5
<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 />
7
<label><%= radio_button_tag 'todo', 'destroy', false %> <%= l(:text_wiki_page_destroy_children) %></label>
8
<% if @reassignable_to.any? %>
9
<br />
10
<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),
12
																 :onclick => "$('todo_reassign').checked = true;" %>
13
<% end %>
14
</p>
15
</div>
16

  
17
<%= submit_tag l(:button_apply) %>
18
<%= link_to l(:button_cancel), :controller => 'wiki', :action => 'show', :project_id => @project, :id => @page.title %>
19
<% end %>
app/views/wiki/diff.html.erb
1
<div class="contextual">
2
<%= link_to(l(:label_history), {:action => 'history', :id => @page.title},
3
            :class => 'icon icon-history') %>
4
</div>
5

  
6
<%= wiki_page_breadcrumb(@page) %>
7

  
8
<h2><%= h(@page.pretty_title) %></h2>
9

  
10
<p>
11
<%= l(:label_version) %> <%= link_to @diff.content_from.version, :action => 'show', :id => @page.title, :project_id => @page.project, :version => @diff.content_from.version %>
12
<em>(<%= @diff.content_from.author ?
13
             @diff.content_from.author.name : l(:label_user_anonymous)
14
      %>, <%= format_time(@diff.content_from.updated_on) %>)</em>
15
&#8594;
16
<%= l(:label_version) %> <%= link_to @diff.content_to.version, :action => 'show',
17
                             :id => @page.title, :project_id => @page.project,
18
                             :version => @diff.content_to.version
19
                          %>/<%= @page.content.version %>
20
<em>(<%= @diff.content_to.author ?
21
             link_to_user(@diff.content_to.author.name) : l(:label_user_anonymous)
22
      %>, <%= format_time(@diff.content_to.updated_on) %>)</em>
23
</p>
24

  
25
<div class="text-diff">
26
<%= simple_format_without_paragraph @diff.to_html %>
27
</div>
app/views/wiki/diff.rhtml
1
<div class="contextual">
2
<%= link_to(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %>
3
</div>
4

  
5
<h2><%= @page.pretty_title %></h2>
6

  
7
<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 %>
9
<em>(<%= @diff.content_from.author ? @diff.content_from.author.name : "anonyme" %>, <%= format_time(@diff.content_from.updated_on) %>)</em>
10
&#8594;
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 %>
12
<em>(<%= @diff.content_to.author ? @diff.content_to.author.name : "anonyme" %>, <%= format_time(@diff.content_to.updated_on) %>)</em>
13
</p>
14

  
15
<div class="text-diff">
16
<%= simple_format_without_paragraph @diff.to_html %>
17
</div>
app/views/wiki/edit.html.erb
1
<%= wiki_page_breadcrumb(@page) %>
2

  
3
<h2><%=h @page.pretty_title %></h2>
4

  
5
<% form_for :content, @content, :url => {:action => 'update', :id => @page.title}, :html => {:method => :put, :multipart => true, :id => 'wiki_form'} do |f| %>
6
<%= f.hidden_field :version %>
7
<% if @section %>
8
<%= hidden_field_tag 'section', @section %>
9
<%= hidden_field_tag 'section_hash', @section_hash %>
10
<% end %>
11
<%= error_messages_for 'content' %>
12

  
13
<p><%= text_area_tag 'content[text]', @text, :cols => 100, :rows => 25, :class => 'wiki-edit', :accesskey => accesskey(:edit) %></p>
14
<p><label><%= l(:field_comments) %></label><br /><%= f.text_field :comments, :size => 120 %></p>
15
<p><label><%=l(:label_attachment_plural)%></label><br /><%= render :partial => 'attachments/form' %></p>
16

  
17
<p><%= submit_tag l(:button_save) %>
18
   <%= link_to_remote l(:label_preview),
19
                       { :url => { :controller => 'wiki', :action => 'preview', :project_id => @project, :id => @page.title },
20
                         :method => :post,
21
                         :update => 'preview',
22
                         :with => "Form.serialize('wiki_form')",
23
                         :complete => "Element.scrollTo('preview')"
24
                       }, :accesskey => accesskey(:preview) %></p>
25
<%= wikitoolbar_for 'content_text' %>
26
<% end %>
27

  
28
<div id="preview" class="wiki"></div>
29

  
30
<% content_for :header_tags do %>
31
  <%= stylesheet_link_tag 'scm' %>
32
  <%= robot_exclusion_tag %>
33
<% end %>
34

  
35
<% html_title @page.pretty_title %>
app/views/wiki/edit.rhtml
1
<h2><%=h @page.pretty_title %></h2>
2

  
3
<% 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 %>
5
<%= error_messages_for 'content' %>
6

  
7
<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>
9
<p><label><%=l(:label_attachment_plural)%></label><br /><%= render :partial => 'attachments/form' %></p>
10

  
11
<p><%= submit_tag l(:button_save) %>
12
   <%= link_to_remote l(:label_preview), 
13
                       { :url => { :controller => 'wiki', :action => 'preview', :project_id => @project, :id => @page.title },
14
                         :method => :post,
15
                         :update => 'preview',
16
                         :with => "Form.serialize('wiki_form')",
17
                         :complete => "Element.scrollTo('preview')"
18
                       }, :accesskey => accesskey(:preview) %></p>
19
<%= wikitoolbar_for 'content_text' %>
20
<% end %>
21

  
22
<div id="preview" class="wiki"></div>
23

  
24
<% content_for :header_tags do %>
25
  <%= stylesheet_link_tag 'scm' %>
26
  <%= robot_exclusion_tag %>
27
<% end %>
28

  
29
<% html_title @page.pretty_title %>
app/views/wiki/export.html.erb
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3
<head>
4
<title><%=h @page.pretty_title %></title>
5
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
<style>
7
body { font:80% Verdana,Tahoma,Arial,sans-serif; }
8
h1, h2, h3, h4 {  font-family: "Trebuchet MS",Georgia,"Times New Roman",serif; }
9
ul.toc { padding: 4px; margin-left: 0; }
10
ul.toc li { list-style-type:none; }
11
ul.toc li.heading2 { margin-left: 1em; }
12
ul.toc li.heading3 { margin-left: 2em; }
13
a.wiki-anchor { display: none; margin-left: 6px; text-decoration: none; }
14
a.wiki-anchor:hover { color: #aaa !important; text-decoration: none; }
15
h1:hover a.wiki-anchor, h2:hover a.wiki-anchor, h3:hover a.wiki-anchor { display: inline; color: #ddd; }
16
</style>
17
</head>
18
<body>
19
<%= textilizable @content, :text, :wiki_links => :local %>
20
</body>
21
</html>
app/views/wiki/export.rhtml
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3
<head>
4
<title><%=h @page.pretty_title %></title>
5
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
<style>
7
body { font:80% Verdana,Tahoma,Arial,sans-serif; }
8
h1, h2, h3, h4 {  font-family: "Trebuchet MS",Georgia,"Times New Roman",serif; }
9
ul.toc { padding: 4px; margin-left: 0; }
10
ul.toc li { list-style-type:none; }
11
ul.toc li.heading2 { margin-left: 1em; }
12
ul.toc li.heading3 { margin-left: 2em; }
13
a.wiki-anchor { display: none; margin-left: 6px; text-decoration: none; }
14
a.wiki-anchor:hover { color: #aaa !important; text-decoration: none; }
15
h1:hover a.wiki-anchor, h2:hover a.wiki-anchor, h3:hover a.wiki-anchor { display: inline; color: #ddd; }
16
</style>
17
</head>
18
<body>
19
<%= textilizable @content, :text, :wiki_links => :local %>
20
</body>
21
</html>
app/views/wiki/export_multiple.html.erb
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3
<head>
4
<title><%=h @wiki.project.name %></title>
5
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
<style>
7
body { font:80% Verdana,Tahoma,Arial,sans-serif; }
8
h1, h2, h3, h4 {  font-family: "Trebuchet MS",Georgia,"Times New Roman",serif; }
9
ul.toc { padding: 4px; margin-left: 0; }
10
ul.toc li { list-style-type:none; }
11
ul.toc li.heading2 { margin-left: 1em; }
12
ul.toc li.heading3 { margin-left: 2em; }
13
a.wiki-anchor { display: none; margin-left: 6px; text-decoration: none; }
14
a.wiki-anchor:hover { color: #aaa !important; text-decoration: none; }
15
h1:hover a.wiki-anchor, h2:hover a.wiki-anchor, h3:hover a.wiki-anchor { display: inline; color: #ddd; }
16
</style>
17
</head>
18
<body>
19

  
20
<strong><%= l(:label_index_by_title) %></strong>
21
<ul>
22
<% @pages.each do |page| %>
23
    <li><a href="#<%= h(page.title) %>"><%= h(page.pretty_title) %></a></li>
24
<% end %>
25
</ul>
26

  
27
<% @pages.each do |page| %>
28
<hr />
29
<a name="<%= h(page.title) %>" />
30
<%= textilizable page.content ,:text, :wiki_links => :anchor %>
31
<% end %>
32

  
33
</body>
34
</html>
app/views/wiki/export_multiple.rhtml
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3
<head>
4
<title><%=h @wiki.project.name %></title>
5
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
<style>
7
body { font:80% Verdana,Tahoma,Arial,sans-serif; }
8
h1, h2, h3, h4 {  font-family: "Trebuchet MS",Georgia,"Times New Roman",serif; }
9
ul.toc { padding: 4px; margin-left: 0; }
10
ul.toc li { list-style-type:none; }
11
ul.toc li.heading2 { margin-left: 1em; }
12
ul.toc li.heading3 { margin-left: 2em; }
13
a.wiki-anchor { display: none; margin-left: 6px; text-decoration: none; }
14
a.wiki-anchor:hover { color: #aaa !important; text-decoration: none; }
15
h1:hover a.wiki-anchor, h2:hover a.wiki-anchor, h3:hover a.wiki-anchor { display: inline; color: #ddd; }
16
</style>
17
</head>
18
<body>
19

  
20
<strong><%= l(:label_index_by_title) %></strong>
21
<ul>
22
<% @pages.each do |page| %>
23
    <li><a href="#<%= page.title %>"><%= page.pretty_title %></a></li>
24
<% end %>
25
</ul>
26

  
27
<% @pages.each do |page| %>
28
<hr />
29
<a name="<%= page.title %>" />
30
<%= textilizable page.content ,:text, :wiki_links => :anchor %>
31
<% end %>
32

  
33
</body>
34
</html>
app/views/wiki/history.html.erb
1
<%= wiki_page_breadcrumb(@page) %>
2

  
3
<h2><%= h(@page.pretty_title) %></h2>
4

  
5
<h3><%= l(:label_history) %></h3>
6

  
7
<% form_tag({:action => "diff"}, :method => :get) do %>
8
<table class="list wiki-page-versions">
9
<thead><tr>
10
    <th>#</th>
11
    <th></th>
12
    <th></th>
13
    <th><%= l(:field_updated_on) %></th>
14
    <th><%= l(:field_author) %></th>
15
    <th><%= l(:field_comments) %></th>
16
    <th></th>
17
</tr></thead>
18
<tbody>
19
<% show_diff = @versions.size > 1 %>
20
<% line_num = 1 %>
21
<% @versions.each do |ver| %>
22
<tr class="wiki-page-version <%= cycle("odd", "even") %>">
23
    <td class="id"><%= link_to h(ver.version), :action => 'show', :id => @page.title, :project_id => @page.project, :version => ver.version %></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>
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>
26
    <td class="updated_on"><%= format_time(ver.updated_on) %></td>
27
    <td class="author"><%= link_to_user ver.author %></td>
28
    <td class="comments"><%=h ver.comments %></td>
29
    <td class="buttons"><%= link_to l(:button_annotate), :action => 'annotate', :id => @page.title, :version => ver.version %></td>
30
</tr>
31
<% line_num += 1 %>
32
<% end %>
33
</tbody>
34
</table>
35
<%= submit_tag l(:label_view_diff), :class => 'small' if show_diff %>
36
<span class="pagination"><%= pagination_links_full @version_pages, @version_count, :page_param => :p %></span>
37
<% end %>
app/views/wiki/history.rhtml
1
<h2><%= @page.pretty_title %></h2>
2

  
3
<h3><%= l(:label_history) %></h3>
4

  
5
<% form_tag({:action => "diff"}, :method => :get) do %>
6
<table class="list wiki-page-versions">
7
<thead><tr>
8
    <th>#</th>
9
    <th></th>
10
    <th></th>    
11
    <th><%= l(:field_updated_on) %></th>
12
    <th><%= l(:field_author) %></th>
13
    <th><%= l(:field_comments) %></th>
14
    <th></th>
15
</tr></thead>
16
<tbody>
17
<% show_diff = @versions.size > 1 %>
18
<% line_num = 1 %>
19
<% @versions.each do |ver| %>
20
<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>
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>
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>
24
    <td class="updated_on"><%= format_time(ver.updated_on) %></td>
25
    <td class="author"><%= link_to_user ver.author %></td>
26
    <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>
28
</tr>
29
<% line_num += 1 %>
30
<% end %>
31
</tbody>
32
</table>
33
<%= 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>
35
<% end %>
app/views/wiki/index.html.erb
16 16

  
17 17
<% unless @pages.empty? %>
18 18
<% other_formats_links do |f| %>
19
	<%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'index', :id => @project, :show_wiki_edits => 1, :key => User.current.rss_key} %>
20
	<%= f.link_to('HTML', :url => {:action => 'export'}) if User.current.allowed_to?(:export_wiki_pages, @project) %>
19
  <%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'index', :id => @project, :show_wiki_edits => 1, :key => User.current.rss_key} %>
20
  <%= f.link_to('HTML', :url => {:action => 'export'}) if User.current.allowed_to?(:export_wiki_pages, @project) %>
21 21
<% end %>
22 22
<% end %>
23 23

  
app/views/wiki/rename.html.erb
1
<%= wiki_page_breadcrumb(@page) %>
2

  
3
<h2><%=h @original_title %></h2>
4

  
5
<%= error_messages_for 'page' %>
6

  
7
<% labelled_tabular_form_for :wiki_page, @page, :url => { :action => 'rename' } do |f| %>
8
<div class="box">
9
<p><%= f.text_field :title, :required => true, :size => 100  %></p>
10
<p><%= f.check_box :redirect_existing_links %></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>
12
</div>
13
<%= submit_tag l(:button_rename) %>
14
<% end %>
app/views/wiki/rename.rhtml
1
<h2><%= l(:button_rename) %>: <%= @original_title %></h2>
2

  
3
<%= error_messages_for 'page' %>
4

  
5
<% labelled_tabular_form_for :wiki_page, @page, :url => { :action => 'rename' } do |f| %>
6
<div class="box">
7
<p><%= f.text_field :title, :required => true, :size => 100  %></p>
8
<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>
10
</div>
11
<%= submit_tag l(:button_rename) %>
12
<% end %>
app/views/wiki/show.html.erb
1
<div class="contextual">
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.current_version? %>
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? %>
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.current_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') %>
9
<%= link_to_if_authorized(l(:button_rollback), {:action => 'edit', :id => @page.title, :version => @content.version }, :class => 'icon icon-cancel') unless @content.current_version? %>
10
<% end %>
11
<%= link_to_if_authorized(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %>
12
</div>
13

  
14
<%= wiki_page_breadcrumb(@page) %>
15

  
16
<% unless @content.current_version? %>
17
    <p>
18
    <%= link_to(("\xc2\xab " + l(:label_previous)),
19
                :action => 'show', :id => @page.title, :project_id => @page.project,
20
                :version => (@content.version - 1)) + " - " if @content.version > 1 %>
21
    <%= "#{l(:label_version)} #{@content.version}/#{@page.content.version}" %>
22
    <%= '(' + link_to(l(:label_diff), :controller => 'wiki', :action => 'diff',
23
                      :id => @page.title, :project_id => @page.project,
24
                      :version => @content.version) + ')' if @content.version > 1 %> - 
25
    <%= link_to((l(:label_next) + " \xc2\xbb"), :action => 'show',
26
                :id => @page.title, :project_id => @page.project,
27
                :version => (@content.version + 1)) + " - " if @content.version < @page.content.version %>
28
    <%= link_to(l(:label_current_version), :action => 'show', :id => @page.title, :project_id => @page.project) %>
29
    <br />
30
    <em><%= @content.author ? link_to_user(@content.author) : l(:label_user_anonymous)
31
         %>, <%= format_time(@content.updated_on) %> </em><br />
32
    <%=h @content.comments %>
33
    </p>
34
    <hr />
35
<% end %>
36

  
37
<%= render(:partial => "wiki/content", :locals => {:content => @content}) %>
38

  
39
<%= link_to_attachments @page %>
40

  
41
<% if @editable && authorize_for('wiki', 'add_attachment') %>
42
<div id="wiki_add_attachment">
43
<p><%= link_to l(:label_attachment_new), {}, :onclick => "Element.show('add_attachment_form'); Element.hide(this); Element.scrollTo('add_attachment_form'); return false;",
44
                                             :id => 'attach_files_link' %></p>
45
<% form_tag({ :controller => 'wiki', :action => 'add_attachment', :project_id => @project, :id => @page.title }, :multipart => true, :id => "add_attachment_form", :style => "display:none;") do %>
46
  <div class="box">
47
  <p><%= render :partial => 'attachments/form' %></p>
48
  </div>
49
<%= submit_tag l(:button_add) %>
50
<%= link_to l(:button_cancel), {}, :onclick => "Element.hide('add_attachment_form'); Element.show('attach_files_link'); return false;" %>
51
<% end %>
52
</div>
53
<% end %>
54

  
55
<% other_formats_links do |f| %>
56
  <%= f.link_to 'PDF', :url => {:id => @page.title, :version => params[:version]} %>
57
  <%= f.link_to 'HTML', :url => {:id => @page.title, :version => params[:version]} %>
58
  <%= f.link_to 'TXT', :url => {:id => @page.title, :version => params[:version]} %>
59
<% end if User.current.allowed_to?(:export_wiki_pages, @project) %>
60

  
61
<% content_for :header_tags do %>
62
  <%= stylesheet_link_tag 'scm' %>
63
<% end %>
64

  
65
<% content_for :sidebar do %>
66
  <%= render :partial => 'sidebar' %>
67
<% end %>
68

  
69
<% html_title @page.pretty_title %>
app/views/wiki/show.rhtml
1
<div class="contextual">
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 %>
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? %>
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 %>
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 %>
10
<% end %>
11
<%= link_to_if_authorized(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %>
12
</div>
13

  
14
<%= breadcrumb(@page.ancestors.reverse.collect {|parent| link_to h(parent.pretty_title), {:id => parent.title, :project_id => parent.project}}) %>
15

  
16
<% if @content.version != @page.content.version %>
17
    <p>    
18
    <%= link_to(('&#171; ' + 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}" %>
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) + ' &#187;'), :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) %>
23
    <br />
24
    <em><%= @content.author ? @content.author.name : "anonyme" %>, <%= format_time(@content.updated_on) %> </em><br />
25
    <%=h @content.comments %>
26
    </p>
27
    <hr />
28
<% end %>
29

  
30
<%= render(:partial => "wiki/content", :locals => {:content => @content}) %>
31

  
32
<%= link_to_attachments @page %>
33

  
34
<% if @editable && authorize_for('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;",
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 %>
39
  <div class="box">
40
  <p><%= render :partial => 'attachments/form' %></p>
41
  </div>
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;" %>
44
<% end %>
45
</div>
46
<% end %>
47

  
48
<% other_formats_links do |f| %>
49
	<%= f.link_to 'HTML', :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) %>
52

  
53
<% content_for :header_tags do %>
54
  <%= stylesheet_link_tag 'scm' %>
55
<% end %>
56

  
57
<% content_for :sidebar do %>
58
  <%= render :partial => 'sidebar' %>
59
<% end %>
60

  
61
<% html_title @page.pretty_title %>

Also available in: Unified diff