@@ -173,9 +173,6 class WikiController < ApplicationController | |||
|
173 | 173 | def special |
|
174 | 174 | page_title = params[:page].downcase |
|
175 | 175 | case page_title |
|
176 | # show pages index, sorted by title | |
|
177 | when 'date_index' | |
|
178 | load_pages_grouped_by_date_without_content | |
|
179 | 176 | when 'export' |
|
180 | 177 | redirect_to :action => 'export', :id => @project # Compatibility stub while refactoring |
|
181 | 178 | return |
@@ -201,6 +198,10 class WikiController < ApplicationController | |||
|
201 | 198 | def page_index |
|
202 | 199 | load_pages_grouped_by_date_without_content |
|
203 | 200 | end |
|
201 | ||
|
202 | def date_index | |
|
203 | load_pages_grouped_by_date_without_content | |
|
204 | end | |
|
204 | 205 | |
|
205 | 206 | def preview |
|
206 | 207 | page = @wiki.find_page(params[:page]) |
@@ -6,4 +6,4 | |||
|
6 | 6 | |
|
7 | 7 | <%= link_to l(:field_start_page), {:action => 'index', :page => nil} %><br /> |
|
8 | 8 | <%= link_to l(:label_index_by_title), {:action => 'page_index'} %><br /> |
|
9 |
<%= link_to l(:label_index_by_date), {:action => ' |
|
|
9 | <%= link_to l(:label_index_by_date), {:action => 'date_index'} %><br /> |
|
1 | NO CONTENT: file renamed from app/views/wiki/special_date_index.rhtml to app/views/wiki/date_index.html.erb |
@@ -31,7 +31,7 ActionController::Routing::Routes.draw do |map| | |||
|
31 | 31 | wiki_routes.with_options :conditions => {:method => :get} do |wiki_views| |
|
32 | 32 | wiki_views.connect 'projects/:id/wiki/export', :action => 'export' |
|
33 | 33 | wiki_views.connect 'projects/:id/wiki/page_index', :action => 'page_index' |
|
34 |
wiki_views.connect 'projects/:id/wiki/ |
|
|
34 | wiki_views.connect 'projects/:id/wiki/date_index', :action => 'date_index' | |
|
35 | 35 | wiki_views.connect 'projects/:id/wiki/:page', :action => 'index', :page => nil |
|
36 | 36 | wiki_views.connect 'projects/:id/wiki/:page/edit', :action => 'edit' |
|
37 | 37 | wiki_views.connect 'projects/:id/wiki/:page/rename', :action => 'rename' |
@@ -111,7 +111,7 Redmine::AccessControl.map do |map| | |||
|
111 | 111 | map.permission :manage_wiki, {:wikis => [:edit, :destroy]}, :require => :member |
|
112 | 112 | map.permission :rename_wiki_pages, {:wiki => :rename}, :require => :member |
|
113 | 113 | map.permission :delete_wiki_pages, {:wiki => :destroy}, :require => :member |
|
114 | map.permission :view_wiki_pages, :wiki => [:index, :special, :page_index] | |
|
114 | map.permission :view_wiki_pages, :wiki => [:index, :special, :page_index, :date_index] | |
|
115 | 115 | map.permission :export_wiki_pages, :wiki => [:export] |
|
116 | 116 | map.permission :view_wiki_edits, :wiki => [:history, :diff, :annotate] |
|
117 | 117 | map.permission :edit_wiki_pages, :wiki => [:edit, :preview, :add_attachment] |
@@ -284,6 +284,18 class WikiControllerTest < ActionController::TestCase | |||
|
284 | 284 | end |
|
285 | 285 | end |
|
286 | 286 | end |
|
287 | ||
|
288 | context "GET :date_index" do | |
|
289 | setup do | |
|
290 | get :date_index, :id => 'ecookbook' | |
|
291 | end | |
|
292 | ||
|
293 | should_respond_with :success | |
|
294 | should_assign_to :pages | |
|
295 | should_assign_to :pages_by_date | |
|
296 | should_render_template 'wiki/date_index' | |
|
297 | ||
|
298 | end | |
|
287 | 299 | |
|
288 | 300 | def test_not_found |
|
289 | 301 | get :index, :id => 999 |
@@ -319,7 +319,7 class RoutingTest < ActionController::IntegrationTest | |||
|
319 | 319 | should_route :get, "/projects/1/wiki/CookBook_documentation/annotate/2", :controller => 'wiki', :action => 'annotate', :id => '1', :page => 'CookBook_documentation', :version => '2' |
|
320 | 320 | should_route :get, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :id => '22', :page => 'ladida' |
|
321 | 321 | should_route :get, "/projects/567/wiki/page_index", :controller => 'wiki', :action => 'page_index', :id => '567' |
|
322 |
should_route :get, "/projects/567/wiki/date_index", :controller => 'wiki', :action => ' |
|
|
322 | should_route :get, "/projects/567/wiki/date_index", :controller => 'wiki', :action => 'date_index', :id => '567' | |
|
323 | 323 | should_route :get, "/projects/567/wiki/export", :controller => 'wiki', :action => 'export', :id => '567' |
|
324 | 324 | |
|
325 | 325 | should_route :post, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :id => '567', :page => 'my_page' |
General Comments 0
You need to be logged in to leave comments.
Login now