Files
grecia/app/components/admin/site_customization/images/index_component.rb
Javi Martín 8213f23629 Use I18n texts for image dimensions
This way it'll be possible to customize the text in languages not using
parenthesis or not using an "x" to define dimensions.
2024-11-08 15:03:55 +01:00

28 lines
602 B
Ruby

class Admin::SiteCustomization::Images::IndexComponent < ApplicationComponent
include Header
attr_reader :images
def initialize(images)
@images = images
end
private
def title
t("admin.site_customization.images.index.title")
end
def image_description(image)
safe_join([
tag.strong(image.name),
tag.span(image_hint(image), id: dom_id(image, :hint))
], " ")
end
def image_hint(image)
t("admin.site_customization.images.index.dimensions",
width: image.required_width,
height: image.required_height)
end
end