From 94afc70ea7367c74a07b41fc17878b632b9e145e Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Mon, 13 Jan 2020 17:14:22 +0100 Subject: [PATCH] Refactor conditionals in contact tab view --- app/views/shopping_shared/tabs/_contact.html.haml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/shopping_shared/tabs/_contact.html.haml b/app/views/shopping_shared/tabs/_contact.html.haml index 4c4b6c485a..2091779f09 100644 --- a/app/views/shopping_shared/tabs/_contact.html.haml +++ b/app/views/shopping_shared/tabs/_contact.html.haml @@ -23,14 +23,14 @@ .header = t :shopping_contact_web %p - - unless current_distributor.phone.blank? + - if current_distributor.phone.present? = current_distributor.phone %br - - unless current_distributor.website.blank? + - if current_distributor.website.present? %a{href: "http://#{current_distributor.website}", target: "_blank" } = current_distributor.website %br - - unless current_distributor.email_address.blank? + - if current_distributor.email_address.present? %a{href: current_distributor.email_address.reverse, mailto: true} %span.email = current_distributor.email_address.reverse @@ -41,24 +41,24 @@ .header = t :shopping_contact_social %div.follow-icons - - unless current_distributor.twitter.blank? + - if current_distributor.twitter.present? %span %a{href: "http://twitter.com/#{current_distributor.twitter}", target: "_blank" } %i.ofn-i_041-twitter - - unless current_distributor.facebook.blank? + - if current_distributor.facebook.present? %span %a{href: "http://#{current_distributor.facebook}", target: "_blank" } %i.ofn-i_044-facebook / = current_distributor.facebook - - unless current_distributor.linkedin.blank? + - if current_distributor.linkedin.present? %span %a{href: "http://#{current_distributor.linkedin}", target: "_blank" } %i.ofn-i_042-linkedin / = current_distributor.linkedin - - unless current_distributor.instagram.blank? + - if current_distributor.instagram.present? %span %a{href: "http://instagram.com/#{current_distributor.instagram}", target: "_blank" } %i.ofn-i_043-instagram