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
384445ec
Commit
384445ec
authored
Jan 06, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't override issue page description in project layout.
parent
6d3b5ea2
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
14 deletions
+9
-14
app/helpers/page_layout_helper.rb
app/helpers/page_layout_helper.rb
+3
-8
app/views/layouts/_head.html.haml
app/views/layouts/_head.html.haml
+2
-0
app/views/layouts/group.html.haml
app/views/layouts/group.html.haml
+1
-1
app/views/layouts/project.html.haml
app/views/layouts/project.html.haml
+1
-1
spec/helpers/page_layout_helper_spec.rb
spec/helpers/page_layout_helper_spec.rb
+2
-4
No files found.
app/helpers/page_layout_helper.rb
View file @
384445ec
...
...
@@ -27,11 +27,9 @@ module PageLayoutHelper
#
# Returns an HTML-safe String.
def
page_description
(
description
=
nil
)
@page_description
||=
brand_title
if
description
.
present?
@page_description
=
description
.
squish
els
e
els
if
@page_description
.
present?
sanitize
(
@page_description
,
tags:
[]).
truncate_words
(
30
)
end
end
...
...
@@ -41,11 +39,8 @@ module PageLayoutHelper
subject
=
@project
||
@user
||
@group
if
subject
.
present?
subject
.
avatar_url
||
default
else
default
end
image
=
subject
.
avatar_url
if
subject
.
present?
image
||
default
end
# Define or get attributes to be used as Twitter card metadata
...
...
app/views/layouts/_head.html.haml
View file @
384445ec
-
page_description
brand_title
unless
page_description
-
site_name
=
"GitLab"
%head
{
prefix:
"og: http://ogp.me/ns#"
}
%meta
{
charset:
"utf-8"
}
...
...
app/views/layouts/group.html.haml
View file @
384445ec
-
page_title
@group
.
name
-
page_description
@group
.
description
-
page_description
@group
.
description
unless
page_description
-
header_title
group_title
(
@group
)
unless
header_title
-
sidebar
"group"
unless
sidebar
...
...
app/views/layouts/project.html.haml
View file @
384445ec
-
page_title
@project
.
name_with_namespace
-
page_description
@project
.
description
-
page_description
@project
.
description
unless
page_description
-
header_title
project_title
(
@project
)
unless
header_title
-
sidebar
"project"
unless
sidebar
...
...
spec/helpers/page_layout_helper_spec.rb
View file @
384445ec
...
...
@@ -2,10 +2,8 @@ require 'rails_helper'
describe
PageLayoutHelper
do
describe
'page_description'
do
it
'defaults to value returned by brand_title helper'
do
allow
(
helper
).
to
receive
(
:brand_title
).
and_return
(
'Foo'
)
expect
(
helper
.
page_description
).
to
eq
'Foo'
it
'defaults to nil'
do
expect
(
helper
.
page_description
).
to
eq
nil
end
it
'returns the last-pushed description'
do
...
...
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