2
0

Refactor to reuse the one status partial across moderation tools (#35644)

This commit is contained in:
Emelia Smith
2025-08-21 16:51:11 +02:00
committed by Claire
parent 4ef0ce033e
commit cbb9a4dbe3
14 changed files with 88 additions and 119 deletions

View File

@@ -102,6 +102,16 @@ module ApplicationHelper
policy(record).public_send(:"#{action}?")
end
def conditional_link_to(condition, name, options = {}, html_options = {}, &block)
if condition && !current_page?(block_given? ? name : options)
link_to(name, options, html_options, &block)
elsif block_given?
content_tag(:span, options, html_options, &block)
else
content_tag(:span, name, html_options)
end
end
def material_symbol(icon, attributes = {})
safe_join(
[