Skip to content
Snippets Groups Projects
Commit d5d2d3f5 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

Fix #1154

parent 0b10a161
No related branches found
No related tags found
No related merge requests found
......@@ -87,7 +87,7 @@ class Communication::Block < ApplicationRecord
basic: [:chapter, :image, :video, :sound, :datatable],
storytelling: [:key_figures, :features, :gallery, :call_to_action, :testimonials, :timeline],
references: [:pages, :posts, :organization_chart, :partners, :programs],
utilities: [:files, :definitions, :embed, :contact]
utilities: [:files, :definitions, :contact, :embed]
}
scope :published, -> { where(published: true) }
......
......@@ -3,9 +3,11 @@ class Communication::Block::Template::Contact < Communication::Block::Template::
has_component :description, :rich_text
has_component :name, :string
has_component :address, :text
has_component :information, :rich_text
has_component :zipcode, :string
has_component :city, :string
has_component :country, :string
has_component :url, :string
has_component :phone_numbers, :array
has_component :emails, :array
......
<div class="row pure__row--small">
<div class="col-xl-6">
<div class="col-xxl-6">
<%= block_component_edit block, :description %>
</div>
</div>
<div class="row pure__row--small mb-4">
<div class="col-xl-6">
<div class="col-xxl-6">
<%= osuny_panel t('.contacts') do %>
<%= block_component_edit block, :name %>
<%= block_component_edit block, :information %>
<%= block_component_edit block, :address %>
<div class="row pure__row--small">
<div class="col-md-4">
......@@ -19,7 +20,10 @@
<%= block_component_edit block, :country %>
<% end %>
</div>
<div class="col-xl-6">
<div class="col-xxl-6">
<%= osuny_panel t('.website') do %>
<%= block_component_edit block, :url %>
<% end %>
<%
action = "<a class=\"#{ button_classes }\" v-on:click=\"data.phone_numbers.push('')\">#{ t('.add') }</a>"
placeholder = t '.phones.placeholder'
......@@ -68,13 +72,13 @@
</div>
<div class="flex-fill">
<div class="row pure__row--small mb-n3">
<div class="col-xl-4">
<div class="col-xxl-4">
<%= block_component_edit block, :title, template: @element %>
</div>
<div class="col-xl-4 col-md-6">
<div class="col-xxl-4 col-md-6">
<%= block_component_edit block, :time_slot_morning, template: @element %>
</div>
<div class="col-xl-4 col-md-6">
<div class="col-xxl-4 col-md-6">
<%= block_component_edit block, :time_slot_afternoon, template: @element %>
</div>
</div>
......
......@@ -26,6 +26,9 @@ end
<% unless block.template.name.blank? %>
<p><%= block_component_show block, :name %></p>
<% end %>
<% if block.template.information.present? %>
<%= block_component_show block, :information %>
<% end %>
<div itemprop="address" itemscope itemtype="https://schema.org/PostalAddress">
<span itemprop="streetAddress">
<%= block_component_show block, :address %>
......@@ -41,6 +44,13 @@ end
</span>
</div>
<% if block.template.url.present? %>
<% url = block.template.url %>
<a href="<%= social_website_to_url url %>" target="_blank" rel="noreferrer">
<%= social_website_to_s url %>
</a>
<% end %>
<p>
<% block.template.phone_numbers.each do |phone_number| %>
<a itemprop="telephone" href="tel:<%= phone_number %>%>"><%= phone_number %></a><br>
......@@ -54,7 +64,9 @@ end
<% block.template.elements.each do |element| %>
<li>
<span><%= block_component_show block, :title, template: element %></span>
<span><time datetime="<%= block_component_show block, :time_slot_morning, template: element %>"><%= block_component_show block, :time_slot_morning, template: element %></time></span>
<% if element.time_slot_morning['to'].present? %>
<span><time datetime="<%= block_component_show block, :time_slot_morning, template: element %>"><%= block_component_show block, :time_slot_morning, template: element %></time></span>
<% end %>
<span><time datetime="<%= block_component_show block, :time_slot_afternoon, template: element %>"><%= block_component_show block, :time_slot_afternoon, template: element %></time></span>
</li>
<% end %>
......
......@@ -332,12 +332,14 @@ en:
label: Morning (if necessary)
time_slot_afternoon:
label: Afternoon (or full day)
information:
label: Additional data
mails:
label: Mails
placeholder: Enter the mail
name:
label: Name (person, organization...)
placeholder: Enter the text
zipcode:
label: Zipcode
placeholder: Enter the zipcode
mails:
label: Mails
placeholder: Enter the mail
......@@ -345,6 +347,13 @@ en:
label: Telephone numbers
placeholder: Enter the number
slots: Opening times
url:
label: URL
placeholder: https://...
website: Website
zipcode:
label: Zipcode
placeholder: Enter the zipcode
datatable:
description: A table of data, as responsive and accessible as possible.
edit:
......
......@@ -332,19 +332,25 @@ fr:
label: Matin (si nécessaire)
time_slot_afternoon:
label: Après-midi (ou jour complet)
name:
label: Nom (personne, établissement...)
placeholder: Entrer le texte
zipcode:
label: Code postal
placeholder: Entrer le code postal
information:
label: Informations complémentaires
mails:
label: Mails
placeholder: Entrer le mail
name:
label: Nom (personne, établissement...)
placeholder: Entrer le texte
phones:
label: Téléphones
placeholder: Entrer le numéro
slots: Horaires
url:
label: URL
placeholder: https://...
website: Site Web
zipcode:
label: Code postal
placeholder: Entrer le code postal
datatable:
description: Un tableau de données, aussi responsive et accessible que possible.
edit:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment