gitlab-org--gitlab-foss/app/views/projects/wikis/_main_links.html.haml
TM Lee 333e39d492 [#28991] Wiki page edit button only appears on the current commit page
- Added method to check if the current Page version is the current latest version
- Conditionally checks for current version when showing Edit button
- Added feature specs for viewing project wiki page and expect edit button
- Added Changelog
2017-03-16 09:08:00 +08:00

9 lines
492 B
Text

- if (@page && @page.persisted?)
- if can?(current_user, :create_wiki, @project)
= link_to '#modal-new-wiki', class: "add-new-wiki btn btn-new", "data-toggle" => "modal" do
New Page
= link_to namespace_project_wiki_history_path(@project.namespace, @project, @page), class: "btn" do
Page History
- if can?(current_user, :create_wiki, @project) && @page.latest?
= link_to namespace_project_wiki_edit_path(@project.namespace, @project, @page), class: "btn" do
Edit