Plugin Directory

Changeset 3265071


Ignore:
Timestamp:
04/01/2025 12:01:03 PM (12 months ago)
Author:
stagent
Message:

Update to version 0.2.5 from GitHub

Location:
stagent
Files:
6 deleted
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • stagent/tags/0.2.5/README.md

    r3257256 r3265071  
    44Requires at least: 5.0
    55Tested up to: 6.7
    6 Stable tag: 0.2.4
     6Stable tag: 0.2.5
    77Requires PHP: 7.0
    88License: GNU General Public License v2 or later
     
    116116
    117117== Changelog ==
     118= v0.2.5 =
     119- **Fixed**: Clashing CSS with some themes.
     120-
    118121= v0.2.4 =
    119122- **Added**: Option to enable/disable 'Powered by Stagent'.
  • stagent/tags/0.2.5/assets/css/stagent.css

    r3257256 r3265071  
    1 /*! tailwindcss v4.0.14 | MIT License | https://tailwindcss.com */
    2 @layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height:calc(1.5/1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--font-weight-normal:400;--font-weight-medium:500;--default-font-family:var(--font-sans);--default-font-feature-settings:var(--font-sans--font-feature-settings);--default-font-variation-settings:var(--font-sans--font-variation-settings);--default-mono-font-family:var(--font-mono);--default-mono-font-feature-settings:var(--font-mono--font-feature-settings);--default-mono-font-variation-settings:var(--font-mono--font-variation-settings)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}body{line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1;color:color-mix(in oklab,currentColor 50%,transparent)}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.fixed{position:fixed}.static{position:static}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.block{display:block}.hidden{display:none}.inline{display:inline}.table-row{display:table-row}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}}.stagent-bookings-container{margin-block:calc(var(--spacing)*8);font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.stagent-bookings-container:where(.dark,.dark *){color:var(--color-white)}.stagent-bookings-list{margin:calc(var(--spacing)*0);padding:calc(var(--spacing)*0);list-style-type:none}:where(.stagent-bookings-list>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)));border-color:color-mix(in oklab,var(--color-black)10%,transparent)}:where(.stagent-bookings-list:where(.dark,.dark *)>:not(:last-child)){border-color:color-mix(in oklab,var(--color-white)30%,transparent)}.stagent-booking-list-item{padding-block:calc(var(--spacing)*4);flex-direction:column;justify-content:space-between;display:flex}:where(.stagent-booking-list-item>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}.stagent-booking-list-item:first-child{padding-top:calc(var(--spacing)*0)}@media (width>=40rem){.stagent-booking-list-item{flex-direction:row;align-items:center}}.stagent-booking-details{flex-direction:column;display:flex}.stagent-booking-date{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}@media (width>=40rem){.stagent-booking-date{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}}.stagent-booking-time{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.stagent-booking-artist,.stagent-booking-event{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media (width>=40rem){:is(.stagent-booking-artist,.stagent-booking-event){font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}}.stagent-booking-location{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.stagent-booking-meta{gap:calc(var(--spacing)*2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));display:flex}.stagent-booking-canceled{opacity:.5;text-decoration-line:line-through}.stagent-bookings-toggle{margin-bottom:calc(var(--spacing)*4);gap:calc(var(--spacing)*3);display:flex}.stagent-bookings-toggle .button.active{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.stagent-bookings-footer{justify-content:space-between;align-items:center;display:flex}.stagent-powered-by.button{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));opacity:.5}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-font-weight{syntax:"*";inherits:false}
     1/*! tailwindcss v4.0.17 | MIT License | https://tailwindcss.com */
     2@layer theme{:root,:host{--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height:calc(1.5/1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--font-weight-normal:400;--font-weight-medium:500}}.stagent-bookings-container{margin-block:calc(var(--spacing)*8);font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.stagent-bookings-container:where(.dark,.dark *){color:var(--color-white)}.stagent-bookings-list{margin:calc(var(--spacing)*0);padding:calc(var(--spacing)*0);list-style-type:none}:where(.stagent-bookings-list>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)));border-color:color-mix(in oklab,var(--color-black)10%,transparent)}:where(.stagent-bookings-list:where(.dark,.dark *)>:not(:last-child)){border-color:color-mix(in oklab,var(--color-white)30%,transparent)}.stagent-booking-list-item{padding-block:calc(var(--spacing)*4);flex-direction:column;justify-content:space-between;display:flex}:where(.stagent-booking-list-item>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}.stagent-booking-list-item:first-child{padding-top:calc(var(--spacing)*0)}@media (width>=40rem){.stagent-booking-list-item{flex-direction:row;align-items:center}}.stagent-booking-details{flex-direction:column;display:flex}.stagent-booking-date{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}@media (width>=40rem){.stagent-booking-date{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}}.stagent-booking-time{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.stagent-booking-artist,.stagent-booking-event{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media (width>=40rem){:is(.stagent-booking-artist,.stagent-booking-event){font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}}.stagent-booking-location{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.stagent-booking-meta{gap:calc(var(--spacing)*2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));display:flex}.stagent-booking-canceled{opacity:.5;text-decoration-line:line-through}.stagent-bookings-toggle{margin-bottom:calc(var(--spacing)*4);gap:calc(var(--spacing)*3);display:flex}.stagent-bookings-toggle .button.active{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.stagent-bookings-footer{justify-content:space-between;align-items:center;display:flex}.stagent-powered-by.button{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));opacity:.5}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-font-weight{syntax:"*";inherits:false}
  • stagent/tags/0.2.5/assets/js/stagent.js

    r3257256 r3265071  
    66    const loadMoreBtn = document.querySelector('.stagent-load-more');
    77
    8     if (!btnPastTab || !btnUpcomingTab || !upcomingList || !pastList || !loadMoreBtn) {
     8    if (!btnUpcomingTab || !upcomingList || !loadMoreBtn) {
    99        return;
    1010    }
     11
     12    const pastTabExists = !!btnPastTab && !!pastList;
    1113
    1214    let activeTab = 'upcoming';
     
    1618    function updateLoadMoreVisibility() {
    1719        if (activeTab === 'upcoming') {
    18             loadMoreBtn.classList.toggle('hidden', !hasMoreUpcoming);
    19             loadMoreBtn.classList.toggle('block', hasMoreUpcoming);
     20            loadMoreBtn.style.display = hasMoreUpcoming ? 'block' : 'none';
     21        } else if (pastTabExists) {
     22            loadMoreBtn.style.display = hasMorePast ? 'block' : 'none';
    2023        } else {
    21             loadMoreBtn.classList.toggle('hidden', !hasMorePast);
    22             loadMoreBtn.classList.toggle('block', hasMorePast);
     24            loadMoreBtn.style.display = 'none';
    2325        }
    2426    }
    2527
    26     btnPastTab.addEventListener('click', function(e) {
    27         e.preventDefault();
    28         activeTab = 'past';
    29         btnUpcomingTab.classList.remove('active');
    30         btnPastTab.classList.add('active');
    31         upcomingList.classList.add('hidden');
    32         pastList.classList.remove('hidden');
    33         updateLoadMoreVisibility();
    34     });
     28    if (pastTabExists) {
     29        btnPastTab.addEventListener('click', function(e) {
     30            e.preventDefault();
     31            activeTab = 'past';
     32            btnUpcomingTab.classList.remove('active');
     33            btnPastTab.classList.add('active');
     34            upcomingList.style.display = 'none';
     35            pastList.style.display = '';
     36            updateLoadMoreVisibility();
     37        });
     38    }
    3539
    3640    btnUpcomingTab.addEventListener('click', function(e) {
    3741        e.preventDefault();
    3842        activeTab = 'upcoming';
    39         btnPastTab.classList.remove('active');
     43        if (pastTabExists) btnPastTab.classList.remove('active');
    4044        btnUpcomingTab.classList.add('active');
    41         pastList.classList.add('hidden');
    42         upcomingList.classList.remove('hidden');
     45        if (pastTabExists) pastList.style.display = 'none';
     46        upcomingList.style.display = '';
    4347        updateLoadMoreVisibility();
    4448    });
     
    4751        e.preventDefault();
    4852
    49         let page = parseInt(loadMoreBtn.dataset.upcomingPage, 10);
     53        let page;
    5054        if (activeTab === 'past') {
    51             page = parseInt(loadMoreBtn.dataset.pastPage, 10);
     55            if (!pastTabExists) return;
     56            page = parseInt(loadMoreBtn.dataset.pastPage || '1', 10);
     57        } else {
     58            page = parseInt(loadMoreBtn.dataset.upcomingPage || '1', 10);
    5259        }
     60
     61        const nextPage = page + 1;
    5362
    5463        const team = loadMoreBtn.dataset.team;
     
    6372        formData.append('per_page', perPage);
    6473        formData.append('show', activeTab);
    65         formData.append('page', page + 1);
     74        formData.append('page', nextPage);
    6675
    6776        fetch(stagentData.ajaxUrl, {
     
    7786
    7887                const newItemsHtml = data.data.html || '';
    79                 const itemCount = data.data.count || 0;
    8088                const hasMore = data.data.has_more || false;
    8189
    8290                if (activeTab === 'upcoming') {
    8391                    upcomingList.insertAdjacentHTML('beforeend', newItemsHtml);
    84                     loadMoreBtn.dataset.upcomingPage = page + 1;
     92                    loadMoreBtn.dataset.upcomingPage = nextPage;
    8593                    hasMoreUpcoming = hasMore;
    86                 } else {
     94                } else if (pastTabExists) {
    8795                    pastList.insertAdjacentHTML('beforeend', newItemsHtml);
    88                     loadMoreBtn.dataset.pastPage = page + 1;
     96                    loadMoreBtn.dataset.pastPage = nextPage;
    8997                    hasMorePast = hasMore;
    9098                }
     
    99107
    100108    updateLoadMoreVisibility();
     109
     110    upcomingList.style.display = '';
     111    if (pastTabExists) {
     112        pastList.style.display = 'none';
     113    }
     114
     115    const styleBlocks = document.querySelectorAll('style');
     116    styleBlocks.forEach(block => {
     117        if (block.textContent.includes('.stagent-bookings-past')) {
     118            block.remove();
     119        }
     120    });
    101121});
  • stagent/tags/0.2.5/includes/class-stagent-shortcodes.php

    r3257256 r3265071  
    113113            'show_past'   => $show_past,
    114114            'per_page'    => $per_page,
     115            'canceled'    => $canceled,
    115116        ], true);
    116117    }
  • stagent/tags/0.2.5/stagent.php

    r3257256 r3265071  
    44 * Plugin URI: https://stagent.com
    55 * Description: Displays bookings from Stagent API in WordPress.
    6  * Version: 0.2.4
     6 * Version: 0.2.5
    77 * Author: StagentArtwin B.V.
    88 * License: GNU General Public License v2 or later
     
    1818
    1919// Define constants
    20 define('STAGENT_VERSION', '0.2.4');
     20define('STAGENT_VERSION', '0.2.5');
    2121define('STAGENT_API_URL', 'https://stagent.com/api/v2');
    2222define('STAGENT_DEVELOPMENT_MODE', false);
  • stagent/tags/0.2.5/templates/stagent-bookings-container.php

    r3257256 r3265071  
    3434    <?php endif; ?>
    3535
     36    <?php if ($show === 'all') : ?>
     37        <style>
     38            .stagent-bookings-past {
     39                display: none !important;
     40            }
     41        </style>
     42    <?php endif; ?>
     43
    3644    <?php if ($show !== 'past') : ?>
    3745        <?php
     
    6371               data-upcoming-page="1"
    6472               data-past-page="1"
    65                data-team="<?php echo esc_attr($team); ?>"
    66                data-artists="<?php echo esc_attr(implode(',', $artists)); ?>"
    67                data-per-page="<?php echo esc_attr($per_page); ?>">
     73                data-team="<?php echo esc_attr($team); ?>"
     74                data-artists="<?php echo esc_attr(implode(',', $artists)); ?>"
     75                data-per-page="<?php echo esc_attr($per_page); ?>">
    6876                <?php esc_html_e('Load more', 'stagent'); ?>
    6977            </a>
  • stagent/tags/0.2.5/templates/stagent-bookings-list.php

    r3257256 r3265071  
    1414
    1515// Sanitize and validate variables passed from stagent-booking-container.php
    16 $list_class = sanitize_html_class($list_class ?? '');
     16$classes = sanitize_html_class($list_class ?? '');
    1717$visible = (bool) ($visible ?? false);
    1818$data = is_array($data ?? []) ? $data : [];
    1919$hide_artist = (bool) ($hide_artist ?? false);
    2020
    21 $classes = $list_class . ($visible ? '' : ' hidden');
     21$style = $visible ? 'display: block;' : 'display: none;';
    2222?>
    2323
    24 <ul class="stagent-bookings-list <?php echo esc_attr($classes); ?>">
     24<ul class="stagent-bookings-list <?php echo esc_attr($classes); ?>" style="<?php echo esc_attr($style); ?>">
    2525    <?php if (empty($data)) : ?>
    2626        <li><?php esc_html_e('No bookings found.', 'stagent'); ?></li>
  • stagent/trunk/README.md

    r3257256 r3265071  
    44Requires at least: 5.0
    55Tested up to: 6.7
    6 Stable tag: 0.2.4
     6Stable tag: 0.2.5
    77Requires PHP: 7.0
    88License: GNU General Public License v2 or later
     
    116116
    117117== Changelog ==
     118= v0.2.5 =
     119- **Fixed**: Clashing CSS with some themes.
     120-
    118121= v0.2.4 =
    119122- **Added**: Option to enable/disable 'Powered by Stagent'.
  • stagent/trunk/assets/css/stagent.css

    r3257256 r3265071  
    1 /*! tailwindcss v4.0.14 | MIT License | https://tailwindcss.com */
    2 @layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height:calc(1.5/1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--font-weight-normal:400;--font-weight-medium:500;--default-font-family:var(--font-sans);--default-font-feature-settings:var(--font-sans--font-feature-settings);--default-font-variation-settings:var(--font-sans--font-variation-settings);--default-mono-font-family:var(--font-mono);--default-mono-font-feature-settings:var(--font-mono--font-feature-settings);--default-mono-font-variation-settings:var(--font-mono--font-variation-settings)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}body{line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1;color:color-mix(in oklab,currentColor 50%,transparent)}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.fixed{position:fixed}.static{position:static}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.block{display:block}.hidden{display:none}.inline{display:inline}.table-row{display:table-row}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}}.stagent-bookings-container{margin-block:calc(var(--spacing)*8);font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.stagent-bookings-container:where(.dark,.dark *){color:var(--color-white)}.stagent-bookings-list{margin:calc(var(--spacing)*0);padding:calc(var(--spacing)*0);list-style-type:none}:where(.stagent-bookings-list>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)));border-color:color-mix(in oklab,var(--color-black)10%,transparent)}:where(.stagent-bookings-list:where(.dark,.dark *)>:not(:last-child)){border-color:color-mix(in oklab,var(--color-white)30%,transparent)}.stagent-booking-list-item{padding-block:calc(var(--spacing)*4);flex-direction:column;justify-content:space-between;display:flex}:where(.stagent-booking-list-item>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}.stagent-booking-list-item:first-child{padding-top:calc(var(--spacing)*0)}@media (width>=40rem){.stagent-booking-list-item{flex-direction:row;align-items:center}}.stagent-booking-details{flex-direction:column;display:flex}.stagent-booking-date{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}@media (width>=40rem){.stagent-booking-date{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}}.stagent-booking-time{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.stagent-booking-artist,.stagent-booking-event{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media (width>=40rem){:is(.stagent-booking-artist,.stagent-booking-event){font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}}.stagent-booking-location{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.stagent-booking-meta{gap:calc(var(--spacing)*2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));display:flex}.stagent-booking-canceled{opacity:.5;text-decoration-line:line-through}.stagent-bookings-toggle{margin-bottom:calc(var(--spacing)*4);gap:calc(var(--spacing)*3);display:flex}.stagent-bookings-toggle .button.active{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.stagent-bookings-footer{justify-content:space-between;align-items:center;display:flex}.stagent-powered-by.button{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));opacity:.5}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-font-weight{syntax:"*";inherits:false}
     1/*! tailwindcss v4.0.17 | MIT License | https://tailwindcss.com */
     2@layer theme{:root,:host{--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height:calc(1.5/1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--font-weight-normal:400;--font-weight-medium:500}}.stagent-bookings-container{margin-block:calc(var(--spacing)*8);font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.stagent-bookings-container:where(.dark,.dark *){color:var(--color-white)}.stagent-bookings-list{margin:calc(var(--spacing)*0);padding:calc(var(--spacing)*0);list-style-type:none}:where(.stagent-bookings-list>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)));border-color:color-mix(in oklab,var(--color-black)10%,transparent)}:where(.stagent-bookings-list:where(.dark,.dark *)>:not(:last-child)){border-color:color-mix(in oklab,var(--color-white)30%,transparent)}.stagent-booking-list-item{padding-block:calc(var(--spacing)*4);flex-direction:column;justify-content:space-between;display:flex}:where(.stagent-booking-list-item>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}.stagent-booking-list-item:first-child{padding-top:calc(var(--spacing)*0)}@media (width>=40rem){.stagent-booking-list-item{flex-direction:row;align-items:center}}.stagent-booking-details{flex-direction:column;display:flex}.stagent-booking-date{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}@media (width>=40rem){.stagent-booking-date{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}}.stagent-booking-time{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.stagent-booking-artist,.stagent-booking-event{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media (width>=40rem){:is(.stagent-booking-artist,.stagent-booking-event){font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}}.stagent-booking-location{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.stagent-booking-meta{gap:calc(var(--spacing)*2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));display:flex}.stagent-booking-canceled{opacity:.5;text-decoration-line:line-through}.stagent-bookings-toggle{margin-bottom:calc(var(--spacing)*4);gap:calc(var(--spacing)*3);display:flex}.stagent-bookings-toggle .button.active{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.stagent-bookings-footer{justify-content:space-between;align-items:center;display:flex}.stagent-powered-by.button{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));opacity:.5}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-font-weight{syntax:"*";inherits:false}
  • stagent/trunk/assets/js/stagent.js

    r3257256 r3265071  
    66    const loadMoreBtn = document.querySelector('.stagent-load-more');
    77
    8     if (!btnPastTab || !btnUpcomingTab || !upcomingList || !pastList || !loadMoreBtn) {
     8    if (!btnUpcomingTab || !upcomingList || !loadMoreBtn) {
    99        return;
    1010    }
     11
     12    const pastTabExists = !!btnPastTab && !!pastList;
    1113
    1214    let activeTab = 'upcoming';
     
    1618    function updateLoadMoreVisibility() {
    1719        if (activeTab === 'upcoming') {
    18             loadMoreBtn.classList.toggle('hidden', !hasMoreUpcoming);
    19             loadMoreBtn.classList.toggle('block', hasMoreUpcoming);
     20            loadMoreBtn.style.display = hasMoreUpcoming ? 'block' : 'none';
     21        } else if (pastTabExists) {
     22            loadMoreBtn.style.display = hasMorePast ? 'block' : 'none';
    2023        } else {
    21             loadMoreBtn.classList.toggle('hidden', !hasMorePast);
    22             loadMoreBtn.classList.toggle('block', hasMorePast);
     24            loadMoreBtn.style.display = 'none';
    2325        }
    2426    }
    2527
    26     btnPastTab.addEventListener('click', function(e) {
    27         e.preventDefault();
    28         activeTab = 'past';
    29         btnUpcomingTab.classList.remove('active');
    30         btnPastTab.classList.add('active');
    31         upcomingList.classList.add('hidden');
    32         pastList.classList.remove('hidden');
    33         updateLoadMoreVisibility();
    34     });
     28    if (pastTabExists) {
     29        btnPastTab.addEventListener('click', function(e) {
     30            e.preventDefault();
     31            activeTab = 'past';
     32            btnUpcomingTab.classList.remove('active');
     33            btnPastTab.classList.add('active');
     34            upcomingList.style.display = 'none';
     35            pastList.style.display = '';
     36            updateLoadMoreVisibility();
     37        });
     38    }
    3539
    3640    btnUpcomingTab.addEventListener('click', function(e) {
    3741        e.preventDefault();
    3842        activeTab = 'upcoming';
    39         btnPastTab.classList.remove('active');
     43        if (pastTabExists) btnPastTab.classList.remove('active');
    4044        btnUpcomingTab.classList.add('active');
    41         pastList.classList.add('hidden');
    42         upcomingList.classList.remove('hidden');
     45        if (pastTabExists) pastList.style.display = 'none';
     46        upcomingList.style.display = '';
    4347        updateLoadMoreVisibility();
    4448    });
     
    4751        e.preventDefault();
    4852
    49         let page = parseInt(loadMoreBtn.dataset.upcomingPage, 10);
     53        let page;
    5054        if (activeTab === 'past') {
    51             page = parseInt(loadMoreBtn.dataset.pastPage, 10);
     55            if (!pastTabExists) return;
     56            page = parseInt(loadMoreBtn.dataset.pastPage || '1', 10);
     57        } else {
     58            page = parseInt(loadMoreBtn.dataset.upcomingPage || '1', 10);
    5259        }
     60
     61        const nextPage = page + 1;
    5362
    5463        const team = loadMoreBtn.dataset.team;
     
    6372        formData.append('per_page', perPage);
    6473        formData.append('show', activeTab);
    65         formData.append('page', page + 1);
     74        formData.append('page', nextPage);
    6675
    6776        fetch(stagentData.ajaxUrl, {
     
    7786
    7887                const newItemsHtml = data.data.html || '';
    79                 const itemCount = data.data.count || 0;
    8088                const hasMore = data.data.has_more || false;
    8189
    8290                if (activeTab === 'upcoming') {
    8391                    upcomingList.insertAdjacentHTML('beforeend', newItemsHtml);
    84                     loadMoreBtn.dataset.upcomingPage = page + 1;
     92                    loadMoreBtn.dataset.upcomingPage = nextPage;
    8593                    hasMoreUpcoming = hasMore;
    86                 } else {
     94                } else if (pastTabExists) {
    8795                    pastList.insertAdjacentHTML('beforeend', newItemsHtml);
    88                     loadMoreBtn.dataset.pastPage = page + 1;
     96                    loadMoreBtn.dataset.pastPage = nextPage;
    8997                    hasMorePast = hasMore;
    9098                }
     
    99107
    100108    updateLoadMoreVisibility();
     109
     110    upcomingList.style.display = '';
     111    if (pastTabExists) {
     112        pastList.style.display = 'none';
     113    }
     114
     115    const styleBlocks = document.querySelectorAll('style');
     116    styleBlocks.forEach(block => {
     117        if (block.textContent.includes('.stagent-bookings-past')) {
     118            block.remove();
     119        }
     120    });
    101121});
  • stagent/trunk/includes/class-stagent-shortcodes.php

    r3257256 r3265071  
    113113            'show_past'   => $show_past,
    114114            'per_page'    => $per_page,
     115            'canceled'    => $canceled,
    115116        ], true);
    116117    }
  • stagent/trunk/stagent.php

    r3257256 r3265071  
    44 * Plugin URI: https://stagent.com
    55 * Description: Displays bookings from Stagent API in WordPress.
    6  * Version: 0.2.4
     6 * Version: 0.2.5
    77 * Author: StagentArtwin B.V.
    88 * License: GNU General Public License v2 or later
     
    1818
    1919// Define constants
    20 define('STAGENT_VERSION', '0.2.4');
     20define('STAGENT_VERSION', '0.2.5');
    2121define('STAGENT_API_URL', 'https://stagent.com/api/v2');
    2222define('STAGENT_DEVELOPMENT_MODE', false);
  • stagent/trunk/templates/stagent-bookings-container.php

    r3257256 r3265071  
    3434    <?php endif; ?>
    3535
     36    <?php if ($show === 'all') : ?>
     37        <style>
     38            .stagent-bookings-past {
     39                display: none !important;
     40            }
     41        </style>
     42    <?php endif; ?>
     43
    3644    <?php if ($show !== 'past') : ?>
    3745        <?php
     
    6371               data-upcoming-page="1"
    6472               data-past-page="1"
    65                data-team="<?php echo esc_attr($team); ?>"
    66                data-artists="<?php echo esc_attr(implode(',', $artists)); ?>"
    67                data-per-page="<?php echo esc_attr($per_page); ?>">
     73                data-team="<?php echo esc_attr($team); ?>"
     74                data-artists="<?php echo esc_attr(implode(',', $artists)); ?>"
     75                data-per-page="<?php echo esc_attr($per_page); ?>">
    6876                <?php esc_html_e('Load more', 'stagent'); ?>
    6977            </a>
  • stagent/trunk/templates/stagent-bookings-list.php

    r3257256 r3265071  
    1414
    1515// Sanitize and validate variables passed from stagent-booking-container.php
    16 $list_class = sanitize_html_class($list_class ?? '');
     16$classes = sanitize_html_class($list_class ?? '');
    1717$visible = (bool) ($visible ?? false);
    1818$data = is_array($data ?? []) ? $data : [];
    1919$hide_artist = (bool) ($hide_artist ?? false);
    2020
    21 $classes = $list_class . ($visible ? '' : ' hidden');
     21$style = $visible ? 'display: block;' : 'display: none;';
    2222?>
    2323
    24 <ul class="stagent-bookings-list <?php echo esc_attr($classes); ?>">
     24<ul class="stagent-bookings-list <?php echo esc_attr($classes); ?>" style="<?php echo esc_attr($style); ?>">
    2525    <?php if (empty($data)) : ?>
    2626        <li><?php esc_html_e('No bookings found.', 'stagent'); ?></li>
Note: See TracChangeset for help on using the changeset viewer.