Commit f0d20b09 authored by Mike Greiling's avatar Mike Greiling

use wiki pages index for sidebar overflow and limit sidebar list to 15 pages

parent b2137632
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
} }
renderSidebar() { renderSidebar() {
if (!this.sidebarEl) return;
const { classList } = this.sidebarEl; const { classList } = this.sidebarEl;
if (this.sidebarExpanded || !this.sidebarCanCollapse()) { if (this.sidebarExpanded || !this.sidebarCanCollapse()) {
if (!classList.contains('right-sidebar-expanded')) { if (!classList.contains('right-sidebar-expanded')) {
......
...@@ -115,6 +115,8 @@ class Projects::WikisController < Projects::ApplicationController ...@@ -115,6 +115,8 @@ class Projects::WikisController < Projects::ApplicationController
# Call #wiki to make sure the Wiki Repo is initialized # Call #wiki to make sure the Wiki Repo is initialized
@project_wiki.wiki @project_wiki.wiki
@sidebar_wiki_pages = @project_wiki.pages.first(15)
rescue ProjectWiki::CouldNotCreateWikiError rescue ProjectWiki::CouldNotCreateWikiError
flash[:notice] = "Could not create Wiki Repository at this time. Please try again later." flash[:notice] = "Could not create Wiki Repository at this time. Please try again later."
redirect_to project_path(@project) redirect_to project_path(@project)
......
...@@ -23,7 +23,6 @@ module NavHelper ...@@ -23,7 +23,6 @@ module NavHelper
elsif current_path?('wikis#show') || elsif current_path?('wikis#show') ||
current_path?('wikis#edit') || current_path?('wikis#edit') ||
current_path?('wikis#history') || current_path?('wikis#history') ||
current_path?('wikis#pages') ||
current_path?('wikis#git_access') current_path?('wikis#git_access')
"page-gutter wiki-sidebar right-sidebar-expanded" "page-gutter wiki-sidebar right-sidebar-expanded"
end end
......
...@@ -12,9 +12,12 @@ ...@@ -12,9 +12,12 @@
.blocks-container .blocks-container
.block.block-first .block.block-first
%ul.wiki-pages %ul.wiki-pages
- @project_wiki.pages.each do |wiki_page| - @sidebar_wiki_pages.each do |wiki_page|
%li{ class: params[:id] == wiki_page.slug ? 'active' : '' } %li{ class: params[:id] == wiki_page.slug ? 'active' : '' }
= link_to namespace_project_wiki_path(@project.namespace, @project, wiki_page) do = link_to namespace_project_wiki_path(@project.namespace, @project, wiki_page) do
= wiki_page.title.capitalize = wiki_page.title.capitalize
.block
= link_to namespace_project_wiki_pages_path(@project.namespace, @project), class: 'btn btn-block' do
More Pages
= render 'projects/wikis/new' = render 'projects/wikis/new'
...@@ -3,13 +3,16 @@ ...@@ -3,13 +3,16 @@
%div{ class: container_class } %div{ class: container_class }
.wiki-page-header .wiki-page-header
%button.btn.btn-default.sidebar-toggle.js-sidebar-wiki-toggle{ role: "button", type: "button" }
= icon('angle-double-left')
.nav-text .nav-text
%h2.wiki-page-title %h2.wiki-page-title
Wiki Pages Wiki Pages
.nav-controls
= link_to namespace_project_wikis_git_access_path(@project.namespace, @project), class: 'btn' do
= icon('cloud-download')
Clone repository
%ul.content-list %ul.content-list
- @wiki_pages.each do |wiki_page| - @wiki_pages.each do |wiki_page|
%li %li
...@@ -18,5 +21,3 @@ ...@@ -18,5 +21,3 @@
.pull-right .pull-right
%small Last edited #{time_ago_with_tooltip(wiki_page.commit.authored_date)} %small Last edited #{time_ago_with_tooltip(wiki_page.commit.authored_date)}
= paginate @wiki_pages, theme: 'gitlab' = paginate @wiki_pages, theme: 'gitlab'
= render 'sidebar'
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