diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index 5bade625e7..e3c9ed2024 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -121,11 +121,12 @@ class WikiController < ApplicationController page_title = params[:page].downcase case page_title # show pages index, sorted by title - when 'page_index' + when 'page_index', 'date_index' # eager load information about last updates, without loading text @pages = @wiki.pages.find :all, :select => "#{WikiPage.table_name}.*, #{WikiContent.table_name}.updated_on", :joins => "LEFT JOIN #{WikiContent.table_name} ON #{WikiContent.table_name}.page_id = #{WikiPage.table_name}.id", :order => 'title' + @pages_by_date = @pages.group_by {|p| p.updated_on.to_date} # export wiki to a single html file when 'export' @pages = @wiki.pages.find :all, :order => 'title' diff --git a/app/views/wiki/_sidebar.rhtml b/app/views/wiki/_sidebar.rhtml index b45aa7233a..20c0871237 100644 --- a/app/views/wiki/_sidebar.rhtml +++ b/app/views/wiki/_sidebar.rhtml @@ -1,4 +1,5 @@

<%= l(:label_wiki) %>

-<%= link_to l(:label_page_index), {:action => 'special', :page => 'Page_index'} %> - +<%= link_to l(:field_start_page), {:action => 'index', :page => nil} %>
+<%= link_to l(:label_index_by_title), {:action => 'special', :page => 'Page_index'} %>
+<%= link_to l(:label_index_by_date), {:action => 'special', :page => 'Date_index'} %>
diff --git a/app/views/wiki/special_date_index.rhtml b/app/views/wiki/special_date_index.rhtml new file mode 100644 index 0000000000..ac68f809e7 --- /dev/null +++ b/app/views/wiki/special_date_index.rhtml @@ -0,0 +1,25 @@ +

<%= l(:label_index_by_date) %>

+ +<% if @pages.empty? %> +

<%= l(:label_no_data) %>

+<% end %> + +<% @pages_by_date.keys.sort.reverse.each do |date| %> +

<%= format_date(date) %>

+ +<% end %> + +<% content_for :sidebar do %> + <%= render :partial => 'sidebar' %> +<% end %> + +
+<% unless @pages.empty? %> +<%= l(:label_export_to) %> <%= link_to 'HTML', {:action => 'special', :page => 'export'}, :class => 'icon icon-html' %> +<% end %> +
+  diff --git a/app/views/wiki/special_page_index.rhtml b/app/views/wiki/special_page_index.rhtml index ba3cfeed10..8d3cd8a42d 100644 --- a/app/views/wiki/special_page_index.rhtml +++ b/app/views/wiki/special_page_index.rhtml @@ -1,13 +1,21 @@ -
-<% unless @pages.empty? %> -<%= l(:label_export_to) %> <%= link_to 'HTML', {:action => 'special', :page => 'export'}, :class => 'icon icon-html' %> -<% end %> -
+

<%= l(:label_index_by_title) %>

-

<%= l(:label_page_index) %>

+<% if @pages.empty? %> +

<%= l(:label_no_data) %>

+<% end %> -<% if @pages.empty? %>

<%= l(:label_no_data) %>

