diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2010-10-25 16:16:46 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2010-10-25 16:16:46 +0000 |
commit | 4b045badcfde2eb27b63023ca8f3c30334d7f00f (patch) | |
tree | f79e433aea72c3b42f50065a26ffd6da535d229f /app | |
parent | 0e951c071631fee35962b264d3db2c68961bf670 (diff) | |
download | redmine-4b045badcfde2eb27b63023ca8f3c30334d7f00f.tar.gz redmine-4b045badcfde2eb27b63023ca8f3c30334d7f00f.zip |
Refactor: Rename WikiController#page_index to #index
index is the action that should list a collection of records, which is
what #page_index does.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4290 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/wiki_controller.rb | 25 | ||||
-rw-r--r-- | app/views/wiki/_sidebar.rhtml | 2 | ||||
-rw-r--r-- | app/views/wiki/index.html.erb (renamed from app/views/wiki/page_index.html.erb) | 0 |
3 files changed, 21 insertions, 6 deletions
diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index 1c42ab5cd..c7b866239 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -17,6 +17,20 @@ require 'diff' +# The WikiController follows the Rails REST controller pattern but with +# a few differences +# +# * index - shows a list of WikiPages grouped by page or date +# * new - not used +# * create - not used +# * show - will also show the form for creating a new wiki page +# * edit - used to edit an existing or new page +# * update - used to save a wiki page update to the database, including new pages +# * destroy - normal +# +# Other member and collection methods are also used +# +# TODO: still being worked on class WikiController < ApplicationController default_search_scope :wiki_pages before_filter :find_wiki, :authorize @@ -28,6 +42,11 @@ class WikiController < ApplicationController include AttachmentsHelper helper :watchers + # List of pages, sorted alphabetically and by parent (hierarchy) + def index + load_pages_grouped_by_date_without_content + end + # display a page (in editing mode if it doesn't exist) def show page_title = params[:page] @@ -180,7 +199,7 @@ class WikiController < ApplicationController end end @page.destroy - redirect_to :action => 'page_index', :project_id => @project + redirect_to :action => 'index', :project_id => @project end # Export wiki to a single html file @@ -194,10 +213,6 @@ class WikiController < ApplicationController end end - def page_index - load_pages_grouped_by_date_without_content - end - def date_index load_pages_grouped_by_date_without_content end diff --git a/app/views/wiki/_sidebar.rhtml b/app/views/wiki/_sidebar.rhtml index efb24af06..7f60825aa 100644 --- a/app/views/wiki/_sidebar.rhtml +++ b/app/views/wiki/_sidebar.rhtml @@ -5,5 +5,5 @@ <h3><%= l(:label_wiki) %></h3> <%= 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_title), {:action => 'index'} %><br /> <%= link_to l(:label_index_by_date), {:action => 'date_index'} %><br /> diff --git a/app/views/wiki/page_index.html.erb b/app/views/wiki/index.html.erb index 7e7155fda..7e7155fda 100644 --- a/app/views/wiki/page_index.html.erb +++ b/app/views/wiki/index.html.erb |