diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-01-06 15:02:51 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-01-06 15:02:51 +0300 |
commit | 384445eca6249363c0da6d8b96e7ee030dc6fab3 (patch) | |
tree | c4eedd06e7487a6d5ba68b7e9ce6973b8d85e7f3 /app | |
parent | 6d3b5ea2a9611dc7d87bd48043f34f9e0930e052 (diff) |
Don't override issue page description in project layout.
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/page_layout_helper.rb | 11 | ||||
-rw-r--r-- | app/views/layouts/_head.html.haml | 2 | ||||
-rw-r--r-- | app/views/layouts/group.html.haml | 2 | ||||
-rw-r--r-- | app/views/layouts/project.html.haml | 2 |
4 files changed, 7 insertions, 10 deletions
diff --git a/app/helpers/page_layout_helper.rb b/app/helpers/page_layout_helper.rb index 5c0dd36252e..82f805fa444 100644 --- a/app/helpers/page_layout_helper.rb +++ b/app/helpers/page_layout_helper.rb @@ -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 diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml index 1a2187e551b..38ca4f91c4d 100644 --- a/app/views/layouts/_head.html.haml +++ b/app/views/layouts/_head.html.haml @@ -1,3 +1,5 @@ +- page_description brand_title unless page_description + - site_name = "GitLab" %head{prefix: "og: http://ogp.me/ns#"} %meta{charset: "utf-8"} diff --git a/app/views/layouts/group.html.haml b/app/views/layouts/group.html.haml index 1ce8d0ef7b5..2e483b7148d 100644 --- a/app/views/layouts/group.html.haml +++ b/app/views/layouts/group.html.haml @@ -1,5 +1,5 @@ - 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 diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml index f81283a5ddb..ab527e8e438 100644 --- a/app/views/layouts/project.html.haml +++ b/app/views/layouts/project.html.haml @@ -1,5 +1,5 @@ - 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 |