Files
fizzy/app/helpers/application_helper.rb
T
Adrien Maston a770f614c0 Merge branch 'main' into mobile-app/scoped-stylesheets
* main: (85 commits)
  Fix crash when inserting an emoji into a max length reaction
  change the object type in the example code (#1824)
  We can't hide public boards like this
  Consistent breakpoints for min- and max-width
  Repair tooltip z-index selector
  Fix bin/setup to explicitly use bash syntax for mise hook-env (#1813)
  Update AGENTS.md (#1818)
  Bundler: normalize platforms (#1822)
  Robots, begone (#1812)
  Account for input padding on autoresize pseudo-element
  Updated database.sqlite.yml
  (account): encode external_account_id in slug
  Allow typing magic links on mobile
  Add contributing guide
  Disconnect action cable when user is deactivated
  Disable ARM image builds
  Disable image builds for PRs
  Add libssl-dev
  Add automated Docker image builds
  Make the jump nav hotkeys look like the others
  ...
2025-12-03 10:57:27 +01:00

29 lines
1008 B
Ruby

module ApplicationHelper
def stylesheet_link_tags
stylesheet_link_tag *platform.stylesheet_paths, "data-turbo-track": "reload"
end
def page_title_tag
account_name = if Current.account && Current.session&.identity&.users&.many?
Current.account&.name
end
tag.title [ @page_title, account_name, "Fizzy" ].compact.join(" | ")
end
def icon_tag(name, **options)
tag.span class: class_names("icon icon--#{name}", options.delete(:class)), "aria-hidden": true, **options
end
def inline_svg(name)
file_path = "#{Rails.root}/app/assets/images/#{name}.svg"
return File.read(file_path).html_safe if File.exist?(file_path)
"(not found)"
end
def back_link_to(label, url, action, **options)
link_to url, class: "btn btn--back", data: { controller: "hotkey", action: action }, **options do
icon_tag("arrow-left") + tag.strong("Back to #{label}", class: "overflow-ellipsis") + tag.kbd("ESC", class: "txt-x-small hide-on-touch").html_safe
end
end
end