From 7cdfc180afe6c3c2e6eb61e81ea77f1f0357b2b6 Mon Sep 17 00:00:00 2001 From: jlamanskygitt Date: Thu, 22 Jan 2026 13:54:05 -0500 Subject: [PATCH 1/4] Removed unused Health Metrics js --- dt-groups/groups.js | 140 -------------------------------------------- 1 file changed, 140 deletions(-) diff --git a/dt-groups/groups.js b/dt-groups/groups.js index 33fb9e340f..b9dabb9893 100644 --- a/dt-groups/groups.js +++ b/dt-groups/groups.js @@ -3,146 +3,6 @@ jQuery(document).ready(function ($) { let post_id = window.detailsSettings.post_id; let post_type = window.detailsSettings.post_type; let post = window.detailsSettings.post_fields; - let field_settings = window.detailsSettings.post_settings.fields; - - /* Health Metrics */ - let health_keys = Object.keys(field_settings.health_metrics.default); - - function fillOutChurchHealthMetrics() { - let practiced_items = - window.detailsSettings.post_fields.health_metrics || []; - - /* Make church commitment circle green */ - if (practiced_items.indexOf('church_commitment') !== -1) { - $('#health-items-container').addClass('committed'); - $('#is-church-switch').prop('checked', true); - } - - /* Color church circle items that are being practiced */ - let items = $('div[id^="icon_"]'); - - items.each(function (k, v) { - if ( - practiced_items.indexOf(v.id.replace('icon_', ''), practiced_items) !== - -1 - ) { - $(this).children('img').attr('class', 'practiced-item'); - } - }); - - /* Color group progress buttons */ - let icons = $('.group-progress-button'); - icons.each(function (k, v) { - if (practiced_items.indexOf(v.id, practiced_items) !== -1) { - $(this).addClass('practiced-button'); - } - }); - } - - fillOutChurchHealthMetrics(); - distributeItems(); - - $('.health-item').on('click', function () { - let fieldId = $(this).attr('id').replace('icon_', ''); - let already_set = window.lodash - .get(post, 'health_metrics', []) - .includes(fieldId); - let update = { values: [{ value: fieldId }] }; - if (already_set) { - update.values[0].delete = true; - } - window.API.update_post(post_type, post_id, { health_metrics: update }) - .then((groupData) => { - post = groupData; - /* Update icon */ - if ($(this).attr('id') === 'church_commitment') { - $('#health-items-container').toggleClass('committed'); - $(this).toggleClass('practiced-button'); - return true; - } - /* Toggle church health circle item color */ - $(this).children('img').toggleClass('practiced-item'); - $(this).children('i').toggleClass('practiced-item'); - }) - .catch((err) => { - console.log(err); - }); - }); - - $('#is-church-switch').on('click', function () { - let fieldId = 'church_commitment'; - let already_set = window.lodash - .get(post, 'health_metrics', []) - .includes(fieldId); - let update = { values: [{ value: fieldId }] }; - if (already_set) { - update.values[0].delete = true; - } - window.API.update_post(post_type, post_id, { health_metrics: update }) - .then((groupData) => { - post = groupData; - /* Update commitment circle */ - $('#health-items-container').toggleClass('committed'); - }) - .catch((err) => { - console.log(err); - }); - }); - - /* Dynamically distribute items in Church Health Circle - according to amount of health metric elements */ - function distributeItems() { - let radius = 75; - let items = $('.health-item'), - container = $('#health-items-container'), - item_count = items.length, - fade_delay = 45, - width = container.width(), - height = container.height() + 66, - angle = 0, - step = (2 * Math.PI) / items.length, - y_offset = -35; - - if (item_count >= 5 && item_count < 7) { - radius = 90; - } - - if ((item_count >= 7) & (item_count < 11)) { - radius = 100; - } - - if (item_count >= 11) { - radius = 110; - } - - if (item_count == 3) { - angle = 22.5; - } - - items.each(function () { - let X = Math.round( - width / 2 + radius * Math.cos(angle) - $(this).width() / 2, - ); - let y = - Math.round( - height / 2 + radius * Math.sin(angle) - $(this).height() / 2, - ) + y_offset; - - if (item_count == 1) { - X = 112.5; - y = 68; - } - - $(this).css({ - left: X + 'px', - top: y + 'px', - }); - $(this).delay(fade_delay).fadeIn(1000, 'linear'); - angle += step; - fade_delay += 45; - }); - } - /* End Health Metrics*/ let { template_dir } = window.wpApiShare; From 7410e4a78a88b0fd87d19a6414222cdd2835a476 Mon Sep 17 00:00:00 2001 From: Brady Lamansky Date: Thu, 21 May 2026 09:48:24 -0500 Subject: [PATCH 2/4] replaced user management fields w/ dt web components --- dt-core/utilities/dt-components.php | 2 + dt-users/template-new-user.php | 112 ++++++++++++++++++-------- dt-users/template-user-management.php | 67 +++++++++------ dt-users/user-management.js | 4 +- 4 files changed, 124 insertions(+), 61 deletions(-) diff --git a/dt-core/utilities/dt-components.php b/dt-core/utilities/dt-components.php index 30507fdb77..e230d823d9 100644 --- a/dt-core/utilities/dt-components.php +++ b/dt-core/utilities/dt-components.php @@ -59,6 +59,8 @@ public static function shared_attributes( $field_key, $fields, $post, $params = $shared_attributes = ' id="' . esc_attr( $display_field_id ) . '" name="' . esc_attr( $field_key ) . '" + placeholder="' . esc_attr( $params['placeholder'] ?? '' ) . '" + ' . $class . ' ' . $label_attr . ' ' . esc_html( $post_type ?? '' ) . ' ' . esc_html( $icon ) . ' diff --git a/dt-users/template-new-user.php b/dt-users/template-new-user.php index 55b673d06e..01f165ff52 100644 --- a/dt-users/template-new-user.php +++ b/dt-users/template-new-user.php @@ -111,15 +111,48 @@
-
-
-
-
+
+
+ [ + 'name' => __( 'Display Name', 'disciple_tools' ), + 'type' => 'text', + 'default' => '', + ] + ], [], ['placeholder' => 'Nickname (Display Name)'] ) ?> +
+
+
+ [ + 'name' => __( 'Email', 'disciple_tools' ), + 'type' => 'text', + 'default' => '', + 'required' => true, + ] + ], [], ['placeholder' => 'Email'] ) ?> +
@@ -175,23 +208,36 @@
-
-
+
+
+ [ + 'name' => __( 'First Name (optional)', 'disciple_tools' ), + 'type' => 'text', + 'default' => '', + ] + ], [], ['placeholder' => 'First Name'] ) ?>
-
-
-
+
- + [ + 'name' => __( 'Last Name (optional)', 'disciple_tools' ), + 'type' => 'text', + 'default' => '', + ] + ], [], ['placeholder' => 'Last Name'] ) ?> +
+
+
+ [ + 'name' => __( 'Gender (optional)', 'disciple_tools' ), + 'type' => 'key_select', + 'default' => $gender_fields['default'], + 'select_cannot_be_empty' => true, + ] + ], [ 'key_select' => [ 'key' => 'male' ] ], [] ) ?>
-
-
+
+ [ + 'name' => $dt_field['label'], + 'type' => 'text', + 'default' => '', + ] + ], [], ['placeholder' => $dt_field['label'], 'data-optional' => true] ) ?>
-