Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f0d20b09
Commit
f0d20b09
authored
Nov 16, 2016
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use wiki pages index for sidebar overflow and limit sidebar list to 15 pages
parent
b2137632
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
6 deletions
+12
-6
app/assets/javascripts/wikis.js.es6
app/assets/javascripts/wikis.js.es6
+1
-0
app/controllers/projects/wikis_controller.rb
app/controllers/projects/wikis_controller.rb
+2
-0
app/helpers/nav_helper.rb
app/helpers/nav_helper.rb
+0
-1
app/views/projects/wikis/_sidebar.html.haml
app/views/projects/wikis/_sidebar.html.haml
+4
-1
app/views/projects/wikis/pages.html.haml
app/views/projects/wikis/pages.html.haml
+5
-4
No files found.
app/assets/javascripts/wikis.js.es6
View file @
f0d20b09
...
@@ -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')) {
...
...
app/controllers/projects/wikis_controller.rb
View file @
f0d20b09
...
@@ -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
)
...
...
app/helpers/nav_helper.rb
View file @
f0d20b09
...
@@ -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
...
...
app/views/projects/wikis/_sidebar.html.haml
View file @
f0d20b09
...
@@ -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'
app/views/projects/wikis/pages.html.haml
View file @
f0d20b09
...
@@ -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'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment