Skip to content
代码片段 群组 项目
提交 ce2991b8 编辑于 作者: Tom Quirk's avatar Tom Quirk 提交者: Denys Mishunov
浏览文件

Move wiki edit button inline with wiki title

And update QA tests to reflect this change.

Includes changelog.
上级 4f4e34fe
No related branches found
No related tags found
无相关合并请求
- if @page&.persisted? - if @page&.persisted?
- if can?(current_user, :create_wiki, @wiki.container)
= link_to wiki_path(@wiki, action: :new), class: "btn gl-button btn-success", role: "button", data: { qa_selector: 'new_page_button' } do
= s_("Wiki|New page")
= link_to wiki_page_path(@wiki, @page, action: :history), class: "btn gl-button", role: "button", data: { qa_selector: 'page_history_button' } do = link_to wiki_page_path(@wiki, @page, action: :history), class: "btn gl-button", role: "button", data: { qa_selector: 'page_history_button' } do
= s_("Wiki|Page history") = s_("Wiki|Page history")
- if can?(current_user, :create_wiki, @wiki.container) && @page.latest? && @valid_encoding - if can?(current_user, :create_wiki, @wiki.container)
= link_to wiki_page_path(@wiki, @page, action: :edit), class: "btn gl-button js-wiki-edit", role: "button", data: { qa_selector: 'edit_page_button' } do = link_to wiki_path(@wiki, action: :new), class: "btn gl-button btn-success btn-inverted", role: "button", data: { qa_selector: 'new_page_button' } do
= _("Edit") = s_("Wiki|New page")
...@@ -20,7 +20,11 @@ ...@@ -20,7 +20,11 @@
= (s_("WikiHistoricalPage|You can view the %{most_recent_link} or browse the %{history_link}.") % { most_recent_link: most_recent_link, history_link: history_link }).html_safe = (s_("WikiHistoricalPage|You can view the %{most_recent_link} or browse the %{history_link}.") % { most_recent_link: most_recent_link, history_link: history_link }).html_safe
.gl-mt-5.gl-mb-3 .gl-mt-5.gl-mb-3
%h2.gl-mt-0.gl-mb-5{ data: { qa_selector: 'wiki_page_title', testid: 'wiki_page_title' } }= @page.human_title .gl-display-flex.gl-justify-content-space-between
%h2.gl-mt-0.gl-mb-5{ data: { qa_selector: 'wiki_page_title', testid: 'wiki_page_title' } }= @page.human_title
%div
- if can?(current_user, :create_wiki, @wiki.container) && @page.latest? && @valid_encoding
= link_to sprite_icon('pencil', css_class: 'gl-icon'), wiki_page_path(@wiki, @page, action: :edit), title: 'Edit', role: "button", class: 'btn gl-button btn-icon js-wiki-edit', data: { qa_selector: 'edit_page_button' }
.js-wiki-page-content.md.gl-pt-2{ data: { qa_selector: 'wiki_page_content', testid: 'wiki_page_content', tracking_context: wiki_page_tracking_context(@page).to_json } } .js-wiki-page-content.md.gl-pt-2{ data: { qa_selector: 'wiki_page_content', testid: 'wiki_page_content', tracking_context: wiki_page_tracking_context(@page).to_json } }
= render_wiki_content(@page) = render_wiki_content(@page)
......
---
title: Move wiki edit button inline with wiki title
merge_request: 44391
author:
type: changed
...@@ -11,12 +11,12 @@ class Show < Base ...@@ -11,12 +11,12 @@ class Show < Base
view 'app/views/shared/wikis/show.html.haml' do view 'app/views/shared/wikis/show.html.haml' do
element :wiki_page_title element :wiki_page_title
element :wiki_page_content element :wiki_page_content
element :edit_page_button
end end
view 'app/views/shared/wikis/_main_links.html.haml' do view 'app/views/shared/wikis/_main_links.html.haml' do
element :new_page_button element :new_page_button
element :page_history_button element :page_history_button
element :edit_page_button
end end
view 'app/views/shared/empty_states/_wikis.html.haml' do view 'app/views/shared/empty_states/_wikis.html.haml' do
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册