Merge pull request #6855 from opf/core/housekeeping/community-links

Evaluate link rendering on homescreen based on show_banners

[ci skip]
pull/6857/head
Oliver Günther 6 years ago committed by GitHub
commit 5959015be3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      app/helpers/homescreen_helper.rb
  2. 2
      app/views/homescreen/index.html.erb
  3. 4
      config/initializers/homescreen.rb

@ -58,6 +58,12 @@ module HomescreenHelper
target: '_blank'
end
##
# Determine whether we should render the links on homescreen?
def show_homescreen_links?
EnterpriseToken.show_banners? || OpenProject::Configuration.show_community_links?
end
##
# Determine whether we should render the onboarding modal
def show_onboarding_modal?

@ -46,7 +46,7 @@ See docs/COPYRIGHT.rdoc for more details.
</section>
<% end %>
<% if @homescreen[:links].any? %>
<% if show_homescreen_links? && @homescreen[:links].any? %>
<section class="homescreen--links">
<% @homescreen[:links].each do |link| %>
<% title = I18n.t(link[:label], scope: 'homescreen.links') %>

@ -30,9 +30,6 @@
require 'open_project/static/homescreen'
require 'open_project/static/links'
# Skip this initializer if we're too early
return unless EnterpriseToken.table_exists?
OpenProject::Static::Homescreen.manage :blocks do |blocks|
blocks.push(
{
@ -71,7 +68,6 @@ end
OpenProject::Static::Homescreen.manage :links do |links|
static_links = OpenProject::Static::Links.links
next unless EnterpriseToken.show_banners? || OpenProject::Configuration.show_community_links?
links.push(
{

Loading…
Cancel
Save