Method: ScrivitoHelper#scrivito_thumbnail
- Defined in:
- app/helpers/scrivito_helper.rb
#scrivito_thumbnail(title, icon = :scrivito, &block) ⇒ Object
Thumbnail helper generates HTML for the page class selection dialog and the widget class selection dialog. The generated HTML has appropriate DOM structure and CSS classes, which are compatible with the CSS of the SDK. By using this helper you ensure, that the look of your thumbnails fits into the SDK’s design.
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
# File 'app/helpers/scrivito_helper.rb', line 287 def scrivito_thumbnail(title, icon = :scrivito, &block) if icon.is_a?(Symbol) icon_code = { content: '', headline: '', image: '', scrivito: '', text: '', }.fetch(icon, '') icon = content_tag(:i, icon_code.html_safe, class: 'scrivito_icon') end content_tag(:div, 'data-scrivito-private-thumbnail-title' => title) do capture do concat content_tag(:div, icon, class: 'thumbnail') concat content_tag(:div, title, class: 'title') if block_given? concat content_tag(:div, class: 'description', &block) else concat content_tag(:div, nil, class: 'description') end end end end |