diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2010-10-28 21:25:38 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2010-10-28 21:25:38 +0000 |
commit | c514dd6885af45ebb38d00ba4a8c61b1ea206d2c (patch) | |
tree | 1427bc497e59c610fc4c622ff55ffbb8704c0142 /app/views | |
parent | e7e7a91b857408557b037932de69f03c4bc6c9aa (diff) | |
download | redmine-c514dd6885af45ebb38d00ba4a8c61b1ea206d2c.tar.gz redmine-c514dd6885af45ebb38d00ba4a8c61b1ea206d2c.zip |
Refactor: convert WikiController to a REST resource
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4303 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/settings/_versions.rhtml | 2 | ||||
-rw-r--r-- | app/views/wiki/date_index.html.erb | 2 | ||||
-rw-r--r-- | app/views/wiki/edit.rhtml | 4 | ||||
-rw-r--r-- | app/views/wiki/history.rhtml | 2 | ||||
-rw-r--r-- | app/views/wiki/show.rhtml | 10 |
5 files changed, 10 insertions, 10 deletions
diff --git a/app/views/projects/settings/_versions.rhtml b/app/views/projects/settings/_versions.rhtml index eb04d6d43..c8a5db1cf 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', :id => 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', :action => 'show', :id => Wiki.titleize(version.wiki_page_title), :project_id => @project) 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/wiki/date_index.html.erb b/app/views/wiki/date_index.html.erb index 01385bc49..65af6084e 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', :id => page.title %></li> + <li><%= link_to page.pretty_title, :action => 'show', :id => page.title, :project_id => page.project %></li> <% end %> </ul> <% end %> diff --git a/app/views/wiki/edit.rhtml b/app/views/wiki/edit.rhtml index a140e2088..2615075e2 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', :id => @page.title}, :html => {:multipart => true, :id => 'wiki_form'} do |f| %> +<% form_for :content, @content, :url => {:action => 'update', :id => @page.title}, :html => {:method => :put, :multipart => true, :id => 'wiki_form'} do |f| %> <%= f.hidden_field :version %> <%= error_messages_for 'content' %> @@ -11,7 +11,7 @@ <p><%= submit_tag l(:button_save) %> <%= link_to_remote l(:label_preview), { :url => { :controller => 'wiki', :action => 'preview', :project_id => @project, :id => @page.title }, - :method => 'post', + :method => :post, :update => 'preview', :with => "Form.serialize('wiki_form')", :complete => "Element.scrollTo('preview')" diff --git a/app/views/wiki/history.rhtml b/app/views/wiki/history.rhtml index 5d44598f9..eac24705b 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 => 'show', :id => @page.title, :version => ver.version %></td> + <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}').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/show.rhtml b/app/views/wiki/show.rhtml index 173ac9ee2..9b2f2de28 100644 --- a/app/views/wiki/show.rhtml +++ b/app/views/wiki/show.rhtml @@ -11,15 +11,15 @@ <%= 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), {:id => parent.title}}) %> +<%= breadcrumb(@page.ancestors.reverse.collect {|parent| link_to h(parent.pretty_title), {:id => parent.title, :project_id => parent.project}}) %> <% if @content.version != @page.content.version %> <p> - <%= link_to(('« ' + l(:label_previous)), :action => 'show', :id => @page.title, :version => (@content.version - 1)) + " - " if @content.version > 1 %> + <%= link_to(('« ' + l(:label_previous)), :action => 'show', :id => @page.title, :project_id => @page.project, :version => (@content.version - 1)) + " - " if @content.version > 1 %> <%= "#{l(:label_version)} #{@content.version}/#{@page.content.version}" %> - <%= '(' + 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) %> + <%= '(' + link_to('diff', :controller => 'wiki', :action => 'diff', :id => @page.title, :project_id => @page.project, :version => @content.version) + ')' if @content.version > 1 %> - + <%= link_to((l(:label_next) + ' »'), :action => 'show', :id => @page.title, :project_id => @page.project, :version => (@content.version + 1)) + " - " if @content.version < @page.content.version %> + <%= link_to(l(:label_current_version), :action => 'show', :id => @page.title, :project_id => @page.project) %> <br /> <em><%= @content.author ? @content.author.name : "anonyme" %>, <%= format_time(@content.updated_on) %> </em><br /> <%=h @content.comments %> |