Skip to content

Commit d2899f6

Browse files
committed
Use configured space logo including proper contrast background when embedding workflows.
1 parent 5e42f31 commit d2899f6

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

app/assets/stylesheets/workflows.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@
160160
bottom: 5px;
161161
left: 5px;
162162
z-index: 20000;
163+
164+
.space-logo {
165+
padding: .5em;
166+
border-radius: 4px;
167+
}
163168
}
164169

165170
.nav-heading-darker {

app/views/workflows/embed.html.erb

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,19 @@
1313
<%= render partial: 'workflows/workflow_diagram', locals: { workflow: @workflow } %>
1414

1515
<%= link_to @workflow, class: 'embed-floating-link', target: '_parent' do %>
16-
<%= image_tag TeSS::Config.site['logo'],
17-
alt: TeSS::Config.site['title'],
18-
title: "View this workflow on #{TeSS::Config.site['title_short']}",
19-
style: 'height: 50px;' %>
16+
<% if TeSS::Config.site.dig('footer', 'show_space_logo') && current_space&.image? %>
17+
<% logo_background = TeSS::Config.themes[current_space.theme]&.dig('primary') %>
18+
<%= image_tag current_space.image.url,
19+
alt: current_space.logo_alt,
20+
title: "View this workflow on #{current_space.title}",
21+
class: 'space-logo',
22+
style: "height: 50px;#{ " background-color: #{logo_background};" if logo_background }" %>
23+
<% else %>
24+
<% logo_background = TeSS::Config.themes[TeSS::Config.site['default_theme']]&.dig('primary') %>
25+
<%= image_tag TeSS::Config.site['logo'],
26+
alt: TeSS::Config.site['logo_alt'],
27+
title: "View this workflow on #{TeSS::Config.site['title_short']}",
28+
class: 'space-logo',
29+
style: "height: 50px;#{ " background-color: #{logo_background};" if logo_background }" %>
30+
<% end %>
2031
<% end %>

0 commit comments

Comments
 (0)