From b55ed840e63088e28127f9989fc69d49345a0083 Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Fri, 11 Jan 2013 20:20:11 +0100 Subject: [PATCH] Update wiki pages * Properly name columns in Pages and History views * Link to Authors * Make views more consistent --- app/views/wikis/history.html.haml | 21 ++++++++++++--------- app/views/wikis/pages.html.haml | 18 ++++++++++-------- app/views/wikis/show.html.haml | 2 +- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/app/views/wikis/history.html.haml b/app/views/wikis/history.html.haml index 0a81817c5..18df8e1d7 100644 --- a/app/views/wikis/history.html.haml +++ b/app/views/wikis/history.html.haml @@ -1,20 +1,23 @@ %h3.page_title %span.cgray History for - = @wikis.last.title + = @wiki_pages.first.title %br %table %thead %tr - %th # - %th last edit - %th created by + %th Page version + %th Last updated + %th Updated by %tbody - - @wikis.each_with_index do |wiki_page, i| + - @wiki_pages.each_with_index do |wiki_page, i| %tr - %td= i + 1 %td - = link_to wiki_page.created_at.to_s(:short), project_wiki_path(@project, wiki_page, old_page_id: wiki_page.id) + %strong + = link_to project_wiki_path(@project, wiki_page, version_id: wiki_page.id) do + Version + = @wiki_pages.count - i + %td + = wiki_page.created_at.to_s(:short) (#{time_ago_in_words(wiki_page.created_at)} ago) - %td= wiki_page.user.name - + %td= link_to_member(@project, wiki_page.user) diff --git a/app/views/wikis/pages.html.haml b/app/views/wikis/pages.html.haml index 04253a896..2e0f091ce 100644 --- a/app/views/wikis/pages.html.haml +++ b/app/views/wikis/pages.html.haml @@ -4,15 +4,17 @@ %thead %tr %th Title - %th slug - %th created by + %th Slug + %th Last updated + %th Updated by %tbody - - @wikis.each_with_index do |wiki_page, i| + - @wiki_pages.each do |wiki_page| %tr %td - = link_to wiki_page.title, project_wiki_path(@project, wiki_page) - (#{time_ago_in_words(wiki_page.created_at)} - ago) + %strong= link_to wiki_page.title, project_wiki_path(@project, wiki_page) %td= wiki_page.slug - %td= wiki_page.user.name - + %td + = wiki_page.created_at.to_s(:short) do + (#{time_ago_in_words(wiki_page.created_at)} + ago) + %td= link_to_member(@project, wiki_page.user) diff --git a/app/views/wikis/show.html.haml b/app/views/wikis/show.html.haml index 299560201..ea23f62c2 100644 --- a/app/views/wikis/show.html.haml +++ b/app/views/wikis/show.html.haml @@ -15,4 +15,4 @@ = preserve do = markdown @wiki.content -%p.time Last edited by #{@wiki.user.name}, #{time_ago_in_words @wiki.created_at} ago +%p.time Last edited by #{link_to_member @project, @wiki.user}, #{time_ago_in_words @wiki.created_at} ago -- 2.11.0