Commit 384445ec authored by Douwe Maan's avatar Douwe Maan

Don't override issue page description in project layout.

parent 6d3b5ea2
......@@ -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
else
elsif @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
......
- page_description brand_title unless page_description
- site_name = "GitLab"
%head{prefix: "og: http://ogp.me/ns#"}
%meta{charset: "utf-8"}
......
- 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
......
- 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
......
......@@ -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
......
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