From d9773bfd5767e27deb8cd0a78d6d61680a8ef342 Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Sun, 15 Sep 2013 18:33:34 -0700 Subject: [PATCH] CRM-13398 - Update markup in Block.tpl for profile pre and post field help to match the
layout used in Dynamic.tpl. Fixes alignment issues. ---------------------------------------- * CRM-13398: Profile pre and post field help markup in Block.tpl messes up page layout http://issues.civicrm.org/jira/browse/CRM-13398 --- templates/CRM/UF/Form/Block.tpl | 183 ++++++++++++++++---------------- 1 file changed, 90 insertions(+), 93 deletions(-) diff --git a/templates/CRM/UF/Form/Block.tpl b/templates/CRM/UF/Form/Block.tpl index 6a4f54fb11..d7e7cb9d78 100644 --- a/templates/CRM/UF/Form/Block.tpl +++ b/templates/CRM/UF/Form/Block.tpl @@ -63,104 +63,101 @@ {if $action neq 4 && $action neq 1028} {$field.help_pre} {/if} - {elseif $field.options_per_line != 0} -
- {* Show explanatory text for field if not in 'view' or 'preview' modes *} - {if $field.help_pre && $action neq 4 && $action neq 1028} -   {$field.help_pre} - {/if} -
{$form.$n.label}
-
- {assign var="count" value="1"} - {strip} - - - {* sort by fails for option per line. Added a variable to iterate through the element array*} - {assign var="index" value="1"} - {foreach name=outer key=key item=item from=$form.$n} - {if $index < 10} - {assign var="index" value=`$index+1`} - {else} - - {if $count == $field.options_per_line} - - - {assign var="count" value="1"} - {else} - {assign var="count" value=`$count+1`} - {/if} - {/if} - {/foreach} - -
{$form.$n.$key.html}
- {/strip} - {* Show explanatory text for field if not in 'view' or 'preview' modes *} - {if $field.help_post && $action neq 4 && $action neq 1028} - {$field.help_post} - {/if} -
-
-
- {else} -
- {* Show explanatory text for field if not in 'view' or 'preview' modes *} - {if $field.help_pre && $action neq 4 && $action neq 1028} -   {$field.help_pre} - {/if} -
- {$form.$n.label} -
-
- {if $n|substr:0:3 eq 'im-'} - {assign var="provider" value=$n|cat:"-provider_id"} - {$form.$provider.html}  - {elseif $n|substr:0:4 eq 'url-'} - {assign var="websiteType" value=$n|cat:"-website_type_id"} - {$form.$websiteType.html}  - {/if} + {elseif $n} + {* Show explanatory text for field if not in 'view' or 'preview' modes *} + {if $field.help_pre && $action neq 4 && $action neq 1028} +
+
{$field.help_pre}
+
+ {/if} + {if $field.options_per_line != 0} +
+
{$form.$n.label}
+
+ {assign var="count" value="1"} + {strip} + + + {* sort by fails for option per line. Added a variable to iterate through the element array*} + {assign var="index" value="1"} + {foreach name=outer key=key item=item from=$form.$n} + {if $index < 10} + {assign var="index" value=`$index+1`} + {else} + + {if $count == $field.options_per_line} + + + {assign var="count" value="1"} + {else} + {assign var="count" value=`$count+1`} + {/if} + {/if} + {/foreach} + +
{$form.$n.$key.html}
+ {/strip} +
+
+
+ {else} +
+
+ {$form.$n.label} +
+
+ {if $n|substr:0:3 eq 'im-'} + {assign var="provider" value=$n|cat:"-provider_id"} + {$form.$provider.html}  + {elseif $n|substr:0:4 eq 'url-'} + {assign var="websiteType" value=$n|cat:"-website_type_id"} + {$form.$websiteType.html}  + {/if} - {if $n eq 'email_greeting' or $n eq 'postal_greeting' or $n eq 'addressee'} - {include file="CRM/Profile/Form/GreetingType.tpl"} - {elseif ($n eq 'group' && $form.group) || ($n eq 'tag' && $form.tag)} - {include file="CRM/Contact/Form/Edit/TagsAndGroups.tpl" type=$n title=null context="profile"} - {elseif ( ( $field.data_type eq 'Date' ) or - ( $n|substr:-5:5 eq '_date' ) ) AND - ( $form.formName neq 'Confirm' ) AND - ( $form.formName neq 'ThankYou' ) } - {include file="CRM/common/jcalendar.tpl" elementName=$n} - {elseif $n|substr:0:5 eq 'phone'} - {assign var="phone_ext_field" value=$n|replace:'phone':'phone_ext'} - {$form.$n.html} - {if $form.$phone_ext_field.html} -  {$form.$phone_ext_field.html} - {/if} - {else} - {$form.$n.html} - {if $n eq 'gender' && $form.$fieldName.frozen neq true} - ({ts}clear{/ts}) - {/if} - {/if} + {if $n eq 'email_greeting' or $n eq 'postal_greeting' or $n eq 'addressee'} + {include file="CRM/Profile/Form/GreetingType.tpl"} + {elseif ($n eq 'group' && $form.group) || ($n eq 'tag' && $form.tag)} + {include file="CRM/Contact/Form/Edit/TagsAndGroups.tpl" type=$n title=null context="profile"} + {elseif ( ( $field.data_type eq 'Date' ) or + ( $n|substr:-5:5 eq '_date' ) ) AND + ( $form.formName neq 'Confirm' ) AND + ( $form.formName neq 'ThankYou' ) } + {include file="CRM/common/jcalendar.tpl" elementName=$n} + {elseif $n|substr:0:5 eq 'phone'} + {assign var="phone_ext_field" value=$n|replace:'phone':'phone_ext'} + {$form.$n.html} + {if $form.$phone_ext_field.html} +  {$form.$phone_ext_field.html} + {/if} + {else} + {$form.$n.html} + {if $n eq 'gender' && $form.$fieldName.frozen neq true} + ({ts}clear{/ts}) + {/if} + {/if} - {*CRM-4564*} - {if $field.html_type eq 'Radio' && $form.$fieldName.frozen neq true && $field.is_required neq 1} - - ({ts}clear{/ts}) - - {elseif $field.html_type eq 'Autocomplete-Select'} - {if $field.data_type eq 'ContactReference'} - {include file="CRM/Custom/Form/ContactReference.tpl" element_name = $n} - {else} - {include file="CRM/Custom/Form/AutoComplete.tpl" element_name = $n} - {/if} - {/if} - - {* Show explanatory text for field if not in 'view' or 'preview' modes *} - {if $field.help_post && $action neq 4 && $action neq 1028} -
{$field.help_post} - {/if} + {*CRM-4564*} + {if $field.html_type eq 'Radio' && $form.$fieldName.frozen neq true && $field.is_required neq 1} + + ({ts}clear{/ts}) + + {elseif $field.html_type eq 'Autocomplete-Select'} + {if $field.data_type eq 'ContactReference'} + {include file="CRM/Custom/Form/ContactReference.tpl" element_name = $n} + {else} + {include file="CRM/Custom/Form/AutoComplete.tpl" element_name = $n} + {/if} + {/if}
+ {/if} + {* Show explanatory text for field if not in 'view' or 'preview' modes *} + {if $field.help_post && $action neq 4 && $action neq 1028} +
+
{$field.help_post}
+
+ {/if} {/if} {/foreach} -- 2.25.1