Skip to content

Commit 97511e3

Browse files
committed
Merge branch 'develop' of github.com:DiscipleTools/disciple-tools-theme into develop
2 parents 666b3bd + 4767d47 commit 97511e3

10 files changed

Lines changed: 556 additions & 410 deletions

File tree

archive-template.php

Lines changed: 85 additions & 123 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/functions/enqueue-scripts.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ function dt_site_scripts() {
334334
'empty_custom_filters' => __( 'No filters, create one below', 'disciple_tools' ),
335335
'empty_list' => __( 'No records found matching your filter.', 'disciple_tools' ),
336336
'filter_all' => sprintf( _x( 'All %s', 'All records', 'disciple_tools' ), $post_settings['label_plural'] ),
337+
'split_by' => __( 'Split By', 'disciple_tools' ),
337338
'range_start' => __( 'start', 'disciple_tools' ),
338339
'range_end' => __( 'end', 'disciple_tools' ),
339340
'all' => __( 'All', 'disciple_tools' ),

dt-assets/js/modular-list.js

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,13 @@
554554
if (!list_settings.filters.tabs) {
555555
return;
556556
}
557+
list_settings.filters.tabs.push({
558+
key: 'split_by',
559+
label: list_settings.translations.split_by,
560+
order: 98, // right before Custom Filters
561+
});
562+
list_settings.filters.tabs.sort((a, b) => (a.order || 0) - (b.order || 0));
563+
557564
let selected_tab = $('.accordion-item.is-active').data('id');
558565
let selected_filter = $('.js-list-view:checked').data('id');
559566
let html = ``;
@@ -565,7 +572,20 @@
565572
<span class="tab-count-span" data-tab="${window.SHAREDFUNCTIONS.escapeHTML(tab.key)}">
566573
${Number.isInteger(tab.count) ? `(${window.SHAREDFUNCTIONS.escapeHTML(tab.count)})` : ``}
567574
</span>
568-
</a>
575+
</a>`;
576+
577+
if (tab.key === 'split_by') {
578+
const split_by_content = document
579+
.getElementById('template-split-by-filter')
580+
.cloneNode(true);
581+
html += `
582+
<div class="accordion-content" data-tab-content>
583+
${split_by_content.innerHTML}
584+
</div>
585+
</li>
586+
`;
587+
} else {
588+
html += `
569589
<div class="accordion-content" data-tab-content>
570590
<div class="list-views">
571591
${list_settings.filters.filters
@@ -589,6 +609,7 @@
589609
</div>
590610
</li>
591611
`;
612+
}
592613
});
593614
filter_accordions.html(html);
594615

@@ -1667,6 +1688,9 @@
16671688
search_query,
16681689
new_filter_labels,
16691690
);
1691+
if (window.Foundation.MediaQuery.only('small')) {
1692+
$('#tile-filters').addClass('collapsed');
1693+
}
16701694
});
16711695

16721696
$(document).on('click', '.current-filter-label-button', function () {
@@ -2924,27 +2948,19 @@
29242948
});
29252949

29262950
$('.search-input--desktop').on('keyup', function (e) {
2927-
clearSearchButton.css({ display: this.value.length ? 'flex' : 'none' });
29282951
if (e.keyCode === 13) {
29292952
$('#search').trigger('click');
29302953
}
29312954
});
29322955

29332956
$('.search-input--mobile').on('keyup', function (e) {
2934-
clearSearchButton.css({ display: this.value.length ? 'flex' : 'none' });
29352957
if (e.keyCode === 13) {
29362958
$('#search-mobile').trigger('click');
29372959
}
29382960
});
29392961

29402962
clearSearchButton.on('click', function () {
29412963
$('.search-input').val('');
2942-
clearSearchButton.css({ display: 'none' });
2943-
});
2944-
2945-
//toggle show search input on mobile
2946-
$('#open-search').on('click', function () {
2947-
$('.hideable-search').toggle();
29482964
});
29492965

29502966
/***
@@ -4098,7 +4114,7 @@
40984114
html += `
40994115
<label class="list-view">
41004116
<input class="js-list-view-split-by" type="radio" name="split_by_list_view" ${option_selected ? 'checked' : ''} value="${window.SHAREDFUNCTIONS.escapeHTML(option_id)}" data-field_id="${window.SHAREDFUNCTIONS.escapeHTML(field_id)}" data-field_option_id="${window.SHAREDFUNCTIONS.escapeHTML(option_id)}" data-field_option_label="${window.SHAREDFUNCTIONS.escapeHTML(option_id_label)}" autocomplete="off">
4101-
<span>${window.SHAREDFUNCTIONS.escapeHTML(option_id_label)}</span>
4117+
<span class="list-view__text">${window.SHAREDFUNCTIONS.escapeHTML(option_id_label)}</span>
41024118
<span class="list-view__count js-list-view-count" data-value="${window.SHAREDFUNCTIONS.escapeHTML(option_id)}">${window.SHAREDFUNCTIONS.escapeHTML(result['count'])}</span>
41034119
</label>
41044120
`;

dt-assets/parts/nav-topbar.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,12 @@
203203
</div>
204204

205205
<!-- MOBILE VIEW TOP LEFT SIDE MENU AREA -->
206-
<div data-sticky-container class="show-for-small-only">
207-
<div data-sticky data-responsive-toggle='top-bar-menu' data-margin-top='0' data-sticky-on='small'>
206+
<div class="show-for-small-only">
207+
<div data-responsive-toggle='top-bar-menu'>
208208
<?php // hook for nav header above menu bar
209209
do_action( 'dt_nav_add_before', false ) ?>
210210

211-
<div class='title-bar hide-on-scroll'>
211+
<div class='title-bar'>
212212
<div class='title-bar-left'>
213213
<!-- menu -->
214214
<?php if ( !$dt_nav_tabs['admin']['menu']['hidden'] ?? !false ) : ?>
@@ -233,8 +233,8 @@
233233
<?php if ( isset( $dt_nav_tabs['admin']['add_new']['hidden'] ) && empty( $dt_nav_tabs['admin']['add_new']['hidden'] ) ) : ?>
234234
<div class="has-submenu center-items add-buttons mobile-add-buttons">
235235
<button type="button" data-toggle="mobile-add-new-dropdown">
236-
<img title="<?php echo esc_html( $dt_nav_tabs['admin']['add_new']['label'] ?? '' ); ?>"
237-
src="<?php echo esc_url( $dt_nav_tabs['admin']['add_new']['icon'] ?? get_template_directory_uri() . '/dt-assets/images/circle-add-green.svg' ); ?>"
236+
<img title="<?php echo esc_html( $dt_nav_tabs['admin']['add_new']['label'] ?? '' ); ?>"
237+
src="<?php echo esc_url( $dt_nav_tabs['admin']['add_new']['icon'] ?? get_template_directory_uri() . '/dt-assets/images/circle-add-green.svg' ); ?>"
238238
style="width:24px;">
239239
</button>
240240
<!-- /* MOBILE add menu */ -->

0 commit comments

Comments
 (0)