Commit 0e387919 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fixed wrong last-edit time for wiki

parent ffa234bc
...@@ -89,6 +89,10 @@ class WikiPage ...@@ -89,6 +89,10 @@ class WikiPage
@page.versions.map { |v| Commit.new(Gitlab::Git::Commit.new(v)) } @page.versions.map { |v| Commit.new(Gitlab::Git::Commit.new(v)) }
end end
def commit
versions.first
end
# Returns the Date that this latest version was # Returns the Date that this latest version was
# created on. # created on.
def created_at def created_at
......
...@@ -44,4 +44,3 @@ ...@@ -44,4 +44,3 @@
%hr %hr
= link_to @project.gitlab_ci_service.builds_path do = link_to @project.gitlab_ci_service.builds_path do
= image_tag @project.gitlab_ci_service.status_img_path, alt: "build status" = image_tag @project.gitlab_ci_service.status_img_path, alt: "build status"
%span.pull-right %span.pull-right
- if (@wiki && @wiki.persisted?) - if (@wiki && @wiki.persisted?)
= link_to history_project_wiki_path(@project, @wiki), class: "btn btn-small grouped" do = link_to history_project_wiki_path(@project, @wiki), class: "btn grouped" do
Page History Page History
- if can?(current_user, :write_wiki, @project) - if can?(current_user, :write_wiki, @project)
= link_to edit_project_wiki_path(@project, @wiki), class: "btn btn-small grouped" do = link_to edit_project_wiki_path(@project, @wiki), class: "btn grouped" do
%i.icon-edit %i.icon-edit
Edit Edit
= render 'nav' = render 'nav'
%h3.page-title %h3.page-title
%span.light History for %span.light History for
= @wiki.title.titleize = link_to @wiki.title.titleize, project_wiki_path(@project, @wiki)
= render 'main_links'
%br
%table %table
%thead %thead
%tr %tr
......
= render 'nav' = render 'nav'
%h3.page-title %h3.page-title
All Pages All Pages
= render 'main_links' %ul.bordered-list
%br - @wiki_pages.each do |wiki_page|
%table %li
%thead %h4
%tr = link_to wiki_page.title.titleize, project_wiki_path(@project, wiki_page)
%th Title %small (#{wiki_page.format})
%th Format .pull-right
%th Last updated %small Last edited #{time_ago_in_words(wiki_page.commit.created_at)} ago
%th Updated by
%tbody
- @wiki_pages.each do |wiki_page|
%tr
%td
%strong= link_to wiki_page.title.titleize, project_wiki_path(@project, wiki_page)
%td
%strong= wiki_page.format
%td
= wiki_page.created_at.to_s(:short) do
(#{time_ago_in_words(wiki_page.created_at)}
ago)
%td
= commit_author_link(wiki_page.version, avatar: true, size: 24)
...@@ -12,4 +12,4 @@ ...@@ -12,4 +12,4 @@
= preserve do = preserve do
= render_wiki_content(@wiki) = render_wiki_content(@wiki)
%p.time Last edited by #{commit_author_link(@wiki.version, avatar: true, size: 16)} #{time_ago_in_words @wiki.created_at} ago %p.time Last edited by #{commit_author_link(@wiki.commit, avatar: true, size: 16)} #{time_ago_in_words @wiki.commit.created_at} ago
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment