Skip to content

Commit 6ee95eb

Browse files
committed
Refactor bulk edit functionality to enhance field selection and improve user experience. Removed deprecated elements from the archive template, streamlined JavaScript for dynamic field handling, and updated CSS for better styling consistency. Added support for new field types and improved handling of existing fields in the backend.
1 parent 33d24a1 commit 6ee95eb

7 files changed

Lines changed: 733 additions & 217 deletions

File tree

archive-template.php

Lines changed: 1 addition & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -629,102 +629,6 @@ class="second-bar show-for-small-only center list-actions-bar"><!-- /* MOBILE V
629629
<p style="font-weight:bold"><?php
630630
echo sprintf( esc_html__( 'Select all the %1$s you want to update from the list, and update them below', 'disciple_tools' ), esc_html( $post_type ) );?></p>
631631
<div class="grid-x">
632-
<?php if ( isset( $field_options['assigned_to'] ) ) : ?>
633-
<div class="cell small-12">
634-
<div class="section-subheader">
635-
<img src="<?php echo esc_url( get_template_directory_uri() ) . '/dt-assets/images/assigned-to.svg' ?>">
636-
<?php echo esc_html( $field_options['assigned_to']['name'] ); ?>
637-
<button class="help-button" data-section="assigned-to-help-text">
638-
<img class="help-icon" src="<?php echo esc_html( get_template_directory_uri() . '/dt-assets/images/help.svg' ) ?>"/>
639-
</button>
640-
</div>
641-
<div class="bulk_assigned_to details">
642-
<var id="bulk_assigned_to-result-container" class="result-container bulk_assigned_to-result-container"></var>
643-
<div id="bulk_assigned_to_t" name="form-bulk_assigned_to" class="scrollable-typeahead">
644-
<div class="typeahead__container" style="margin-bottom: 0">
645-
<div class="typeahead__field">
646-
<span class="typeahead__query">
647-
<input class="js-typeahead-bulk_assigned_to input-height" dir="auto"
648-
name="bulk_assigned_to[query]" placeholder="<?php echo esc_html_x( 'Search Users', 'input field placeholder', 'disciple_tools' ) ?>"
649-
autocomplete="off">
650-
</span>
651-
</div>
652-
</div>
653-
</div>
654-
</div>
655-
</div>
656-
<?php endif; ?>
657-
658-
<?php if ( $post_type == 'contacts' ) {?>
659-
<?php if ( isset( $field_options['subassigned'] ) ) : ?>
660-
<div class="cell small-12">
661-
<?php $field_options['subassigned']['custom_display'] = false ?>
662-
<?php render_field_for_display( 'subassigned', $field_options, null, false, false, 'bulk_', $field_params ); ?>
663-
</div>
664-
<?php endif; ?>
665-
<?php if ( isset( $field_options['overall_status'] ) ) : ?>
666-
<div class="cell small-12">
667-
<?php
668-
$field_key = 'overall_status';
669-
if ( isset( $field_options[$field_key]['select_cannot_be_empty'] ) ) {
670-
unset( $field_options[$field_key]['select_cannot_be_empty'] );
671-
}
672-
DT_Components::render_key_select( 'overall_status', $field_options, null, $field_params );
673-
?>
674-
</div>
675-
<?php endif; ?>
676-
<?php if ( isset( $field_options['reason_paused'] ) ) : ?>
677-
<div class="cell small-12" style="display:none">
678-
<?php
679-
render_field_for_display( 'reason_paused', $field_options, null, false, false, 'bulk_', $field_params );
680-
?>
681-
</div>
682-
<?php endif; ?>
683-
684-
<?php } elseif ( $post_type == 'groups' ) {?>
685-
<div class="cell small-12">
686-
<?php $field_options['coaches']['custom_display'] = false ?>
687-
<?php
688-
render_field_for_display( 'coaches', $field_options, null, false, false, 'bulk_' ); ?>
689-
</div>
690-
<?php } ?>
691-
<div class="cell small-12">
692-
<div class="section-subheader">
693-
<?php esc_html_e( 'Share with:', 'disciple_tools' );?>
694-
</div>
695-
<div id="<?php echo esc_attr( 'bulk_share_connection' ) ?>" class="dt_typeahead">
696-
<span id="<?php echo esc_html( 'share' ); ?>-result-container" class="result-container"></span>
697-
<div id="<?php echo esc_html( 'share' ); ?>_t" name="form-<?php echo esc_html( 'share' ); ?>" class="scrollable-typeahead typeahead-margin-when-active">
698-
<div class="typeahead__container" style="margin-bottom: 0">
699-
<div class="typeahead__field">
700-
<span class="typeahead__query">
701-
<input id = "bulk_share" class="input-height" data-field="<?php echo esc_html( 'share' ); ?>"
702-
data-post_type="<?php echo esc_html( $post_type ) ?>"
703-
data-field_type="connection"
704-
name="share[query]"
705-
placeholder="<?php echo esc_html( sprintf( _x( 'Search %s', "Search 'something'", 'disciple_tools' ), 'Users' ) )?>"
706-
autocomplete="off">
707-
</span>
708-
</div>
709-
</div>
710-
</div>
711-
<label style="display: inline-block">
712-
<input type="checkbox" id="bulk_share_unshare">
713-
<?php esc_html_e( 'Unshare with selected user', 'disciple_tools' ); ?>
714-
</label>
715-
</div>
716-
</div>
717-
<?php if ( isset( $field_options['requires_update'] ) ) : ?>
718-
<div class="cell small-12 center-items">
719-
<span style="margin-right:5px"><?php echo esc_html( $field_options['requires_update']['name'] ); ?>:</span>
720-
<input type="checkbox" id="update-needed-bulk" class="dt-switch update-needed" data-bulk_key_requires_update=""/>
721-
<label class="dt-switch" for="update-needed-bulk" style="vertical-align: top;"></label>
722-
</div>
723-
<?php endif; ?>
724-
<div class="cell small-12 center-items">
725-
<button class="button follow" data-value=""><?php echo esc_html( __( 'Follow', 'disciple_tools' ) ) ?></button>
726-
</div>
727-
728632
<div class="cell small-12 medium-12 grid-y">
729633
<div class="section-subheader">
730634
<?php esc_html_e( 'Comments and Activity', 'disciple_tools' ) ?>
@@ -761,15 +665,12 @@ class="second-bar show-for-small-only center list-actions-bar"><!-- /* MOBILE V
761665

762666
<!-- Dynamic Field Selection Section -->
763667
<div class="cell small-12" id="bulk_edit_dynamic_fields_section">
764-
<div class="section-subheader" style="margin-top: 20px; padding-top: 20px; border-top: 1px solid #e0e0e0;">
668+
<div class="section-subheader">
765669
<?php esc_html_e( 'Add Fields to Update', 'disciple_tools' ); ?>
766670
</div>
767671

768672
<!-- Field Selection with dt-multi-select -->
769673
<div class="bulk-edit-field-select-wrapper" style="margin-bottom: 15px;">
770-
<label for="bulk_edit_field_selector" class="field-search-label">
771-
<?php esc_html_e( 'Search and add fields:', 'disciple_tools' ); ?>
772-
</label>
773674
<dt-multi-select
774675
id="bulk_edit_field_selector"
775676
name="bulk_edit_field_selector"

dt-assets/build/css/light.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dt-assets/build/css/style.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)