Module: Lesli::CustomizationHelper
- Defined in:
- app/helpers/lesli/customization_helper.rb
Instance Method Summary collapse
- #customization_instance_logo(tag: false, logo: "app-logo", variant: "light", mode: "web", options: { alt: "Logo" }) ⇒ Object
- #customization_instance_logo_tag(logo: "app-logo", variant: "light", mode: "web", options: { alt: "Logo" }) ⇒ Object
- #customization_instance_logo_url(logo: "app-logo", variant: "light", mode: "web", options: { alt: "Logo" }) ⇒ Object
- #default_logos ⇒ Object
Instance Method Details
#customization_instance_logo(tag: false, logo: "app-logo", variant: "light", mode: "web", options: { alt: "Logo" }) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'app/helpers/lesli/customization_helper.rb', line 45 def customization_instance_logo(tag: false, logo: "app-logo", variant: "light", mode: "web", options: { alt: "Logo" }) # loading logo from builder assets logo_path = "#{lesli_instance_code}/brand/#{logo}.svg" # load favicon as PNG for better compatibility between web browsers logo_path = "#{lesli_instance_code}/brand/#{logo}.png" if logo == "favicon" # loading logo from core, only if builder engine was not installed logo_path = "lesli/brand/#{logo}.svg" if lesli_instance_code == "lesli" # custom logo from settings logo_path = @lesli[:customization][:logos][logo.to_sym] if @lesli.dig(:customization, :logos, logo.to_sym) if mode == "pdf" wicked_pdf_image_tag(logo_path, ) elsif tag image_tag(logo_path, ) else image_url(logo_path, ) end end |
#customization_instance_logo_tag(logo: "app-logo", variant: "light", mode: "web", options: { alt: "Logo" }) ⇒ Object
68 69 70 |
# File 'app/helpers/lesli/customization_helper.rb', line 68 def customization_instance_logo_tag(logo: "app-logo", variant: "light", mode: "web", options: { alt: "Logo" }) customization_instance_logo(tag: true, logo: logo, variant: variant, mode: mode, options: ) end |
#customization_instance_logo_url(logo: "app-logo", variant: "light", mode: "web", options: { alt: "Logo" }) ⇒ Object
72 73 74 |
# File 'app/helpers/lesli/customization_helper.rb', line 72 def customization_instance_logo_url(logo: "app-logo", variant: "light", mode: "web", options: { alt: "Logo" }) customization_instance_logo(tag: false, logo: logo, variant: variant, mode: mode, options: ) end |
#default_logos ⇒ Object
76 77 78 79 80 81 82 |
# File 'app/helpers/lesli/customization_helper.rb', line 76 def default_logos { "app_icon" => "app-icon.svg", "app_logo" => "app-logo.svg", "favicon" => "favicon.png" } end |