Commit 0e387919c3827260434aed48e1f28ee02ce5e58d
1 parent
ffa234bc
Exists in
master
and in
4 other branches
Fixed wrong last-edit time for wiki
Showing
6 changed files
with
17 additions
and
29 deletions
Show diff stats
app/models/wiki_page.rb
app/views/projects/show.html.haml
app/views/projects/wikis/_main_links.html.haml
| 1 | 1 | %span.pull-right |
| 2 | 2 | - if (@wiki && @wiki.persisted?) |
| 3 | - = link_to history_project_wiki_path(@project, @wiki), class: "btn btn-small grouped" do | |
| 3 | + = link_to history_project_wiki_path(@project, @wiki), class: "btn grouped" do | |
| 4 | 4 | Page History |
| 5 | 5 | - if can?(current_user, :write_wiki, @project) |
| 6 | - = link_to edit_project_wiki_path(@project, @wiki), class: "btn btn-small grouped" do | |
| 6 | + = link_to edit_project_wiki_path(@project, @wiki), class: "btn grouped" do | |
| 7 | 7 | %i.icon-edit |
| 8 | 8 | Edit | ... | ... |
app/views/projects/wikis/history.html.haml
app/views/projects/wikis/pages.html.haml
| 1 | 1 | = render 'nav' |
| 2 | 2 | %h3.page-title |
| 3 | 3 | All Pages |
| 4 | - = render 'main_links' | |
| 5 | -%br | |
| 6 | -%table | |
| 7 | - %thead | |
| 8 | - %tr | |
| 9 | - %th Title | |
| 10 | - %th Format | |
| 11 | - %th Last updated | |
| 12 | - %th Updated by | |
| 13 | - %tbody | |
| 14 | - - @wiki_pages.each do |wiki_page| | |
| 15 | - %tr | |
| 16 | - %td | |
| 17 | - %strong= link_to wiki_page.title.titleize, project_wiki_path(@project, wiki_page) | |
| 18 | - %td | |
| 19 | - %strong= wiki_page.format | |
| 20 | - %td | |
| 21 | - = wiki_page.created_at.to_s(:short) do | |
| 22 | - (#{time_ago_in_words(wiki_page.created_at)} | |
| 23 | - ago) | |
| 24 | - %td | |
| 25 | - = commit_author_link(wiki_page.version, avatar: true, size: 24) | |
| 4 | +%ul.bordered-list | |
| 5 | + - @wiki_pages.each do |wiki_page| | |
| 6 | + %li | |
| 7 | + %h4 | |
| 8 | + = link_to wiki_page.title.titleize, project_wiki_path(@project, wiki_page) | |
| 9 | + %small (#{wiki_page.format}) | |
| 10 | + .pull-right | |
| 11 | + %small Last edited #{time_ago_in_words(wiki_page.commit.created_at)} ago | ... | ... |
app/views/projects/wikis/show.html.haml
| ... | ... | @@ -12,4 +12,4 @@ |
| 12 | 12 | = preserve do |
| 13 | 13 | = render_wiki_content(@wiki) |
| 14 | 14 | |
| 15 | -%p.time Last edited by #{commit_author_link(@wiki.version, avatar: true, size: 16)} #{time_ago_in_words @wiki.created_at} ago | |
| 15 | +%p.time Last edited by #{commit_author_link(@wiki.commit, avatar: true, size: 16)} #{time_ago_in_words @wiki.commit.created_at} ago | ... | ... |