diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-01-13 21:02:25 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-01-13 21:02:25 +0300 |
commit | 9ce7492e58d3a90cfd9a07be6ba5b0f4fafe7bc8 (patch) | |
tree | 64984c999e9faa4a526bce0927f7732367e8b0b2 /app | |
parent | 1f01fcdc0ce9e55ade53fd21fd1d60a778268243 (diff) | |
parent | c13f420b663af3eca6a8c11c7c9c5b3aa684336b (diff) |
Merge pull request #8540 from yglukhov/wiki-history
First entry in wiki history leads to newest revision.
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/projects_helper.rb | 5 | ||||
-rw-r--r-- | app/views/projects/wikis/history.html.haml | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index e489d431e84..786a386c0ea 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -237,4 +237,9 @@ module ProjectsHelper result.password = '*****' if result.password.present? result end + + def project_wiki_path_with_version(proj, page, version, is_newest) + url_params = is_newest ? {} : { version_id: version } + project_wiki_path(proj, page, url_params) + end end diff --git a/app/views/projects/wikis/history.html.haml b/app/views/projects/wikis/history.html.haml index ef4b8f74714..b30eff94f2c 100644 --- a/app/views/projects/wikis/history.html.haml +++ b/app/views/projects/wikis/history.html.haml @@ -12,11 +12,12 @@ %th Last updated %th Format %tbody - - @page.versions.each do |version| + - @page.versions.each_with_index do |version, index| - commit = version %tr %td - = link_to project_wiki_path(@project, @page, version_id: commit.id) do + = link_to project_wiki_path_with_version(@project, @page, + commit.id, index == 0) do = truncate_sha(commit.id) %td = commit.author.name |