<% end %> \ No newline at end of file +<% end %> + +<% content_for :sidebar do %> + <%= render :partial => 'sidebar' %> +<% end %> + +
+<% unless @pages.empty? %> +<%= l(:label_export_to) %> <%= link_to 'HTML', {:action => 'special', :page => 'export'}, :class => 'icon icon-html' %> +<% end %> +
+  diff --git a/lang/bg.yml b/lang/bg.yml index 01a5f350e1..c15abfea4b 100644 --- a/lang/bg.yml +++ b/lang/bg.yml @@ -357,7 +357,8 @@ label_wiki_edit: Wiki редакция label_wiki_edit_plural: Wiki редакции label_wiki_page: Wiki page label_wiki_page_plural: Wiki pages -label_page_index: Индекс +label_index_by_title: Индекс +label_index_by_date: Index by date label_current_version: Текуща версия label_preview: Преглед label_feed_plural: Feeds diff --git a/lang/cs.yml b/lang/cs.yml index 5cadd654fb..8a68d95b89 100644 --- a/lang/cs.yml +++ b/lang/cs.yml @@ -355,7 +355,8 @@ label_wiki_edit: Wiki úprava label_wiki_edit_plural: Wiki úpravy label_wiki_page: Wiki stránka label_wiki_page_plural: Wiki stránky -label_page_index: Rejstřík +label_index_by_title: Rejstřík +label_index_by_date: Index by date label_current_version: Aktuální verze label_preview: Náhled label_feed_plural: Feeds diff --git a/lang/de.yml b/lang/de.yml index a1182f207d..2fb1b1e92c 100644 --- a/lang/de.yml +++ b/lang/de.yml @@ -357,7 +357,8 @@ label_wiki_edit: Wiki-Bearbeitung label_wiki_edit_plural: Wiki-Bearbeitungen label_wiki_page: Wiki-Seite label_wiki_page_plural: Wiki-Seiten -label_page_index: Index +label_index_by_title: Index by title +label_index_by_date: Index by date label_current_version: Gegenwärtige Version label_preview: Vorschau label_feed_plural: Feeds diff --git a/lang/en.yml b/lang/en.yml index 0be3071bbb..9246c9442f 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -357,7 +357,8 @@ label_wiki_edit: Wiki edit label_wiki_edit_plural: Wiki edits label_wiki_page: Wiki page label_wiki_page_plural: Wiki pages -label_page_index: Index +label_index_by_title: Index by title +label_index_by_date: Index by date label_current_version: Current version label_preview: Preview label_feed_plural: Feeds diff --git a/lang/es.yml b/lang/es.yml index cc67ea6748..09017909d7 100644 --- a/lang/es.yml +++ b/lang/es.yml @@ -357,7 +357,8 @@ label_wiki_edit: Wiki edit label_wiki_edit_plural: Wiki edits label_wiki_page: Wiki page label_wiki_page_plural: Wiki pages -label_page_index: Índice +label_index_by_title: Index by title +label_index_by_date: Index by date label_current_version: Versión actual label_preview: Previo label_feed_plural: Feeds diff --git a/lang/fr.yml b/lang/fr.yml index 06665af260..3f5371daa3 100644 --- a/lang/fr.yml +++ b/lang/fr.yml @@ -357,7 +357,8 @@ label_wiki_edit: Révision wiki label_wiki_edit_plural: Révisions wiki label_wiki_page: Page wiki label_wiki_page_plural: Pages wiki -label_page_index: Index +label_index_by_title: Index par titre +label_index_by_date: Index par date label_current_version: Version actuelle label_preview: Prévisualisation label_feed_plural: Flux RSS diff --git a/lang/it.yml b/lang/it.yml index 451e443af2..73aa3437b7 100644 --- a/lang/it.yml +++ b/lang/it.yml @@ -357,7 +357,8 @@ label_wiki_edit: Modifica Wiki label_wiki_edit_plural: Modfiche wiki label_wiki_page: Wiki page label_wiki_page_plural: Wiki pages -label_page_index: Indice +label_index_by_title: Index by title +label_index_by_date: Index by date label_current_version: Versione corrente label_preview: Anteprima label_feed_plural: Feed diff --git a/lang/ja.yml b/lang/ja.yml index a70e1e94a9..1e49779080 100644 --- a/lang/ja.yml +++ b/lang/ja.yml @@ -358,7 +358,8 @@ label_wiki_edit: Wiki編集 label_wiki_edit_plural: Wiki編集 label_wiki_page: Wiki page label_wiki_page_plural: Wikiページ -label_page_index: 索引 +label_index_by_title: 索引 +label_index_by_date: Index by date label_current_version: 最新版 label_preview: プレビュー label_feed_plural: フィード diff --git a/lang/nl.yml b/lang/nl.yml index 473ef061bc..0c862ab300 100644 --- a/lang/nl.yml +++ b/lang/nl.yml @@ -357,7 +357,8 @@ label_wiki_edit: Wiki edit label_wiki_edit_plural: Wiki edits label_wiki_page: Wiki page label_wiki_page_plural: Wiki pages -label_page_index: Index +label_index_by_title: Index by title +label_index_by_date: Index by date label_current_version: Huidige versie label_preview: Testweergave label_feed_plural: Feeds diff --git a/lang/pl.yml b/lang/pl.yml index a0dc73cc87..235231ddf5 100644 --- a/lang/pl.yml +++ b/lang/pl.yml @@ -348,7 +348,8 @@ label_wiki_edit: Edycja wiki label_wiki_edit_plural: Edycje wiki label_wiki_page: Strona wiki label_wiki_page_plural: Strony wiki -label_page_index: Indeks +label_index_by_title: Indeks +label_index_by_date: Index by date label_current_version: Obecna wersja label_preview: Podgląd label_feed_plural: Ilość RSS diff --git a/lang/pt-br.yml b/lang/pt-br.yml index 449067449d..afcd4cb27d 100644 --- a/lang/pt-br.yml +++ b/lang/pt-br.yml @@ -357,7 +357,8 @@ label_wiki_edit: Wiki edit label_wiki_edit_plural: Wiki edits label_wiki_page: Wiki page label_wiki_page_plural: Wiki pages -label_page_index: Index +label_index_by_title: Index by title +label_index_by_date: Index by date label_current_version: Versao atual label_preview: Previa label_feed_plural: Feeds diff --git a/lang/pt.yml b/lang/pt.yml index 62df91dfb0..2ce44f49b9 100644 --- a/lang/pt.yml +++ b/lang/pt.yml @@ -357,7 +357,8 @@ label_wiki_edit: Wiki edit label_wiki_edit_plural: Wiki edits label_wiki_page: Wiki page label_wiki_page_plural: Wiki pages -label_page_index: Index +label_index_by_title: Index by title +label_index_by_date: Index by date label_current_version: Versão atual label_preview: Prévia label_feed_plural: Feeds diff --git a/lang/sv.yml b/lang/sv.yml index 1e3c905648..adcd28879f 100644 --- a/lang/sv.yml +++ b/lang/sv.yml @@ -357,7 +357,8 @@ label_wiki_edit: Wiki editera label_wiki_edit_plural: Wiki editeringar label_wiki_page: Wiki page label_wiki_page_plural: Wiki pages -label_page_index: Index +label_index_by_title: Index by title +label_index_by_date: Index by date label_current_version: Nuvarande version label_preview: Preview label_feed_plural: Feeder diff --git a/lang/zh.yml b/lang/zh.yml index 47f8e861b5..c3edc03083 100644 --- a/lang/zh.yml +++ b/lang/zh.yml @@ -359,7 +359,8 @@ label_wiki: Wiki label_wiki_edit: Wiki edit label_wiki_edit_plural: Wiki edits label_wiki_page_plural: Wiki pages -label_page_index: 索引 +label_index_by_title: 索引 +label_index_by_date: Index by date label_current_version: 当前版本 label_preview: 预览 label_feed_plural: Feeds