mirror of
https://github.com/we-promise/sure.git
synced 2026-04-07 14:31:25 +00:00
* Implement a setting to retrieve high res logos * Update _brand_fetch_settings.html.erb * Add fallback for stock tickers also to use Brandfetch * Update security.rb * Update toggle logic for high-res logos setting Signed-off-by: Juan José Mata <jjmata@jjmata.com> * Update security.rb * Update security.rb --------- Signed-off-by: Juan José Mata <jjmata@jjmata.com> Co-authored-by: Juan José Mata <jjmata@jjmata.com>
20 lines
960 B
Plaintext
20 lines
960 B
Plaintext
<%# locals: (account:, size: "md", color: nil) %>
|
|
|
|
<% size_classes = {
|
|
"sm" => "w-6 h-6",
|
|
"md" => "w-9 h-9",
|
|
"lg" => "w-10 h-10",
|
|
"full" => "w-full h-full"
|
|
} %>
|
|
|
|
<% if account.institution_domain.present? && Setting.brand_fetch_client_id.present? %>
|
|
<% logo_size = Setting.brand_fetch_logo_size %>
|
|
<%= image_tag "https://cdn.brandfetch.io/#{account.institution_domain}/icon/fallback/lettermark/w/#{logo_size}/h/#{logo_size}?c=#{Setting.brand_fetch_client_id}", class: "shrink-0 rounded-full #{size_classes[size]}" %>
|
|
<% elsif account.logo_url.present? %>
|
|
<%= image_tag account.logo_url, class: "shrink-0 rounded-full #{size_classes[size]}", loading: "lazy" %>
|
|
<% elsif account.logo.attached? %>
|
|
<%= image_tag account.logo, class: "shrink-0 rounded-full #{size_classes[size]}" %>
|
|
<% else %>
|
|
<%= render DS::FilledIcon.new(variant: :text, hex_color: color || account.accountable.color, text: account.name, size: size, rounded: true) %>
|
|
<% end %>
|