before_filter :authorize_admin_wiki!, :only => :destroy
layout "project"
+ def pages
+ @wikis = @project.wikis.group(:slug).order("created_at")
+ end
+
def show
if params[:old_page_id]
@wiki = @project.wikis.find(params[:old_page_id])
-%h3.page_title Versions
+%h3.page_title
+ %span.cgray History for
+ = @wikis.last.title
%br
%table.admin-table
%thead
--- /dev/null
+%h3.page_title All Pages
+%br
+%table.admin-table
+ %thead
+ %tr
+ %th Title
+ %th slug
+ %th created by
+ %tbody
+ - @wikis.each_with_index do |wiki_page, i|
+ %tr
+ %td
+ = link_to wiki_page.title, project_wiki_path(@project, wiki_page, :old_page_id => wiki_page.id)
+ (#{time_ago_in_words(wiki_page.created_at)}
+ ago)
+ %td= wiki_page.slug
+ %td= wiki_page.user.name
+
-%h3
+%h3.page_title
= @wiki.title
%span.right
+ = link_to pages_project_wikis_path(@project), :class => "btn small grouped" do
+ Pages
- if can? current_user, :write_wiki, @project
= link_to history_project_wiki_path(@project, @wiki), :class => "btn small grouped" do
History
end
resources :wikis, :only => [:show, :edit, :destroy, :create] do
+ collection do
+ get :pages
+ end
+
member do
get "history"
end