From bc080659962122e91f5c0364a3ec24e7881c69b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Gaya?= <sebastien.gaya@gmail.com> Date: Fri, 3 Jun 2022 17:55:47 +0200 Subject: [PATCH] default element data --- app/views/admin/communication/blocks/edit.html.erb | 3 ++- .../communication/blocks/templates/gallery/_edit.html.erb | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/admin/communication/blocks/edit.html.erb b/app/views/admin/communication/blocks/edit.html.erb index 1457df71e..b1c1d9c62 100644 --- a/app/views/admin/communication/blocks/edit.html.erb +++ b/app/views/admin/communication/blocks/edit.html.erb @@ -36,7 +36,8 @@ url: "<%= rails_direct_uploads_url.html_safe %>", blobUrlTemplate: "<%= rails_service_blob_url(":signed_id", ":filename").html_safe %>" }, - data: <%= @block.data.to_json.html_safe %> + data: <%= @block.data.to_json.html_safe %>, + defaultElement: <%= @block.template.element.default_data.to_json.html_safe %> } }, methods: { diff --git a/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb b/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb index 5817d1c3e..91becaa50 100644 --- a/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb @@ -2,9 +2,8 @@ layouts: Communication::Block::Template::Gallery::LAYOUTS, horizontal: true %> - <a class="<%= button_classes('mb-4') %>" - v-on:click="data.elements.push(<%= raw @block.template.element.default_data.to_s %>)"> + v-on:click="data.elements.push(defaultElement)"> <%= t '.add_image' %> </a> -- GitLab