diff --git a/app/models/communication/block/component/time_slot.rb b/app/models/communication/block/component/time_slot.rb index 168dba1ed706f76038ffeb7a44d1b9d413b7adb1..77d176c7cbc4c5d32b8d11981b07bbd144f71e59 100644 --- a/app/models/communication/block/component/time_slot.rb +++ b/app/models/communication/block/component/time_slot.rb @@ -18,8 +18,8 @@ class Communication::Block::Component::TimeSlot < Communication::Block::Componen def default_data { - 'from' => '0', - 'to' => '0' + 'from' => '', + 'to' => '' } end diff --git a/app/views/admin/communication/blocks/components/add_element/_edit.html.erb b/app/views/admin/communication/blocks/components/add_element/_edit.html.erb index 4f2a0da8acf7051ecbc894786f482dce39c3b28f..108e3e124b8ee1565139530257661c7ad36d87dc 100644 --- a/app/views/admin/communication/blocks/components/add_element/_edit.html.erb +++ b/app/views/admin/communication/blocks/components/add_element/_edit.html.erb @@ -1,4 +1,4 @@ <a class="<%= button_classes('mb-4') %>" - v-on:click="data.elements.push(Object.assign({}, defaultElement))"> + v-on:click="data.elements.push(JSON.parse(JSON.stringify(defaultElement)))"> <%= label %> </a> diff --git a/app/views/admin/communication/blocks/components/time_slot/_edit.html.erb b/app/views/admin/communication/blocks/components/time_slot/_edit.html.erb index 3b069d144654ee175609e82120b47e20f321ba4f..087cb556b55156da18481520e3461c2ae406be37 100644 --- a/app/views/admin/communication/blocks/components/time_slot/_edit.html.erb +++ b/app/views/admin/communication/blocks/components/time_slot/_edit.html.erb @@ -13,7 +13,8 @@ to = t 'admin.communication.blocks.components.time_slot.to' <span class="me-2 pt-1"> <%= from %> </span> - <input class="form-control me-1" + <input :id="'element-' + index + '-<%= property %>%-from'" + class="form-control me-1" v-model="<%= model %>.<%= property %>.from" type="time" /> </label> @@ -21,7 +22,8 @@ to = t 'admin.communication.blocks.components.time_slot.to' <span class="me-2 pt-1"> <%= to %> </span> - <input class="form-control" + <input :id="'element-' + index + '-<%= property %>%-to'" + class="form-control" v-model="<%= model %>.<%= property %>.to" type="time" /> </label> diff --git a/app/views/admin/communication/blocks/components/time_slot/_preview.html.erb b/app/views/admin/communication/blocks/components/time_slot/_preview.html.erb index 3377599eaf28a4bcc2af4a9b4580bcd5758792b3..e2e6fce5a0df2df235a7d2ccfcd631a106e70cf5 100644 --- a/app/views/admin/communication/blocks/components/time_slot/_preview.html.erb +++ b/app/views/admin/communication/blocks/components/time_slot/_preview.html.erb @@ -1,3 +1 @@ -<% if component.present? %> - <%= component.from %> → <%= component.to %> -<% end %> +<%= component.from %> → <%= component.to %> diff --git a/app/views/admin/communication/blocks/components/time_slot/_static.html.erb b/app/views/admin/communication/blocks/components/time_slot/_static.html.erb index d419d8dae65d8e9402542a17d0342612b4251b48..25464183d23524777978d24f8157a967b7324902 100644 --- a/app/views/admin/communication/blocks/components/time_slot/_static.html.erb +++ b/app/views/admin/communication/blocks/components/time_slot/_static.html.erb @@ -1,3 +1,3 @@ <%= indentation %><%= property %>: -<%= indentation %> from: "<%= value['from'] %>" -<%= indentation %> to: "<%= value['to'] %>" +<%= indentation %> from: "<%= component.from %>" +<%= indentation %> to: "<%= component.to %>" diff --git a/app/views/admin/communication/blocks/templates/contact/_edit.html.erb b/app/views/admin/communication/blocks/templates/contact/_edit.html.erb index 7ae6dd83c4f78d1ecde0f80700dca6757eaea188..e9a904fa5343b482ef80051a6341f4cb2fca2e40 100644 --- a/app/views/admin/communication/blocks/templates/contact/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/contact/_edit.html.erb @@ -1,17 +1,23 @@ <div class="row mb-4"> <div class="col-md-6 col-xl-4"> - <h3 class="h4"><%= t '.contacts' %></h3> - <%= block_component_edit :name %> - <%= block_component_edit :address, rows: 1 %> - <div class="row"> - <div class="col-md-4"> - <%= block_component_edit :zipcode %> + <div class="card"> + <div class="card-header d-flex"> + <h3 class="h4"><%= t '.contacts' %></h3> </div> - <div class="col-md-8"> - <%= block_component_edit :city %> + <div class="card-body"> + <%= block_component_edit :name %> + <%= block_component_edit :address, rows: 1 %> + <div class="row"> + <div class="col-md-4"> + <%= block_component_edit :zipcode %> + </div> + <div class="col-md-8"> + <%= block_component_edit :city %> + </div> + </div> + <%= block_component_edit :country %> </div> </div> - <%= block_component_edit :country %> </div> <div class="col-md-6 col-xl-8"> <div class="row"> diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index c6f5c61ac850019dadc20a08822b6d5c57fd4585..bcf630102246690aa7a52c88b41161a1b381f613 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -205,7 +205,7 @@ en: city: label: City placeholder: Enter the city - contacts: Contacts + contacts: Mailing address country: label: Country placeholder: Enter the country diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index bcce9123c4c83364df3992bc6b78c6954dd60829..292af67bf47bc34ec376f345cd48434e0a188217 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -205,7 +205,7 @@ fr: city: label: Ville placeholder: Entrer le nom de la ville - contacts: Contacts + contacts: Adresse postale country: label: Pays placeholder: Entrer le nom du pays