From 313843d7980b687aa3e4fd3292d6ce93ca19806c Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 5 Feb 2015 15:50:33 +1100 Subject: [PATCH] moving contact partial and giving example code --- .../groups/_contact.html.haml} | 26 ++++++++++++++----- app/views/groups/show.html.haml | 2 +- 2 files changed, 20 insertions(+), 8 deletions(-) rename app/{assets/javascripts/templates/partials/group-contact.html.haml => views/groups/_contact.html.haml} (83%) diff --git a/app/assets/javascripts/templates/partials/group-contact.html.haml b/app/views/groups/_contact.html.haml similarity index 83% rename from app/assets/javascripts/templates/partials/group-contact.html.haml rename to app/views/groups/_contact.html.haml index ea56fe244a..8dd8c7724e 100644 --- a/app/assets/javascripts/templates/partials/group-contact.html.haml +++ b/app/views/groups/_contact.html.haml @@ -1,10 +1,22 @@ %div.contact-container{bindonce: true} - / - if @group.email || @group.website || @group.phone - %div.modal-centered - %p.modal-header Contact - %p - Container for contact info - / = @group.phone + + - if @group.email.present? || @group.website.present? || @group.phone.present? + %div.modal-centered + %p.modal-header Contact + %p + - if @group.phone.present? && @group.phone != 'undefined' + Call + %a{tel: @group.phone} + = @group.phone + - if @group.email.present? + Email + %a{mailto: true, href: @group.email.reverse} + = @group.email.gsub('@', ' at ').gsub('.', ' dot ') + - if @group.website.present? + Website + %a{href: @group.website} + = @group.website + %div.contact-container{bindonce: true} / - if @group.email || @group.website || @group.phone @@ -109,4 +121,4 @@ / %a{title:'Visit our website', href: 'http://' + @group.website, target: '_blank'} / %i.ofn-i_049-web / %p - /   \ No newline at end of file + /   diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml index 09e0eff0b9..0d5b8ed0b9 100644 --- a/app/views/groups/show.html.haml +++ b/app/views/groups/show.html.haml @@ -84,7 +84,7 @@ = render partial: 'shared/components/enterprise_no_results' .small-12.medium-4.columns - %ng-include{src: "'partials/group-contact.html'"} + = render partial: 'contact' / %h4 Contact us / - if @group.phone / .row