Added wiki index by date.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@768 e93f8b46-1217-0410-a6f0-8f06a7374b81
pull/351/head
Jean-Philippe Lang 17 years ago
parent d823c28484
commit 20aff7cc70
  1. 3
      app/controllers/wiki_controller.rb
  2. 5
      app/views/wiki/_sidebar.rhtml
  3. 25
      app/views/wiki/special_date_index.rhtml
  4. 24
      app/views/wiki/special_page_index.rhtml
  5. 3
      lang/bg.yml
  6. 3
      lang/cs.yml
  7. 3
      lang/de.yml
  8. 3
      lang/en.yml
  9. 3
      lang/es.yml
  10. 3
      lang/fr.yml
  11. 3
      lang/it.yml
  12. 3
      lang/ja.yml
  13. 3
      lang/nl.yml
  14. 3
      lang/pl.yml
  15. 3
      lang/pt-br.yml
  16. 3
      lang/pt.yml
  17. 3
      lang/sv.yml
  18. 3
      lang/zh.yml

@ -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'

@ -1,4 +1,5 @@
<h3><%= l(:label_wiki) %></h3>
<%= link_to l(:label_page_index), {:action => 'special', :page => 'Page_index'} %>
<%= link_to l(:field_start_page), {:action => 'index', :page => nil} %><br />
<%= link_to l(:label_index_by_title), {:action => 'special', :page => 'Page_index'} %><br />
<%= link_to l(:label_index_by_date), {:action => 'special', :page => 'Date_index'} %><br />

@ -0,0 +1,25 @@
<h2><%= l(:label_index_by_date) %></h2>
<% if @pages.empty? %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>
<% @pages_by_date.keys.sort.reverse.each do |date| %>
<h3><%= format_date(date) %></h3>
<ul>
<% @pages_by_date[date].each do |page| %>
<li><%= link_to page.pretty_title, :action => 'index', :page => page.title %></li>
<% end %>
</ul>
<% end %>
<% content_for :sidebar do %>
<%= render :partial => 'sidebar' %>
<% end %>
<div class="contextual">
<% unless @pages.empty? %>
<%= l(:label_export_to) %> <%= link_to 'HTML', {:action => 'special', :page => 'export'}, :class => 'icon icon-html' %>
<% end %>
</div>
&nbsp;

@ -1,13 +1,21 @@
<div class="contextual">
<% unless @pages.empty? %>
<%= l(:label_export_to) %> <%= link_to 'HTML', {:action => 'special', :page => 'export'}, :class => 'icon icon-html' %>
<% end %>
</div>
<h2><%= l(:label_index_by_title) %></h2>
<h2><%= l(:label_page_index) %></h2>
<% if @pages.empty? %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>
<% if @pages.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %>
<ul><% @pages.each do |page| %>
<li><%= link_to page.pretty_title, :action => 'index', :page => page.title %> -
<%= l(:label_last_updates) %>: <%= format_time(page.updated_on) %></li>
<% end %></ul>
<% end %></ul>
<% content_for :sidebar do %>
<%= render :partial => 'sidebar' %>
<% end %>
<div class="contextual">
<% unless @pages.empty? %>
<%= l(:label_export_to) %> <%= link_to 'HTML', {:action => 'special', :page => 'export'}, :class => 'icon icon-html' %>
<% end %>
</div>
&nbsp;

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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: フィード

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

Loading…
Cancel
Save