diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2010-10-27 16:27:06 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2010-10-27 16:27:06 +0000 |
commit | e9efa5b9814bbeddd9956b8478ed26af02b0eeca (patch) | |
tree | d2b8c54194c7410edd114483d3645d9945aff17a /app | |
parent | 70bf0706b2f7933f72cbd4daab8e43b0ac9de4e9 (diff) | |
download | redmine-e9efa5b9814bbeddd9956b8478ed26af02b0eeca.tar.gz redmine-e9efa5b9814bbeddd9956b8478ed26af02b0eeca.zip |
Refactor: use :id instead of :page when linking to Wiki Pages
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4296 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/wiki_controller.rb | 22 | ||||
-rw-r--r-- | app/helpers/application_helper.rb | 4 | ||||
-rw-r--r-- | app/models/mailer.rb | 10 | ||||
-rw-r--r-- | app/models/wiki_content.rb | 2 | ||||
-rw-r--r-- | app/models/wiki_page.rb | 4 | ||||
-rw-r--r-- | app/views/mailer/wiki_content_added.text.html.rhtml | 2 | ||||
-rw-r--r-- | app/views/mailer/wiki_content_added.text.plain.rhtml | 2 | ||||
-rw-r--r-- | app/views/mailer/wiki_content_updated.text.html.rhtml | 2 | ||||
-rw-r--r-- | app/views/mailer/wiki_content_updated.text.plain.rhtml | 2 | ||||
-rw-r--r-- | app/views/projects/settings/_versions.rhtml | 2 | ||||
-rw-r--r-- | app/views/versions/show.rhtml | 2 | ||||
-rw-r--r-- | app/views/wiki/_sidebar.rhtml | 2 | ||||
-rw-r--r-- | app/views/wiki/annotate.rhtml | 8 | ||||
-rw-r--r-- | app/views/wiki/date_index.html.erb | 2 | ||||
-rw-r--r-- | app/views/wiki/destroy.rhtml | 2 | ||||
-rw-r--r-- | app/views/wiki/diff.rhtml | 6 | ||||
-rw-r--r-- | app/views/wiki/edit.rhtml | 4 | ||||
-rw-r--r-- | app/views/wiki/history.rhtml | 4 | ||||
-rw-r--r-- | app/views/wiki/show.rhtml | 30 |
19 files changed, 56 insertions, 56 deletions
diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index 4f15d35a0..39786341b 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -49,7 +49,7 @@ class WikiController < ApplicationController # display a page (in editing mode if it doesn't exist) def show - page_title = params[:page] + page_title = params[:id] @page = @wiki.find_or_new_page(page_title) if @page.new_record? if User.current.allowed_to?(:edit_wiki_pages, @project) && editable? @@ -82,7 +82,7 @@ class WikiController < ApplicationController # edit an existing page or a new one def edit - @page = @wiki.find_or_new_page(params[:page]) + @page = @wiki.find_or_new_page(params[:id]) return render_403 unless editable? @page.content = WikiContent.new(:page => @page) if @page.new_record? @@ -101,7 +101,7 @@ class WikiController < ApplicationController verify :method => :post, :only => :update, :render => {:nothing => true, :status => :method_not_allowed } # Creates a new page or updates an existing one def update - @page = @wiki.find_or_new_page(params[:page]) + @page = @wiki.find_or_new_page(params[:id]) return render_403 unless editable? @page.content = WikiContent.new(:page => @page) if @page.new_record? @@ -114,7 +114,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 => 'show', :project_id => @project, :page => @page.title + redirect_to :action => 'show', :project_id => @project, :id => @page.title return end @content.attributes = params[:content] @@ -124,7 +124,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 => 'show', :project_id => @project, :page => @page.title + redirect_to :action => 'show', :project_id => @project, :id => @page.title end rescue ActiveRecord::StaleObjectError @@ -140,13 +140,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 => 'show', :project_id => @project, :page => @page.title + redirect_to :action => 'show', :project_id => @project, :id => @page.title end end def protect @page.update_attribute :protected, params[:protected] - redirect_to :action => 'show', :project_id => @project, :page => @page.title + redirect_to :action => 'show', :project_id => @project, :id => @page.title end # show page history @@ -210,7 +210,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 => 'show', :project_id => @project, :page => nil + redirect_to :action => 'show', :project_id => @project, :id => nil end end @@ -219,7 +219,7 @@ class WikiController < ApplicationController end def preview - page = @wiki.find_page(params[:page]) + page = @wiki.find_page(params[:id]) # page is nil when previewing a new page return render_403 unless page.nil? || editable?(page) if page @@ -234,7 +234,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 => 'show', :page => @page.title + redirect_to :action => 'show', :id => @page.title end private @@ -249,7 +249,7 @@ private # Finds the requested page and returns a 404 error if it doesn't exist def find_existing_page - @page = @wiki.find_page(params[:page]) + @page = @wiki.find_page(params[:id]) render_404 if @page.nil? end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 38d43e5b8..12f4b6e5e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -177,7 +177,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 => 'show', :project_id => page.project, :page => page.title}, + content << link_to(h(page.pretty_title), {:controller => 'wiki', :action => 'show', :project_id => page.project, :id => 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" @@ -541,7 +541,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 => 'show', :project_id => link_project, :page => Wiki.titleize(page), :anchor => anchor) + url_for(:only_path => only_path, :controller => 'wiki', :action => 'show', :project_id => link_project, :id => Wiki.titleize(page), :anchor => anchor) end link_to((title || page), url, :class => ('wiki-page' + (wiki_page ? '' : ' new'))) else diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 6db5a997b..80be7a629 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -178,9 +178,9 @@ class Mailer < ActionMailer::Base message_id wiki_content recipients wiki_content.recipients cc(wiki_content.page.wiki.watcher_recipients - recipients) - subject "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_added, :page => wiki_content.page.pretty_title)}" + subject "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_added, :id => wiki_content.page.pretty_title)}" body :wiki_content => wiki_content, - :wiki_content_url => url_for(:controller => 'wiki', :action => 'index', :id => wiki_content.project, :page => wiki_content.page.title) + :wiki_content_url => url_for(:controller => 'wiki', :action => 'index', :id => wiki_content.project, :id => wiki_content.page.title) render_multipart('wiki_content_added', body) end @@ -195,10 +195,10 @@ class Mailer < ActionMailer::Base message_id wiki_content recipients wiki_content.recipients cc(wiki_content.page.wiki.watcher_recipients + wiki_content.page.watcher_recipients - recipients) - subject "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_updated, :page => wiki_content.page.pretty_title)}" + subject "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_updated, :id => wiki_content.page.pretty_title)}" body :wiki_content => wiki_content, - :wiki_content_url => url_for(:controller => 'wiki', :action => 'index', :id => wiki_content.project, :page => wiki_content.page.title), - :wiki_diff_url => url_for(:controller => 'wiki', :action => 'diff', :id => wiki_content.project, :page => wiki_content.page.title, :version => wiki_content.version) + :wiki_content_url => url_for(:controller => 'wiki', :action => 'index', :id => wiki_content.project, :id => wiki_content.page.title), + :wiki_diff_url => url_for(:controller => 'wiki', :action => 'diff', :id => wiki_content.project, :id => wiki_content.page.title, :version => wiki_content.version) render_multipart('wiki_content_updated', body) end diff --git a/app/models/wiki_content.rb b/app/models/wiki_content.rb index 68de46654..995b6599d 100644 --- a/app/models/wiki_content.rb +++ b/app/models/wiki_content.rb @@ -54,7 +54,7 @@ class WikiContent < ActiveRecord::Base :description => :comments, :datetime => :updated_on, :type => 'wiki-page', - :url => Proc.new {|o| {:controller => 'wiki', :action => 'show', :project_id => o.page.wiki.project, :page => o.page.title, :version => o.version}} + :url => Proc.new {|o| {:controller => 'wiki', :action => 'show', :project_id => o.page.wiki.project, :id => o.page.title, :version => o.version}} acts_as_activity_provider :type => 'wiki_edits', :timestamp => "#{WikiContent.versioned_table_name}.updated_on", diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb index d489ec015..b65da2b77 100644 --- a/app/models/wiki_page.rb +++ b/app/models/wiki_page.rb @@ -28,7 +28,7 @@ class WikiPage < ActiveRecord::Base acts_as_event :title => Proc.new {|o| "#{l(:label_wiki)}: #{o.title}"}, :description => :text, :datetime => :created_on, - :url => Proc.new {|o| {:controller => 'wiki', :action => 'show', :project_id => o.wiki.project, :page => o.title}} + :url => Proc.new {|o| {:controller => 'wiki', :action => 'show', :project_id => o.wiki.project, :id => o.title}} acts_as_searchable :columns => ['title', 'text'], :include => [{:wiki => :project}, :content], @@ -139,7 +139,7 @@ class WikiPage < ActiveRecord::Base parent_page = t.blank? ? nil : self.wiki.find_page(t) self.parent = parent_page end - + protected def validate diff --git a/app/views/mailer/wiki_content_added.text.html.rhtml b/app/views/mailer/wiki_content_added.text.html.rhtml index 92e368f54..4140db98d 100644 --- a/app/views/mailer/wiki_content_added.text.html.rhtml +++ b/app/views/mailer/wiki_content_added.text.html.rhtml @@ -1,3 +1,3 @@ -<p><%= l(:mail_body_wiki_content_added, :page => link_to(h(@wiki_content.page.pretty_title), @wiki_content_url), +<p><%= l(:mail_body_wiki_content_added, :id => link_to(h(@wiki_content.page.pretty_title), @wiki_content_url), :author => h(@wiki_content.author)) %><br /> <em><%=h @wiki_content.comments %></em></p> diff --git a/app/views/mailer/wiki_content_added.text.plain.rhtml b/app/views/mailer/wiki_content_added.text.plain.rhtml index 5699eecd5..f57470b0e 100644 --- a/app/views/mailer/wiki_content_added.text.plain.rhtml +++ b/app/views/mailer/wiki_content_added.text.plain.rhtml @@ -1,4 +1,4 @@ -<%= l(:mail_body_wiki_content_added, :page => h(@wiki_content.page.pretty_title), +<%= l(:mail_body_wiki_content_added, :id => h(@wiki_content.page.pretty_title), :author => h(@wiki_content.author)) %> <%= @wiki_content.comments %> diff --git a/app/views/mailer/wiki_content_updated.text.html.rhtml b/app/views/mailer/wiki_content_updated.text.html.rhtml index 9f0bf0c87..f84e92326 100644 --- a/app/views/mailer/wiki_content_updated.text.html.rhtml +++ b/app/views/mailer/wiki_content_updated.text.html.rhtml @@ -1,4 +1,4 @@ -<p><%= l(:mail_body_wiki_content_updated, :page => link_to(h(@wiki_content.page.pretty_title), @wiki_content_url), +<p><%= l(:mail_body_wiki_content_updated, :id => link_to(h(@wiki_content.page.pretty_title), @wiki_content_url), :author => h(@wiki_content.author)) %><br /> <em><%=h @wiki_content.comments %></em></p> diff --git a/app/views/mailer/wiki_content_updated.text.plain.rhtml b/app/views/mailer/wiki_content_updated.text.plain.rhtml index 29767a65b..db5ca38dc 100644 --- a/app/views/mailer/wiki_content_updated.text.plain.rhtml +++ b/app/views/mailer/wiki_content_updated.text.plain.rhtml @@ -1,4 +1,4 @@ -<%= l(:mail_body_wiki_content_updated, :page => h(@wiki_content.page.pretty_title), +<%= l(:mail_body_wiki_content_updated, :id => h(@wiki_content.page.pretty_title), :author => h(@wiki_content.author)) %> <%= @wiki_content.comments %> diff --git a/app/views/projects/settings/_versions.rhtml b/app/views/projects/settings/_versions.rhtml index d41929c2d..eb04d6d43 100644 --- a/app/views/projects/settings/_versions.rhtml +++ b/app/views/projects/settings/_versions.rhtml @@ -17,7 +17,7 @@ <td class="description"><%=h version.description %></td> <td class="status"><%= l("version_status_#{version.status}") %></td> <td class="sharing"><%=h format_version_sharing(version.sharing) %></td> - <td><%= link_to(h(version.wiki_page_title), :controller => 'wiki', :page => Wiki.titleize(version.wiki_page_title)) unless version.wiki_page_title.blank? || @project.wiki.nil? %></td> + <td><%= link_to(h(version.wiki_page_title), :controller => 'wiki', :id => Wiki.titleize(version.wiki_page_title)) unless version.wiki_page_title.blank? || @project.wiki.nil? %></td> <td class="buttons"> <% if version.project == @project %> <%= link_to_if_authorized l(:button_edit), {:controller => 'versions', :action => 'edit', :id => version }, :class => 'icon icon-edit' %> diff --git a/app/views/versions/show.rhtml b/app/views/versions/show.rhtml index 6b2b09d0f..f8a82142c 100644 --- a/app/views/versions/show.rhtml +++ b/app/views/versions/show.rhtml @@ -1,6 +1,6 @@ <div class="contextual"> <%= link_to_if_authorized l(:button_edit), {:controller => 'versions', :action => 'edit', :id => @version}, :class => 'icon icon-edit' %> -<%= link_to_if_authorized(l(:button_edit_associated_wikipage, :page_title => @version.wiki_page_title), {:controller => 'wiki', :action => 'edit', :page => Wiki.titleize(@version.wiki_page_title)}, :class => 'icon icon-edit') unless @version.wiki_page_title.blank? || @project.wiki.nil? %> +<%= link_to_if_authorized(l(:button_edit_associated_wikipage, :page_title => @version.wiki_page_title), {:controller => 'wiki', :action => 'edit', :id => Wiki.titleize(@version.wiki_page_title)}, :class => 'icon icon-edit') unless @version.wiki_page_title.blank? || @project.wiki.nil? %> <%= call_hook(:view_versions_show_contextual, { :version => @version, :project => @project }) %> </div> diff --git a/app/views/wiki/_sidebar.rhtml b/app/views/wiki/_sidebar.rhtml index 7f60825aa..9a24963f2 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 => 'show', :page => nil} %><br /> +<%= link_to l(:field_start_page), {:action => 'show', :id => nil} %><br /> <%= link_to l(:label_index_by_title), {:action => '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 1e664fb84..dfea19581 100644 --- a/app/views/wiki/annotate.rhtml +++ b/app/views/wiki/annotate.rhtml @@ -1,12 +1,12 @@ <div class="contextual"> -<%= link_to(l(:button_edit), {:action => 'edit', :page => @page.title}, :class => 'icon icon-edit') %> -<%= link_to(l(:label_history), {:action => 'history', :page => @page.title}, :class => 'icon icon-history') %> +<%= 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> <h2><%= @page.pretty_title %></h2> <p> -<%= l(:label_version) %> <%= link_to @annotate.content.version, :action => 'show', :page => @page.title, :version => @annotate.content.version %> +<%= l(:label_version) %> <%= link_to @annotate.content.version, :action => 'show', :id => @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 => 'show', :project_id => @project, :page => @page.title, :version => line[0] %></td> + <td class="revision"><%= link_to line[0], :controller => 'wiki', :action => 'show', :project_id => @project, :id => @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 086d8f632..01385bc49 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 => 'show', :page => page.title %></li> + <li><%= link_to page.pretty_title, :action => 'show', :id => page.title %></li> <% end %> </ul> <% end %> diff --git a/app/views/wiki/destroy.rhtml b/app/views/wiki/destroy.rhtml index 99f470320..400230f89 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 => 'show', :project_id => @project, :page => @page.title %> +<%= link_to l(:button_cancel), :controller => 'wiki', :action => 'show', :project_id => @project, :id => @page.title %> <% end %> diff --git a/app/views/wiki/diff.rhtml b/app/views/wiki/diff.rhtml index a9eebdb9a..90478ed86 100644 --- a/app/views/wiki/diff.rhtml +++ b/app/views/wiki/diff.rhtml @@ -1,14 +1,14 @@ <div class="contextual"> -<%= link_to(l(:label_history), {:action => 'history', :page => @page.title}, :class => 'icon icon-history') %> +<%= link_to(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %> </div> <h2><%= @page.pretty_title %></h2> <p> -<%= l(:label_version) %> <%= link_to @diff.content_from.version, :action => 'show', :page => @page.title, :version => @diff.content_from.version %> +<%= l(:label_version) %> <%= link_to @diff.content_from.version, :action => 'show', :id => @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> → -<%= l(:label_version) %> <%= link_to @diff.content_to.version, :action => 'show', :page => @page.title, :version => @diff.content_to.version %>/<%= @page.content.version %> +<%= l(:label_version) %> <%= link_to @diff.content_to.version, :action => 'show', :id => @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/edit.rhtml b/app/views/wiki/edit.rhtml index b14bfb720..a140e2088 100644 --- a/app/views/wiki/edit.rhtml +++ b/app/views/wiki/edit.rhtml @@ -1,6 +1,6 @@ <h2><%=h @page.pretty_title %></h2> -<% form_for :content, @content, :url => {:action => 'update', :page => @page.title}, :html => {:multipart => true, :id => 'wiki_form'} do |f| %> +<% form_for :content, @content, :url => {:action => 'update', :id => @page.title}, :html => {:multipart => true, :id => 'wiki_form'} do |f| %> <%= f.hidden_field :version %> <%= error_messages_for 'content' %> @@ -10,7 +10,7 @@ <p><%= submit_tag l(:button_save) %> <%= link_to_remote l(:label_preview), - { :url => { :controller => 'wiki', :action => 'preview', :project_id => @project, :page => @page.title }, + { :url => { :controller => 'wiki', :action => 'preview', :project_id => @project, :id => @page.title }, :method => 'post', :update => 'preview', :with => "Form.serialize('wiki_form')", diff --git a/app/views/wiki/history.rhtml b/app/views/wiki/history.rhtml index 1f73fd173..5d44598f9 100644 --- a/app/views/wiki/history.rhtml +++ b/app/views/wiki/history.rhtml @@ -19,13 +19,13 @@ <% line_num = 1 %> <% @versions.each do |ver| %> <tr class="<%= cycle("odd", "even") %>"> - <td class="id"><%= link_to ver.version, :action => 'show', :page => @page.title, :version => ver.version %></td> + <td class="id"><%= link_to ver.version, :action => 'show', :id => @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> <td><%= link_to_user ver.author %></td> <td><%=h ver.comments %></td> - <td align="center"><%= link_to l(:button_annotate), :action => 'annotate', :page => @page.title, :version => ver.version %></td> + <td align="center"><%= link_to l(:button_annotate), :action => 'annotate', :id => @page.title, :version => ver.version %></td> </tr> <% line_num += 1 %> <% end %> diff --git a/app/views/wiki/show.rhtml b/app/views/wiki/show.rhtml index d8bc8c55e..173ac9ee2 100644 --- a/app/views/wiki/show.rhtml +++ b/app/views/wiki/show.rhtml @@ -1,25 +1,25 @@ <div class="contextual"> <% if @editable %> -<%= link_to_if_authorized(l(:button_edit), {:action => 'edit', :page => @page.title}, :class => 'icon icon-edit', :accesskey => accesskey(:edit)) if @content.version == @page.content.version %> +<%= 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 %> <%= watcher_tag(@page, User.current) %> -<%= link_to_if_authorized(l(:button_lock), {:action => 'protect', :page => @page.title, :protected => 1}, :method => :post, :class => 'icon icon-lock') if !@page.protected? %> -<%= link_to_if_authorized(l(:button_unlock), {:action => 'protect', :page => @page.title, :protected => 0}, :method => :post, :class => 'icon icon-unlock') if @page.protected? %> -<%= link_to_if_authorized(l(:button_rename), {:action => 'rename', :page => @page.title}, :class => 'icon icon-move') if @content.version == @page.content.version %> -<%= link_to_if_authorized(l(:button_delete), {:action => 'destroy', :page => @page.title}, :method => :delete, :confirm => l(:text_are_you_sure), :class => 'icon icon-del') %> -<%= link_to_if_authorized(l(:button_rollback), {:action => 'edit', :page => @page.title, :version => @content.version }, :class => 'icon icon-cancel') if @content.version < @page.content.version %> +<%= 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') if @content.version == @page.content.version %> +<%= link_to_if_authorized(l(:button_delete), {:action => 'destroy', :id => @page.title}, :method => :delete, :confirm => l(:text_are_you_sure), :class => 'icon icon-del') %> +<%= 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 %> <% end %> -<%= link_to_if_authorized(l(:label_history), {:action => 'history', :page => @page.title}, :class => 'icon icon-history') %> +<%= link_to_if_authorized(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %> </div> -<%= breadcrumb(@page.ancestors.reverse.collect {|parent| link_to h(parent.pretty_title), {:page => parent.title}}) %> +<%= breadcrumb(@page.ancestors.reverse.collect {|parent| link_to h(parent.pretty_title), {:id => parent.title}}) %> <% if @content.version != @page.content.version %> <p> - <%= link_to(('« ' + l(:label_previous)), :action => 'show', :page => @page.title, :version => (@content.version - 1)) + " - " if @content.version > 1 %> + <%= link_to(('« ' + l(:label_previous)), :action => 'show', :id => @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) + ' »'), :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) %> + <%= '(' + link_to('diff', :controller => 'wiki', :action => 'diff', :id => @page.title, :version => @content.version) + ')' if @content.version > 1 %> - + <%= link_to((l(:label_next) + ' »'), :action => 'show', :id => @page.title, :version => (@content.version + 1)) + " - " if @content.version < @page.content.version %> + <%= link_to(l(:label_current_version), :action => 'show', :id => @page.title) %> <br /> <em><%= @content.author ? @content.author.name : "anonyme" %>, <%= format_time(@content.updated_on) %> </em><br /> <%=h @content.comments %> @@ -35,7 +35,7 @@ <div id="wiki_add_attachment"> <p><%= link_to l(:label_attachment_new), {}, :onclick => "Element.show('add_attachment_form'); Element.hide(this); Element.scrollTo('add_attachment_form'); return false;", :id => 'attach_files_link' %></p> -<% form_tag({ :controller => 'wiki', :action => 'add_attachment', :project_id => @project, :page => @page.title }, :multipart => true, :id => "add_attachment_form", :style => "display:none;") do %> +<% form_tag({ :controller => 'wiki', :action => 'add_attachment', :project_id => @project, :id => @page.title }, :multipart => true, :id => "add_attachment_form", :style => "display:none;") do %> <div class="box"> <p><%= render :partial => 'attachments/form' %></p> </div> @@ -46,8 +46,8 @@ <% end %> <% other_formats_links do |f| %> - <%= f.link_to 'HTML', :url => {:page => @page.title, :version => @content.version} %> - <%= f.link_to 'TXT', :url => {:page => @page.title, :version => @content.version} %> + <%= f.link_to 'HTML', :url => {:id => @page.title, :version => @content.version} %> + <%= f.link_to 'TXT', :url => {:id => @page.title, :version => @content.version} %> <% end if User.current.allowed_to?(:export_wiki_pages, @project) %> <% content_for :header_tags do %> |