Skip to content

Commit

Permalink
Merge branch 'master' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
corsacca committed Dec 13, 2023
2 parents 480420a + 9869d8c commit 21e14b0
Show file tree
Hide file tree
Showing 92 changed files with 19,282 additions and 7,371 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
},
"rules": {
"no-console": "off",
"no-undef": 1,
"no-undef": "error",
"no-unused-vars": "off",
"no-empty": "off",
"no-useless-escape": "off",
Expand Down
19 changes: 10 additions & 9 deletions archive-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,22 +297,26 @@ class="second-bar show-for-small-only center list-actions-bar"><!-- /* MOBILE V
<ul class="dropdown menu" data-dropdown-menu>
<li>
<a href="#"><?php esc_html_e( 'Sort', 'disciple_tools' ); ?></a>
<ul class="menu is-dropdown-submenu">
<ul class="menu is-dropdown-submenu" style="min-width:220px">
<li>
<a href="#" class="js-sort-by" data-column-index="6" data-order="desc" data-field="post_date">
<?php esc_html_e( 'Newest', 'disciple_tools' ); ?></a>
<i class="mdi mdi-sort-calendar-descending"></i>
<?php esc_html_e( 'Newest', 'disciple_tools' ); ?></a>
</li>
<li>
<a href="#" class="js-sort-by" data-column-index="6" data-order="asc" data-field="post_date">
<?php esc_html_e( 'Oldest', 'disciple_tools' ); ?></a>
<i class="mdi mdi-sort-calendar-ascending"></i>
<?php esc_html_e( 'Oldest', 'disciple_tools' ); ?></a>
</li>
<li>
<a href="#" class="js-sort-by" data-column-index="6" data-order="desc" data-field="last_modified">
<?php esc_html_e( 'Most recently modified', 'disciple_tools' ); ?></a>
<i class="mdi mdi-sort-clock-descending-outline"></i>
<?php esc_html_e( 'Most recently modified', 'disciple_tools' ); ?></a>
</li>
<li>
<a href="#" class="js-sort-by" data-column-index="6" data-order="asc" data-field="last_modified">
<?php esc_html_e( 'Least recently modified', 'disciple_tools' ); ?></a>
<i class="mdi mdi-sort-clock-ascending-outline"></i>
<?php esc_html_e( 'Least recently modified', 'disciple_tools' ); ?></a>
</li>
</ul>
</li>
Expand Down Expand Up @@ -676,10 +680,7 @@ class="loading-spinner"></span>
}
foreach ( $columns as $field_key ):
if ( ! in_array( $field_key, [ 'favorite' ] ) ):
if ( $field_key === 'name' ): ?>
<th class="all"
data-id="name"><?php esc_html_e( 'Name', 'disciple_tools' ); ?></th>
<?php elseif ( isset( $post_settings['fields'][ $field_key ]['name'] ) ) : ?>
if ( isset( $post_settings['fields'][$field_key]['name'] ) ) : ?>
<th class="all" data-id="<?php echo esc_html( $field_key ) ?>">
<?php echo esc_html( $post_settings['fields'][ $field_key ]['name'] ) ?>
</th>
Expand Down
2 changes: 1 addition & 1 deletion dt-assets/build/css/style.min.css

Large diffs are not rendered by default.

27 changes: 22 additions & 5 deletions dt-assets/js/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ jQuery(document).ready(function($) {

/* breadcrumb: new-field-type Update record */
$('input.link-input').change(function(){
const fieldKey = $(this).data('field-key')
const type = $(this).data('type')
const meta_id = $(this).data('meta-id')
const value = $(this).val()
const link_input = $(this);
const fieldKey = $(link_input).data('field-key')
const type = $(link_input).data('type')
const meta_id = $(link_input).data('meta-id')
const value = $(link_input).val()

if ( $(this).prop('required') && value === ''){
if ( $(link_input).prop('required') && value === ''){
return;
}

Expand All @@ -94,6 +95,19 @@ jQuery(document).ready(function($) {
rest_api.update_post(post_type, post_id, { [fieldKey]: fieldValues }).then((newPost)=>{
$(`#${fieldKey}-spinner`).removeClass('active')
post = newPost

// Make sure a key exists for the new link field.
if ( post && post[fieldKey] && post[fieldKey].length > 0 ) {
let updated_values = post[fieldKey].filter((option) => {
return (option['type'] === type) && (option['value'] === value);
});

// This ensures any immediate updates, are assigned to correct link input and not to a new/duplicated input field.
if (updated_values && updated_values[0] && updated_values[0]['meta_id']) {
$(link_input).data('meta-id', updated_values[0]['meta_id']);
}
}

}).catch(window.handleAjaxError)
})

Expand Down Expand Up @@ -375,6 +389,9 @@ jQuery(document).ready(function($) {
if ( id ) {
update["key"] = id;
}
if ( !value && !id ){
return;
}
$(`#${field_key}-spinner`).addClass('active')
window.API.update_post(post_type, post_id, { [field_key]: [update]}).then((updatedContact)=>{
$(`#${field_key}-spinner`).removeClass('active')
Expand Down
8 changes: 6 additions & 2 deletions dt-assets/js/modular-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,9 @@
} else if (list_settings.post_type_settings.fields[field_key]) {
let field_settings = list_settings.post_type_settings.fields[field_key]
let field_value = window.lodash.get( record, field_key, false )

if ( field_key !== "favorite" && field_settings.type === "boolean" ) {
field_value = window.lodash.get( record, field_key )
}

/* breadcrumb: new-field-type Display field in table */
if ( field_value ) {
Expand Down Expand Up @@ -858,7 +860,9 @@
}
} else if ( !field_value && field_settings.type === "boolean" && field_key === "favorite") {
values = [`<svg class='icon-star' viewBox="0 0 32 32" data-id=${record.ID}><use xlink:href="${window.wpApiShare.template_dir}/dt-assets/images/star.svg#star"></use></svg>`]
}
} else if ( field_value === undefined && field_settings.type === "boolean" && field_settings.default === true) {
values = ['&check;']
}
} else {
return;
}
Expand Down
4 changes: 4 additions & 0 deletions dt-assets/scss/_details.scss
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ html[dir='rtl'] {
DT comments and activity
*********************/
#comment-activity-section{

scroll-margin-top:60px;
scroll-snap-margin-top: 60px;

.button.select-button:hover {
background-color: #3f729b;
}
Expand Down
50 changes: 41 additions & 9 deletions dt-assets/scss/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -177,35 +177,37 @@ NAVIGATION STYLES
display: none;
}

@media screen and (max-width : 1000px) {
.dropdown.menu>li:nth-child(n+3) {
@media screen and (max-width : 1040px) {
.dropdown.menu>li:nth-child(n+4) {
display: none;
}
.dropdown.menu>li:nth-child(n+3) {
.dropdown.menu>li:nth-child(n+4) {
display: none;
}
.dropdown.menu #more-menu-button {
display: inherit;
}
.dropdown.menu #more-menu-button > ul > li:nth-child(-n+2) {
.dropdown.menu #more-menu-button > ul > li:nth-child(-n+3) {
display: none;
}
}
@media screen and (min-width: 1001px) and (max-width : 1200px) {
.dropdown.menu>li:nth-child(n+5) {

@media screen and (min-width: 1041px) and (max-width : 1140px) {
.dropdown.menu>li:nth-child(n+6) {
display: none;
}
.dropdown.menu>li:nth-child(n+5) {
.dropdown.menu>li:nth-child(n+6) {
display: none;
}
.dropdown.menu #more-menu-button {
display: inherit;
}
.dropdown.menu #more-menu-button > ul > li:nth-child(-n+4) {
.dropdown.menu #more-menu-button > ul > li:nth-child(-n+5) {
display: none;
}
}
@media screen and (min-width: 1201px) and (max-width : 1400px) {

@media screen and (min-width: 1141px) and (max-width : 1240px) {
.dropdown.menu>li:nth-child(n+7) {
display: none;
}
Expand All @@ -220,6 +222,36 @@ NAVIGATION STYLES
}
}

@media screen and (min-width: 1241px) and (max-width : 1300px) {
.dropdown.menu>li:nth-child(n+8) {
display: none;
}
.dropdown.menu>li:nth-child(n+8) {
display: none;
}
.dropdown.menu #more-menu-button {
display: inherit;
}
.dropdown.menu #more-menu-button > ul > li:nth-child(-n+7) {
display: none;
}
}

@media screen and (min-width: 1301px) and (max-width : 1400px) {
.dropdown.menu>li:nth-child(n+9) {
display: none;
}
.dropdown.menu>li:nth-child(n+9) {
display: none;
}
.dropdown.menu #more-menu-button {
display: inherit;
}
.dropdown.menu #more-menu-button > ul > li:nth-child(-n+8) {
display: none;
}
}


@media screen and (min-width: 1401px) and (max-width : 1600px) {
.dropdown.menu>li:nth-child(n+9) {
Expand Down
21 changes: 20 additions & 1 deletion dt-assets/scss/_mapbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,28 @@
border-left: 1px lightgray solid;
padding: 0 10px 0 10px;
}
#add_records_div {
position: absolute;
top: 15%;
left: 10px;
z-index: 2;
}
.add-records-div {
background-color: #ffffff;
border-radius: 3px;
box-shadow: 0 1px 2px rgba(0,0,0,0.10);
font: 12px/20px 'Roboto', Arial, sans-serif;
padding: 10px;
opacity: .9;
width: 300px;
display:none;
}
.close-add-records-div {
cursor:pointer;
}
#geocode-details {
position: absolute;
top: 100px;
top: 15%;
right: 10px;
z-index: 2;
}
Expand Down
Loading

0 comments on commit 21e14b0

Please sign in to comment.