summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/wiki_controller.rb18
-rw-r--r--app/helpers/application_helper.rb4
-rw-r--r--app/views/wiki/_sidebar.rhtml2
-rw-r--r--app/views/wiki/annotate.rhtml4
-rw-r--r--app/views/wiki/date_index.html.erb6
-rw-r--r--app/views/wiki/destroy.rhtml2
-rw-r--r--app/views/wiki/diff.rhtml4
-rw-r--r--app/views/wiki/history.rhtml2
-rw-r--r--app/views/wiki/page_index.html.erb4
-rw-r--r--app/views/wiki/show.rhtml6
10 files changed, 26 insertions, 26 deletions
diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb
index 75902d542..95e1943e9 100644
--- a/app/controllers/wiki_controller.rb
+++ b/app/controllers/wiki_controller.rb
@@ -22,14 +22,14 @@ class WikiController < ApplicationController
before_filter :find_wiki, :authorize
before_filter :find_existing_page, :only => [:rename, :protect, :history, :diff, :annotate, :add_attachment, :destroy]
- verify :method => :post, :only => [:destroy, :protect], :redirect_to => { :action => :index }
+ verify :method => :post, :only => [:destroy, :protect], :redirect_to => { :action => :show }
helper :attachments
include AttachmentsHelper
helper :watchers
-
+
# display a page (in editing mode if it doesn't exist)
- def index
+ def show
page_title = params[:page]
@page = @wiki.find_or_new_page(page_title)
if @page.new_record?
@@ -79,7 +79,7 @@ class WikiController < ApplicationController
attachments = Attachment.attach_files(@page, params[:attachments])
render_attachment_warning_if_needed(@page)
# don't save if text wasn't changed
- redirect_to :action => 'index', :project_id => @project, :page => @page.title
+ redirect_to :action => 'show', :project_id => @project, :page => @page.title
return
end
#@content.text = params[:content][:text]
@@ -91,7 +91,7 @@ class WikiController < ApplicationController
attachments = Attachment.attach_files(@page, params[:attachments])
render_attachment_warning_if_needed(@page)
call_hook(:controller_wiki_edit_after_save, { :params => params, :page => @page})
- redirect_to :action => 'index', :project_id => @project, :page => @page.title
+ redirect_to :action => 'show', :project_id => @project, :page => @page.title
end
end
rescue ActiveRecord::StaleObjectError
@@ -107,13 +107,13 @@ class WikiController < ApplicationController
@original_title = @page.pretty_title
if request.post? && @page.update_attributes(params[:wiki_page])
flash[:notice] = l(:notice_successful_update)
- redirect_to :action => 'index', :project_id => @project, :page => @page.title
+ redirect_to :action => 'show', :project_id => @project, :page => @page.title
end
end
def protect
@page.update_attribute :protected, params[:protected]
- redirect_to :action => 'index', :project_id => @project, :page => @page.title
+ redirect_to :action => 'show', :project_id => @project, :page => @page.title
end
# show page history
@@ -176,7 +176,7 @@ class WikiController < ApplicationController
export = render_to_string :action => 'export_multiple', :layout => false
send_data(export, :type => 'text/html', :filename => "wiki.html")
else
- redirect_to :action => 'index', :project_id => @project, :page => nil
+ redirect_to :action => 'show', :project_id => @project, :page => nil
end
end
@@ -204,7 +204,7 @@ class WikiController < ApplicationController
return render_403 unless editable?
attachments = Attachment.attach_files(@page, params[:attachments])
render_attachment_warning_if_needed(@page)
- redirect_to :action => 'index', :page => @page.title
+ redirect_to :action => 'show', :page => @page.title
end
private
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 2ac301d53..fb4b84d7c 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -182,7 +182,7 @@ module ApplicationHelper
content << "<ul class=\"pages-hierarchy\">\n"
pages[node].each do |page|
content << "<li>"
- content << link_to(h(page.pretty_title), {:controller => 'wiki', :action => 'index', :project_id => page.project, :page => page.title},
+ content << link_to(h(page.pretty_title), {:controller => 'wiki', :action => 'show', :project_id => page.project, :page => page.title},
:title => (page.respond_to?(:updated_on) ? l(:label_updated_time, distance_of_time_in_words(Time.now, page.updated_on)) : nil))
content << "\n" + render_page_hierarchy(pages, page.id) if pages[page.id]
content << "</li>\n"
@@ -551,7 +551,7 @@ module ApplicationHelper
when :local; "#{title}.html"
when :anchor; "##{title}" # used for single-file wiki export
else
- url_for(:only_path => only_path, :controller => 'wiki', :action => 'index', :project_id => link_project, :page => Wiki.titleize(page), :anchor => anchor)
+ url_for(:only_path => only_path, :controller => 'wiki', :action => 'show', :project_id => link_project, :page => Wiki.titleize(page), :anchor => anchor)
end
link_to((title || page), url, :class => ('wiki-page' + (wiki_page ? '' : ' new')))
else
diff --git a/app/views/wiki/_sidebar.rhtml b/app/views/wiki/_sidebar.rhtml
index c6e5e6ab8..efb24af06 100644
--- a/app/views/wiki/_sidebar.rhtml
+++ b/app/views/wiki/_sidebar.rhtml
@@ -4,6 +4,6 @@
<h3><%= l(:label_wiki) %></h3>
-<%= link_to l(:field_start_page), {:action => 'index', :page => nil} %><br />
+<%= link_to l(:field_start_page), {:action => 'show', :page => nil} %><br />
<%= link_to l(:label_index_by_title), {:action => 'page_index'} %><br />
<%= link_to l(:label_index_by_date), {:action => 'date_index'} %><br />
diff --git a/app/views/wiki/annotate.rhtml b/app/views/wiki/annotate.rhtml
index 9d3b32827..1e664fb84 100644
--- a/app/views/wiki/annotate.rhtml
+++ b/app/views/wiki/annotate.rhtml
@@ -6,7 +6,7 @@
<h2><%= @page.pretty_title %></h2>
<p>
-<%= l(:label_version) %> <%= link_to @annotate.content.version, :action => 'index', :page => @page.title, :version => @annotate.content.version %>
+<%= l(:label_version) %> <%= link_to @annotate.content.version, :action => 'show', :page => @page.title, :version => @annotate.content.version %>
<em>(<%= @annotate.content.author ? @annotate.content.author.name : "anonyme" %>, <%= format_time(@annotate.content.updated_on) %>)</em>
</p>
@@ -18,7 +18,7 @@
<% @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 => 'index', :project_id => @project, :page => @page.title, :version => line[0] %></td>
+ <td class="revision"><%= link_to line[0], :controller => 'wiki', :action => 'show', :project_id => @project, :page => @page.title, :version => line[0] %></td>
<td class="author"><%= h(line[1]) %></td>
<td class="line-code"><pre><%=h line[2] %></pre></td>
</tr>
diff --git a/app/views/wiki/date_index.html.erb b/app/views/wiki/date_index.html.erb
index 957c15967..086d8f632 100644
--- a/app/views/wiki/date_index.html.erb
+++ b/app/views/wiki/date_index.html.erb
@@ -12,7 +12,7 @@
<h3><%= format_date(date) %></h3>
<ul>
<% @pages_by_date[date].each do |page| %>
- <li><%= link_to page.pretty_title, :action => 'index', :page => page.title %></li>
+ <li><%= link_to page.pretty_title, :action => 'show', :page => page.title %></li>
<% end %>
</ul>
<% end %>
@@ -23,11 +23,11 @@
<% 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} %>
+ <%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'show', :id => @project, :show_wiki_edits => 1, :key => User.current.rss_key} %>
<%= f.link_to('HTML', :url => {:action => 'export'}) if User.current.allowed_to?(:export_wiki_pages, @project) %>
<% 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) %>
+<%= auto_discovery_link_tag(:atom, :controller => 'activities', :action => 'show', :id => @project, :show_wiki_edits => 1, :format => 'atom', :key => User.current.rss_key) %>
<% end %>
diff --git a/app/views/wiki/destroy.rhtml b/app/views/wiki/destroy.rhtml
index 77f20ef5e..83c81fd5c 100644
--- a/app/views/wiki/destroy.rhtml
+++ b/app/views/wiki/destroy.rhtml
@@ -15,5 +15,5 @@
</div>
<%= submit_tag l(:button_apply) %>
-<%= link_to l(:button_cancel), :controller => 'wiki', :action => 'index', :project_id => @project, :page => @page.title %>
+<%= link_to l(:button_cancel), :controller => 'wiki', :action => 'show', :project_id => @project, :page => @page.title %>
<% end %>
diff --git a/app/views/wiki/diff.rhtml b/app/views/wiki/diff.rhtml
index 9095be560..a9eebdb9a 100644
--- a/app/views/wiki/diff.rhtml
+++ b/app/views/wiki/diff.rhtml
@@ -5,10 +5,10 @@
<h2><%= @page.pretty_title %></h2>
<p>
-<%= l(:label_version) %> <%= link_to @diff.content_from.version, :action => 'index', :page => @page.title, :version => @diff.content_from.version %>
+<%= l(:label_version) %> <%= link_to @diff.content_from.version, :action => 'show', :page => @page.title, :version => @diff.content_from.version %>
<em>(<%= @diff.content_from.author ? @diff.content_from.author.name : "anonyme" %>, <%= format_time(@diff.content_from.updated_on) %>)</em>
&#8594;
-<%= l(:label_version) %> <%= link_to @diff.content_to.version, :action => 'index', :page => @page.title, :version => @diff.content_to.version %>/<%= @page.content.version %>
+<%= l(:label_version) %> <%= link_to @diff.content_to.version, :action => 'show', :page => @page.title, :version => @diff.content_to.version %>/<%= @page.content.version %>
<em>(<%= @diff.content_to.author ? @diff.content_to.author.name : "anonyme" %>, <%= format_time(@diff.content_to.updated_on) %>)</em>
</p>
diff --git a/app/views/wiki/history.rhtml b/app/views/wiki/history.rhtml
index 3f07d55e6..1f73fd173 100644
--- a/app/views/wiki/history.rhtml
+++ b/app/views/wiki/history.rhtml
@@ -19,7 +19,7 @@
<% line_num = 1 %>
<% @versions.each do |ver| %>
<tr class="<%= cycle("odd", "even") %>">
- <td class="id"><%= link_to ver.version, :action => 'index', :page => @page.title, :version => ver.version %></td>
+ <td class="id"><%= link_to ver.version, :action => 'show', :page => @page.title, :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}').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 align="center"><%= format_time(ver.updated_on) %></td>
diff --git a/app/views/wiki/page_index.html.erb b/app/views/wiki/page_index.html.erb
index e85f83b91..7e7155fda 100644
--- a/app/views/wiki/page_index.html.erb
+++ b/app/views/wiki/page_index.html.erb
@@ -16,11 +16,11 @@
<% 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} %>
+ <%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'show', :id => @project, :show_wiki_edits => 1, :key => User.current.rss_key} %>
<%= f.link_to('HTML', :url => {:action => 'export'}) if User.current.allowed_to?(:export_wiki_pages, @project) %>
<% 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) %>
+<%= auto_discovery_link_tag(:atom, :controller => 'activities', :action => 'show', :id => @project, :show_wiki_edits => 1, :format => 'atom', :key => User.current.rss_key) %>
<% end %>
diff --git a/app/views/wiki/show.rhtml b/app/views/wiki/show.rhtml
index 690e9102b..00feab8b9 100644
--- a/app/views/wiki/show.rhtml
+++ b/app/views/wiki/show.rhtml
@@ -15,11 +15,11 @@
<% if @content.version != @page.content.version %>
<p>
- <%= link_to(('&#171; ' + l(:label_previous)), :action => 'index', :page => @page.title, :version => (@content.version - 1)) + " - " if @content.version > 1 %>
+ <%= link_to(('&#171; ' + l(:label_previous)), :action => 'show', :page => @page.title, :version => (@content.version - 1)) + " - " if @content.version > 1 %>
<%= "#{l(:label_version)} #{@content.version}/#{@page.content.version}" %>
<%= '(' + link_to('diff', :controller => 'wiki', :action => 'diff', :page => @page.title, :version => @content.version) + ')' if @content.version > 1 %> -
- <%= link_to((l(:label_next) + ' &#187;'), :action => 'index', :page => @page.title, :version => (@content.version + 1)) + " - " if @content.version < @page.content.version %>
- <%= link_to(l(:label_current_version), :action => 'index', :page => @page.title) %>
+ <%= link_to((l(:label_next) + ' &#187;'), :action => 'show', :page => @page.title, :version => (@content.version + 1)) + " - " if @content.version < @page.content.version %>
+ <%= link_to(l(:label_current_version), :action => 'show', :page => @page.title) %>
<br />
<em><%= @content.author ? @content.author.name : "anonyme" %>, <%= format_time(@content.updated_on) %> </em><br />
<%=h @content.comments %>