diff --git a/app/models/communication/block/template/key_figure/element.rb b/app/models/communication/block/template/key_figure/element.rb index d7409a8745ce96d9f93c7af3fac9134027e96822..a919419c6b7cda4651f80693881f7fb6fe197ff2 100644 --- a/app/models/communication/block/template/key_figure/element.rb +++ b/app/models/communication/block/template/key_figure/element.rb @@ -3,5 +3,10 @@ class Communication::Block::Template::KeyFigure::Element < Communication::Block: has_component :number, :number has_component :unit, :string has_component :description, :text + has_component :image, :image + + def blob + image_component.blob + end end diff --git a/app/views/admin/communication/blocks/templates/key_figures/_edit.html.erb b/app/views/admin/communication/blocks/templates/key_figures/_edit.html.erb index cb8b57e87dba231e81a87e7019d83582b21723b8..708dd6b8ca2d9c5d3e6a8fc527955a8a397925cb 100644 --- a/app/views/admin/communication/blocks/templates/key_figures/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/key_figures/_edit.html.erb @@ -21,9 +21,12 @@ <div class="col-lg-3"> <%= block_component_edit block, :unit, template: @element %> </div> - <div class="col-lg-7"> + <div class="col-lg-4"> <%= block_component_edit block, :description, template: @element, rows: 1 %> </div> + <div class="col-lg-3"> + <%= block_component_edit block, :image, template: @element %> + </div> </div> </div> <div> diff --git a/app/views/admin/communication/blocks/templates/key_figures/_show.html.erb b/app/views/admin/communication/blocks/templates/key_figures/_show.html.erb index f248e4ac523db69ede1a24316d4bb69c0cd8a3e8..7cbf7f7e25d9c03639a7a16eefc00032ca6b4fd2 100644 --- a/app/views/admin/communication/blocks/templates/key_figures/_show.html.erb +++ b/app/views/admin/communication/blocks/templates/key_figures/_show.html.erb @@ -23,6 +23,9 @@ end <% block.template.elements.each do |element| %> <li> <dl> + <% if element.image %> + <%= block_component_show block, :image, template: element %> + <% end %> <dt><strong><%= block_component_show block, :number, template: element %></strong><%= block_component_show block, :unit, template: element %></dt> <dd><%= block_component_show block, :description, template: element %></dd> </dl> diff --git a/app/views/admin/communication/blocks/templates/key_figures/_static.html.erb b/app/views/admin/communication/blocks/templates/key_figures/_static.html.erb index 4bdf5dbae557ebd663daa061a9f892ca347e0599..310e566cbab6c00d09e5d08d9ea6d8de3d02db4b 100644 --- a/app/views/admin/communication/blocks/templates/key_figures/_static.html.erb +++ b/app/views/admin/communication/blocks/templates/key_figures/_static.html.erb @@ -4,4 +4,5 @@ - <%= block_component_static block, :number, template: element, depth: 0 %> <%= block_component_static block, :unit, template: element, depth: 5 %> <%= block_component_static block, :description, template: element, depth: 5 %> +<%= block_component_static block, :image, template: element, depth: 5 %> <% end %>