From 451556e589dd2184ecdbabb701b78b754cda4184 Mon Sep 17 00:00:00 2001 From: ryounes Date: Fri, 24 Jun 2011 14:44:03 +0000 Subject: [PATCH] Combine code for primaryEmail and email into a macro --- .../individual/individual-contactInfo.ftl | 52 ++++++++----------- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/productMods/templates/freemarker/body/partials/individual/individual-contactInfo.ftl b/productMods/templates/freemarker/body/partials/individual/individual-contactInfo.ftl index d50e8af8..2851c791 100644 --- a/productMods/templates/freemarker/body/partials/individual/individual-contactInfo.ftl +++ b/productMods/templates/freemarker/body/partials/individual/individual-contactInfo.ftl @@ -3,36 +3,10 @@ <#-- Contact info on individual profile page --> <#-- Primary Email --> -<#assign primaryEmail = propertyGroups.getPropertyAndRemoveFromList("${core}primaryEmail")!> -<#if primaryEmail?has_content> <#-- true when the property is in the list, even if not populated (when editing) --> - <@p.addLinkWithLabel primaryEmail editable /> - <#if primaryEmail.statements?has_content> <#-- if there are any statements --> - - - +<@emailLinks "${core}primaryEmail" "primary-email" /> -<#-- Additional Emails --> -<#assign email = propertyGroups.getPropertyAndRemoveFromList("${core}email")!> -<#if email?has_content> <#-- true when the property is in the list, even if not populated (when editing) --> - <@p.addLinkWithLabel email editable /> - <#if email.statements?has_content> <#-- if there are any statements --> - - - +<#-- Additional Emails --> +<@emailLinks "${core}email" "additional-emails" /> <#-- Phone --> <#assign phone = propertyGroups.getPropertyAndRemoveFromList("${core}phoneNumber")!> @@ -48,4 +22,22 @@ - \ No newline at end of file + + +<#macro emailLinks property listId> + <#assign email = propertyGroups.getPropertyAndRemoveFromList(property)!> + <#if email?has_content> <#-- true when the property is in the list, even if not populated (when editing) --> + <@p.addLinkWithLabel email editable /> + <#if email.statements?has_content> <#-- if there are any statements --> + + + + \ No newline at end of file