Commit 6ca86272 authored by Natalia Tepluhina's avatar Natalia Tepluhina Committed by Andrew Fontaine

Update "More Pages" button on Wiki Page

parent 438f0aff
......@@ -17,5 +17,6 @@
%ul.wiki-pages
= render @sidebar_wiki_entries, context: 'sidebar'
.block.w-100
= link_to project_wikis_pages_path(@project), class: 'btn btn-block' do
= s_("Wiki|More Pages")
- if @sidebar_wiki_entries&.length.to_i >= 15
= link_to project_wikis_pages_path(@project), class: 'btn btn-block' do
= s_("Wiki|View All Pages")
---
title: Update More Pages button on Wiki Page
merge_request: 27499
author:
type: changed
......@@ -22762,9 +22762,6 @@ msgstr ""
msgid "Wiki|Edit Page"
msgstr ""
msgid "Wiki|More Pages"
msgstr ""
msgid "Wiki|New page"
msgstr ""
......@@ -22783,6 +22780,9 @@ msgstr ""
msgid "Wiki|Title"
msgstr ""
msgid "Wiki|View All Pages"
msgstr ""
msgid "Wiki|Wiki Pages"
msgstr ""
......
......@@ -312,7 +312,6 @@ describe "User creates wiki page" do
visit(project_wikis_path(project))
expect(page).to have_content('another')
expect(page).to have_content('More Pages')
end
context 'when there is a customized sidebar' do
......@@ -324,10 +323,23 @@ describe "User creates wiki page" do
visit(project_wikis_path(project))
expect(page).to have_content('My customized sidebar')
expect(page).to have_content('More Pages')
expect(page).not_to have_content('Another')
end
end
end
context 'when there are more than 15 existing pages' do
before do
create(:wiki_page, wiki: wiki, attrs: { title: 'home', content: 'home' })
(1..14).each { |i| create(:wiki_page, wiki: wiki, attrs: { title: "page-#{i}", content: "page #{i}" }) }
end
it 'renders a default sidebar when there is no customized sidebar' do
visit(project_wikis_path(project))
expect(page).to have_content('View All Pages')
expect(page).to have_content('page 1')
end
end
end
end
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