branding_helper.rb 935 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # frozen_string_literal: true
  2. module BrandingHelper
  3. def logo_as_symbol(version = :icon)
  4. case version
  5. when :icon
  6. _logo_as_symbol_icon
  7. when :wordmark
  8. _logo_as_symbol_wordmark
  9. end
  10. end
  11. def _logo_as_symbol_wordmark
  12. content_tag(:svg, tag(:use, href: '#logo-symbol-wordmark'), viewBox: '0 0 261 66', class: 'logo logo--wordmark')
  13. end
  14. def _logo_as_symbol_icon
  15. content_tag(:svg, tag(:use, href: '#logo-symbol-icon'), viewBox: '0 0 79 79', class: 'logo logo--icon')
  16. end
  17. def render_logo
  18. image_pack_tag('logo.svg', alt: 'Mastodon', class: 'logo logo--icon')
  19. end
  20. def render_symbol(version = :icon)
  21. path = begin
  22. case version
  23. when :icon
  24. 'logo-symbol-icon.svg'
  25. when :wordmark
  26. 'logo-symbol-wordmark.svg'
  27. end
  28. end
  29. render(file: Rails.root.join('app', 'javascript', 'images', path)).html_safe # rubocop:disable Rails/OutputSafety
  30. end
  31. end