Commit b55ed840e63088e28127f9989fc69d49345a0083

Authored by Riyad Preukschas
1 parent b3bfb752

Update wiki pages

* Properly name columns in Pages and History views
* Link to Authors
* Make views more consistent
app/views/wikis/history.html.haml
1 1 %h3.page_title
2 2 %span.cgray History for
3   - = @wikis.last.title
  3 + = @wiki_pages.first.title
4 4 %br
5 5 %table
6 6 %thead
7 7 %tr
8   - %th #
9   - %th last edit
10   - %th created by
  8 + %th Page version
  9 + %th Last updated
  10 + %th Updated by
11 11 %tbody
12   - - @wikis.each_with_index do |wiki_page, i|
  12 + - @wiki_pages.each_with_index do |wiki_page, i|
13 13 %tr
14   - %td= i + 1
15 14 %td
16   - = link_to wiki_page.created_at.to_s(:short), project_wiki_path(@project, wiki_page, old_page_id: wiki_page.id)
  15 + %strong
  16 + = link_to project_wiki_path(@project, wiki_page, version_id: wiki_page.id) do
  17 + Version
  18 + = @wiki_pages.count - i
  19 + %td
  20 + = wiki_page.created_at.to_s(:short)
17 21 (#{time_ago_in_words(wiki_page.created_at)}
18 22 ago)
19   - %td= wiki_page.user.name
20   -
  23 + %td= link_to_member(@project, wiki_page.user)
... ...
app/views/wikis/pages.html.haml
... ... @@ -4,15 +4,17 @@
4 4 %thead
5 5 %tr
6 6 %th Title
7   - %th slug
8   - %th created by
  7 + %th Slug
  8 + %th Last updated
  9 + %th Updated by
9 10 %tbody
10   - - @wikis.each_with_index do |wiki_page, i|
  11 + - @wiki_pages.each do |wiki_page|
11 12 %tr
12 13 %td
13   - = link_to wiki_page.title, project_wiki_path(@project, wiki_page)
14   - (#{time_ago_in_words(wiki_page.created_at)}
15   - ago)
  14 + %strong= link_to wiki_page.title, project_wiki_path(@project, wiki_page)
16 15 %td= wiki_page.slug
17   - %td= wiki_page.user.name
18   -
  16 + %td
  17 + = wiki_page.created_at.to_s(:short) do
  18 + (#{time_ago_in_words(wiki_page.created_at)}
  19 + ago)
  20 + %td= link_to_member(@project, wiki_page.user)
... ...
app/views/wikis/show.html.haml
... ... @@ -15,4 +15,4 @@
15 15 = preserve do
16 16 = markdown @wiki.content
17 17  
18   -%p.time Last edited by #{@wiki.user.name}, #{time_ago_in_words @wiki.created_at} ago
  18 +%p.time Last edited by #{link_to_member @project, @wiki.user}, #{time_ago_in_words @wiki.created_at} ago
... ...