Commit 839757598bfa92da509ec52d696ed748d3c7b8d7
1 parent
8ffb6126
Exists in
master
and in
4 other branches
Wiki pages page
Showing
5 changed files
with
32 additions
and
2 deletions
Show diff stats
app/controllers/wikis_controller.rb
... | ... | @@ -6,6 +6,10 @@ class WikisController < ApplicationController |
6 | 6 | before_filter :authorize_admin_wiki!, :only => :destroy |
7 | 7 | layout "project" |
8 | 8 | |
9 | + def pages | |
10 | + @wikis = @project.wikis.group(:slug).order("created_at") | |
11 | + end | |
12 | + | |
9 | 13 | def show |
10 | 14 | if params[:old_page_id] |
11 | 15 | @wiki = @project.wikis.find(params[:old_page_id]) | ... | ... |
app/views/wikis/history.html.haml
... | ... | @@ -0,0 +1,18 @@ |
1 | +%h3.page_title All Pages | |
2 | +%br | |
3 | +%table.admin-table | |
4 | + %thead | |
5 | + %tr | |
6 | + %th Title | |
7 | + %th slug | |
8 | + %th created by | |
9 | + %tbody | |
10 | + - @wikis.each_with_index do |wiki_page, i| | |
11 | + %tr | |
12 | + %td | |
13 | + = link_to wiki_page.title, project_wiki_path(@project, wiki_page, :old_page_id => wiki_page.id) | |
14 | + (#{time_ago_in_words(wiki_page.created_at)} | |
15 | + ago) | |
16 | + %td= wiki_page.slug | |
17 | + %td= wiki_page.user.name | |
18 | + | ... | ... |
app/views/wikis/show.html.haml
1 | -%h3 | |
1 | +%h3.page_title | |
2 | 2 | = @wiki.title |
3 | 3 | %span.right |
4 | + = link_to pages_project_wikis_path(@project), :class => "btn small grouped" do | |
5 | + Pages | |
4 | 6 | - if can? current_user, :write_wiki, @project |
5 | 7 | = link_to history_project_wiki_path(@project, @wiki), :class => "btn small grouped" do |
6 | 8 | History | ... | ... |
config/routes.rb