Contact address is now displayed only when present

This commit is contained in:
echarp 2018-04-08 23:40:08 +02:00
parent 06d7538d73
commit e1c2eb7b5d
2 changed files with 9 additions and 8 deletions

View File

@ -103,12 +103,13 @@
%em.fa.fa-external-link-alt %em.fa.fa-external-link-alt
%span.label= Event.human_attribute_name :url %span.label= Event.human_attribute_name :url
= link_to @event.url, sanitize(@event.url) = link_to @event.url, sanitize(@event.url)
%p - if @event.contact.present?
%em.fa.fa-envelope %p
%span.label= Event.human_attribute_name :contact %em.fa.fa-envelope
= mail_to @event.contact, nil, %span.label= Event.human_attribute_name :contact
encode: (request.format == 'text/html' ? :javascript : nil), = mail_to @event.contact, nil,
replace_at: ' CHEZ ', replace_dot: ' POINT ' encode: (request.format == 'text/html' ? :javascript : nil),
replace_at: ' CHEZ ', replace_dot: ' POINT '
- if @event.tags && @event.tags.present? - if @event.tags && @event.tags.present?
%p.tags %p.tags

View File

@ -8,8 +8,8 @@
!= display_attr @event, :region, @event.region != display_attr @event, :region, @event.region
!= display_attr @event, :locality, t("attributes.locality_#{@event.locality}") != display_attr @event, :locality, t("attributes.locality_#{@event.locality}")
!= display_attr @event, :url != display_attr @event, :url
!= display_attr @event, :contact - if @event.contact.present?
!= display_attr @event, :submitter != display_attr @event, :contact
!= display_attr @event, :tag_list, @event.tag_list != display_attr @event, :tag_list, @event.tag_list
- if @event.repeat > 0 - if @event.repeat > 0
= display_attr @event, :repeat = display_attr @event, :repeat