Update for new filters for fields plugin.
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 8 Aug 2018 19:20:21 +0000 (15:20 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 8 Aug 2018 19:20:21 +0000 (15:20 -0400)
New filter for the updates to custom fields plugin.

glm-member-db-contacts/views/front/contacts/list.html

index f0d3fd7..19bb22b 100644 (file)
@@ -230,13 +230,13 @@ and open the template in the editor.
                                             </span>
                                         </div>
                                         {/if}
-                                        {if $contact.country}
+                                        {if $contact.country.name}
                                         <div class="section-field">
                                             <span class="field-title">
                                                 Country
                                             </span>
                                             <span class="field-value">
-                                                {$contact.country}
+                                                {$contact.country.name}
                                             </span>
                                         </div>
                                         {/if}
@@ -337,17 +337,17 @@ and open the template in the editor.
                                             </span>
                                         </div>
                                         {/if}
-                                        {if $contact.business_city}
+                                        {if $contact.business_city.name}
                                         <div class="section-field">
                                             <span class="field-title">
                                                 City
                                             </span>
                                             <span class="field-value">
-                                                {$contact.business_city}
+                                                {$contact.business_city.name}
                                             </span>
                                         </div>
                                         {/if}
-                                        {if $contact.business_state}
+                                        {if $contact.business_state.name}
                                         <div class="section-field">
                                             <span class="field-title">
                                                 State
@@ -367,13 +367,13 @@ and open the template in the editor.
                                             </span>
                                         </div>
                                         {/if}
-                                        {if $contact.business_country}
+                                        {if $contact.business_country.name}
                                         <div class="section-field">
                                             <span class="field-title">
                                                 Country
                                             </span>
                                             <span class="field-value">
-                                                {$contact.business_country}
+                                                {$contact.business_country.name}
                                             </span>
                                         </div>
                                         {/if}
@@ -429,23 +429,29 @@ and open the template in the editor.
                                         {/if}
                                     </div>
                                 </div>
-                                
+
                         {/if}
                                 <div class="custom-info section-container">
-                                    <h3 class="section-title">Custom Information</h3>
+                                    <h3 class="section-title">
+                                        {apply_filters('get_glm_custom_field_tab_name', 'Custom Fields')}
+                                    </h3>
                                     <div class="section-data">
-                                        {$customFields = apply_filters('get_glm_custom_fields','glm-member-db',$contact.id)}
-                                        
-                                        {if !empty($customFields[0].field_data)}            
-                                            {foreach $customFields as $field}
-                                                {if $field.field_data}
-                                                    <div class="glm-member-detail-custom-field">
-                                                        <div class="row">
-                                                            <span class="glm-member-detail-custom-field-name small-12 medium-5 columns">{$field.field_name}</span>
-                                                            <span class="glm-member-detail-custom-field-data small-12 medium-7 columns">{$field.field_data}</span>
-                                                        </div>
-                                                        
-                                                    </div>
+                                        {$customFieldGroups = apply_filters('get_glm_custom_grouped_fields','glm-member-db-contacts',$contact.id)}
+
+                                        {if $customFieldGroups}
+                                            {foreach  $customFieldGroups as $customFields}
+                                                {if !empty($customFields[0].field_data)}
+                                                    {foreach $customFields as $field}
+                                                        {if $field.field_data}
+                                                            <div class="glm-member-detail-custom-field">
+                                                                <div class="row">
+                                                                    <span class="glm-member-detail-custom-field-name small-12 medium-5 columns">{$field.field_name}</span>
+                                                                    <span class="glm-member-detail-custom-field-data small-12 medium-7 columns">{$field.field_data}</span>
+                                                                </div>
+
+                                                            </div>
+                                                        {/if}
+                                                    {/foreach}
                                                 {/if}
                                             {/foreach}
                                         {/if}
@@ -486,7 +492,7 @@ and open the template in the editor.
             } else {
                 $(this).text("Hide full profile");
             }
-            myProfile.toggleClass("expanded"); 
+            myProfile.toggleClass("expanded");
         });
         $('.hide-contact-full-profile').on('click', function() {
             $(this).parent().toggleClass("expanded");
@@ -494,4 +500,4 @@ and open the template in the editor.
         });
     });
 
-</script>
\ No newline at end of file
+</script>