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
94dcadd6
Commit
94dcadd6
authored
Dec 27, 2016
by
Alex Braha Stoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a breadcrumb at projects/wikis/show.html.haml
parent
84cc7c37
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
0 deletions
+42
-0
app/assets/stylesheets/pages/wiki.scss
app/assets/stylesheets/pages/wiki.scss
+5
-0
app/helpers/wiki_helper.rb
app/helpers/wiki_helper.rb
+13
-0
app/views/projects/wikis/show.html.haml
app/views/projects/wikis/show.html.haml
+3
-0
spec/helpers/wiki_helper_spec.rb
spec/helpers/wiki_helper_spec.rb
+21
-0
No files found.
app/assets/stylesheets/pages/wiki.scss
View file @
94dcadd6
...
...
@@ -17,6 +17,11 @@
@extend
.top-area
;
position
:
relative
;
.wiki-breadcrumb
{
border-bottom
:
1px
solid
$white-normal
;
padding
:
11px
0
;
}
.wiki-page-title
{
margin
:
0
;
font-size
:
22px
;
...
...
app/helpers/wiki_helper.rb
0 → 100644
View file @
94dcadd6
module
WikiHelper
# Produces a pure text breadcrumb for a given page.
#
# page_slug - The slug of a WikiPage object.
#
# Returns a String composed of the capitalized name of each directory and the
# capitalized name of the page itself.
def
breadcrumb
(
page_slug
)
page_slug
.
split
(
'/'
).
map
{
|
dir_or_page
|
dir_or_page
.
gsub
(
/-+/
,
' '
).
capitalize
}.
join
(
' / '
)
end
end
app/views/projects/wikis/show.html.haml
View file @
94dcadd6
...
...
@@ -6,6 +6,9 @@
%button
.btn.btn-default.sidebar-toggle.js-sidebar-wiki-toggle
{
role:
"button"
,
type:
"button"
}
=
icon
(
'angle-double-left'
)
.wiki-breadcrumb
%span
=
breadcrumb
(
@page
.
slug
)
.nav-text
%h2
.wiki-page-title
=
@page
.
title
.
capitalize
%span
.wiki-last-edit-by
...
...
spec/helpers/wiki_helper_spec.rb
0 → 100644
View file @
94dcadd6
require
'spec_helper'
describe
WikiHelper
do
describe
'#breadcrumb'
do
context
'when the page is at the root level'
do
it
'returns the capitalized page name'
do
slug
=
'page-name'
expect
(
helper
.
breadcrumb
(
slug
)).
to
eq
(
'Page name'
)
end
end
context
'when the page is inside a directory'
do
it
'returns the capitalized name of each directory and of the page itself'
do
slug
=
'dir_1/page-name'
expect
(
helper
.
breadcrumb
(
slug
)).
to
eq
(
'Dir_1 / Page name'
)
end
end
end
end
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