Skip to content

Commit e3c0eb8

Browse files
committed
Merge branch 'develop'
2 parents 4d87e11 + 417db1b commit e3c0eb8

53 files changed

Lines changed: 2410 additions & 493 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

archive-template.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ class="second-bar show-for-small-only center list-actions-bar"><!-- /* MOBILE V
136136
<a class="button filter-posts-mobile" data-open="filter-modal">
137137
<img class="dt-white-icon" style="display: inline-block;" src="<?php echo esc_html( get_template_directory_uri() . '/dt-assets/images/filter.svg?v=2' ) ?>"/>
138138
</a>
139+
<?php do_action( 'archive_template_mobile_action_bar_buttons', $post_type ) ?>
139140
<a class="button" id="open-search">
140141
<img class="dt-white-icon" style="display: inline-block;" src="<?php echo esc_html( get_template_directory_uri() . '/dt-assets/images/search.svg' ) ?>"/>
141142
</a>
@@ -549,7 +550,7 @@ class="second-bar show-for-small-only center list-actions-bar"><!-- /* MOBILE V
549550
});
550551

551552
?>
552-
553+
553554
<div class="field-selection-ui">
554555
<!-- Search input for adding fields -->
555556
<div style="margin-bottom: 15px;">
@@ -566,7 +567,7 @@ class="second-bar show-for-small-only center list-actions-bar"><!-- /* MOBILE V
566567
$has_icon = !empty( $field_values['icon'] ) || !empty( $field_values['font-icon'] );
567568
$option_classes = 'field-search-option' . ( $has_icon ? '' : ' no-icon' );
568569
?>
569-
<div class="<?php echo esc_attr( $option_classes ); ?> field-search-option-inline" data-field-key="<?php echo esc_attr( $field_key ); ?>"
570+
<div class="<?php echo esc_attr( $option_classes ); ?> field-search-option-inline" data-field-key="<?php echo esc_attr( $field_key ); ?>"
570571
data-field-name="<?php echo esc_attr( strtolower( $field_values['name'] ) ); ?>">
571572
<?php dt_render_field_icon( $field_values ); ?>
572573
<span><?php echo esc_html( $field_values['name'] ); ?></span>

dt-assets/build/components/index.es.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { B as s, C as e, v as D, A as o, D as l, b as i, c as n, e as r, f as c, a as p, u, z as C, g as M, w as T, h as x, i as S, j as d, x as g, k as m, t as B, r as h, l as A, m as L, n as b, o as v, p as f, y as w, q as y, d as F } from "./index-7wgY4N1f.js";
1+
import { B as s, C as e, v as D, A as o, D as l, b as i, c as n, e as r, f as c, a as p, u, z as C, g as M, w as T, h as x, i as S, j as d, x as g, k as m, t as B, r as h, l as A, m as L, n as b, o as v, p as f, y as w, q as y, d as F } from "./index-BCZ_PsZV.js";
22
export {
33
s as ApiService,
44
e as ComponentService,

dt-assets/build/components/index.js

Lines changed: 226 additions & 111 deletions
Large diffs are not rendered by default.

dt-assets/build/components/index.umd.cjs

Lines changed: 226 additions & 111 deletions
Large diffs are not rendered by default.

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.

dt-assets/build/js/scripts.min.js

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/functions/details-bar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class="second-bar" id="second-bar-large">
118118

119119
<img class="dt-storage-picture details-bar-picture"
120120
src="<?php echo esc_html( $picture_thumbnail )?>"
121-
alt="<?php esc_attr_e( 'Record Picture', 'disciple_tools' ) ?>"
121+
alt="<?php echo esc_attr_x( 'Record Picture', 'the picture of the record', 'disciple_tools' ) ?>"
122122
style="<?php echo esc_attr( $picture_style ) ?>"
123123
data-picture_url="<?php echo esc_html( $picture )?>"
124124
data-picture_large_thumbnail_url="<?php echo esc_html( $picture_large_thumbnail )?>"

dt-assets/js/advanced-search.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ jQuery(document).ready(function ($) {
114114

115115
function execute_search_query_by_offset(evt, current_section_head) {
116116
let query = $('.advanced-search-modal-form-input').val();
117-
let offset = evt.currentTarget.parentNode.parentNode
117+
let offset = evt.target.parentNode.parentNode
118118
.querySelector(
119119
'#advanced-search-modal-results-table-row-section-head-hidden-offset',
120120
)
121121
.getAttribute('value');
122-
let post_type = evt.currentTarget.parentNode.parentNode
122+
let post_type = evt.target.parentNode.parentNode
123123
.querySelector(
124124
'#advanced-search-modal-results-table-row-section-head-hidden-post-type',
125125
)
@@ -152,7 +152,7 @@ jQuery(document).ready(function ($) {
152152
);
153153

154154
// Update section offset value
155-
evt.currentTarget.parentNode.parentNode
155+
evt.target.parentNode.parentNode
156156
.querySelector(
157157
'#advanced-search-modal-results-table-row-section-head-hidden-offset',
158158
)
@@ -171,7 +171,7 @@ jQuery(document).ready(function ($) {
171171
});
172172
} else {
173173
// Hide more search option when there are no further hits to be returned.
174-
evt.currentTarget.style.display = 'none';
174+
evt.target.style.display = 'none';
175175
}
176176
})
177177
.catch((error) => {
@@ -263,15 +263,22 @@ jQuery(document).ready(function ($) {
263263
'<table class="advanced-search-modal-results-table" style="border-spacing: 0px 5px !important; border-collapse: separate;"><tbody>';
264264
results.forEach(function (result) {
265265
results_html += '<tr>';
266+
266267
results_html +=
267-
'<td class="advanced-search-modal-results-table-section-head-options"><a class="advanced-search-modal-results-table-row-section-head-load-more button hollow">' +
268-
window.SHAREDFUNCTIONS.escapeHTML(fetch_more_text) +
269-
'</a></td>';
268+
'<td class="advanced-search-modal-results-table-section-head-options">';
269+
if (result?.remaining_count > 0 || result?.has_more === true) {
270+
results_html +=
271+
'<a class="advanced-search-modal-results-table-row-section-head-load-more button hollow">' +
272+
window.SHAREDFUNCTIONS.escapeHTML(fetch_more_text) +
273+
'</a>';
274+
}
275+
results_html += '</td>';
276+
270277
results_html +=
271278
'<td class="advanced-search-modal-results-table-section-head-post-type">';
272279
results_html +=
273280
'<b>' +
274-
window.SHAREDFUNCTIONS.escapeHTML(result['post_type']) +
281+
window.SHAREDFUNCTIONS.escapeHTML(result['post_type_label_singular']) +
275282
'</b></td>';
276283
results_html +=
277284
'<input type="hidden" id="advanced-search-modal-results-table-row-section-head-hidden-offset" value="' +

dt-assets/js/details.js

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,39 @@ jQuery(document).ready(function ($) {
502502
});
503503
});
504504

505+
/* field type: tags */
506+
let tags_field = null;
507+
$('dt-tags').on('dt:add-new', (e) => {
508+
tags_field = e.detail.field;
509+
$('#create-tag-modal').foundation('open');
510+
$('.js-create-tag input[name=title]').val(e.detail.value);
511+
});
512+
513+
$('.js-create-tag').on('submit', (e) => {
514+
e.preventDefault();
515+
516+
const tag = $('#new-tag').val();
517+
const field = document.querySelector(`#${tags_field}`);
518+
if (field) {
519+
// select the tag and the change event will handle saving it
520+
field._select(tag);
521+
field._clearSearch();
522+
}
523+
});
524+
525+
// new record from group member list
526+
$('.create-new-record').on('click', function () {
527+
connection_type = $(this).data('connection-key');
528+
$('#create-record-modal').foundation('open');
529+
$('.js-create-record .error-text').empty();
530+
$('.js-create-record-button').attr('disabled', false).removeClass('alert');
531+
$('.reveal-after-record-create').hide();
532+
$('.hide-after-record-create').show();
533+
$('.js-create-record input[name=title]').val('');
534+
});
535+
536+
/* field type: connection */
505537
let connection_type = null;
506-
// New record off of dt-connection
507538
$('dt-connection').on('change', (e) => {
508539
if (e?.detail?.newValue && e.detail.newValue.some((x) => x.isNew)) {
509540
e.stopImmediatePropagation(); // stop ComponentService listener from firing
@@ -522,7 +553,15 @@ jQuery(document).ready(function ($) {
522553
$('.js-create-record input[name=title]').val(newPost.label);
523554
}
524555
});
525-
556+
$('dt-connection').on('dt:add-new', (e) => {
557+
connection_type = e.detail.field;
558+
$('#create-record-modal').foundation('open');
559+
$('.js-create-record .error-text').empty();
560+
$('.js-create-record-button').attr('disabled', false).removeClass('alert');
561+
$('.reveal-after-record-create').hide();
562+
$('.hide-after-record-create').show();
563+
$('.js-create-record input[name=title]').val(e.detail.value);
564+
});
526565
/* New Record Modal */
527566
$('.js-create-record').on('submit', function (e) {
528567
e.preventDefault();
@@ -570,6 +609,7 @@ jQuery(document).ready(function ($) {
570609
[newRecord],
571610
)[0],
572611
);
612+
field._clearSearch();
573613
}
574614
})
575615
.catch(function (error) {
@@ -1316,6 +1356,7 @@ function record_updated(updateNeeded) {
13161356
* that make use of them. Leaving them here until we can be sure they can be
13171357
* completely removed.
13181358
*/
1359+
13191360
jQuery(document).ready(function ($) {
13201361
let post_id = window.detailsSettings.post_id;
13211362
let post_type = window.detailsSettings.post_type;

dt-assets/js/footer-scripts.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,19 @@ jQuery(document).ready(function ($) {
8888
required_parent.find('a').first().addClass('side-menu-item-highlight');
8989
}
9090
});
91+
92+
/**
93+
* Mobile navigation dropdown functionality
94+
*/
95+
jQuery(document).ready(function ($) {
96+
// Close mobile add new dropdown when clicking outside
97+
$(document).on('click', function (e) {
98+
if (
99+
!$(e.target).closest(
100+
'#mobile-add-new-dropdown, [data-toggle="mobile-add-new-dropdown"]',
101+
).length
102+
) {
103+
$('#mobile-add-new-dropdown').foundation('close');
104+
}
105+
});
106+
});

0 commit comments

Comments
 (0)