diff --git a/.forgejo/workflows/phpunit.yml b/.forgejo/workflows/phpunit.yml index b695aff..5f300c7 100644 --- a/.forgejo/workflows/phpunit.yml +++ b/.forgejo/workflows/phpunit.yml @@ -75,6 +75,11 @@ jobs: if: steps.cache-wordpress.outputs.cache-hit != 'false' run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1 ${{ matrix.wordpress-version }} false true true true + - name: Run General Tests + run: cd /workspace/Event-Federation/wordpress-event-bridge-for-activitypub/ && ./vendor/bin/phpunit --filter=event_bridge_for_activitypub + env: + PHP_VERSION: ${{ matrix.php-version }} + - name: Run Integration tests for The Events Calendar run: cd /workspace/Event-Federation/wordpress-event-bridge-for-activitypub/ && ./vendor/bin/phpunit --filter=the_events_calendar env: diff --git a/CHANGELOG.md b/CHANGELOG.md index dd83e8e..870d722 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Added + +* Add custom summary via shortcodes + ## [0.3.1] - 2024-11-16 * Initial release on WordPress.org diff --git a/README.md b/README.md index e52e4a8..f61876b 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,12 @@ We're always interested in your feedback. Feel free to reach out to us via [E-Ma ## Changelog ## +### Unreleased + +#### Added + +* Add custom summary via shortcodes + ### [0.3.1] 2024-12-05 ### * Initial release on https://wordpress.org/ diff --git a/assets/css/event-bridge-for-activitypub-admin.css b/assets/css/event-bridge-for-activitypub-admin.css index 27e164a..6c62d22 100644 --- a/assets/css/event-bridge-for-activitypub-admin.css +++ b/assets/css/event-bridge-for-activitypub-admin.css @@ -177,3 +177,11 @@ code.event-bridge-for-activitypub-settings-example-url { overflow-x: auto; word-break: break-all; } + +#event_bridge_for_activitypub_summary_type_custom-details { + display: none; +} + +#event_bridge_for_activitypub_summary_type_custom-details > details { + padding: 0.5em; +} diff --git a/assets/js/event-bridge-for-activitypub-admin.js b/assets/js/event-bridge-for-activitypub-admin.js index d2eb9ea..93c64e3 100644 --- a/assets/js/event-bridge-for-activitypub-admin.js +++ b/assets/js/event-bridge-for-activitypub-admin.js @@ -11,4 +11,24 @@ jQuery( function( $ ) { $( '#' + $( this ).attr( 'aria-controls' ) ).attr( 'hidden', false ); } } ); + + // Function to toggle visibility of custom details based on selected radio button. + function toggleCustomDetailsForSummary() { + if ($("#event_bridge_for_activitypub_summary_type_custom").is(':checked')) { + $("#event_bridge_for_activitypub_summary_type_custom-details").show(); + } else { + $("#event_bridge_for_activitypub_summary_type_custom-details").hide(); + } + } + + // Run the toggle function on page load. + $(document).ready(function() { + window.console.log("test"); + toggleCustomDetailsForSummary(); // Set the correct state on load. + + // Listen for changes on the radio buttons + $("input[name=event_bridge_for_activitypub_summary_type]").change(function() { + toggleCustomDetailsForSummary(); // Update visibility on change. + }); + }); } ); diff --git a/composer.json b/composer.json index 0431a7b..01cb90e 100644 --- a/composer.json +++ b/composer.json @@ -60,7 +60,7 @@ ], "test-debug": [ "@prepare-test", - "@test-event-organiser" + "@test-event-bridge-for-activitypub-shortcodes" ], "test-vs-event-list": "phpunit --filter=vs_event_list", "test-the-events-calendar": "phpunit --filter=the_events_calendar", @@ -71,6 +71,7 @@ "test-modern-events-calendar-lite": "phpunit --filter=modern_events_calendar_lite", "test-eventprime": "phpunit --filter=eventprime", "test-event-organiser": "phpunit --filter=event_organiser", + "test-event-bridge-for-activitypub-shortcodes": "phpunit --filter=event_bridge_for_activitypub_shortcodes", "test-all": "phpunit" } } diff --git a/event-bridge-for-activitypub.php b/event-bridge-for-activitypub.php index 4b1b01e..4bb34cf 100644 --- a/event-bridge-for-activitypub.php +++ b/event-bridge-for-activitypub.php @@ -3,7 +3,7 @@ * Plugin Name: Event Bridge for ActivityPub * Description: Integrating popular event plugins with the ActivityPub plugin. * Plugin URI: https://event-federation.eu/ - * Version: 0.3.1 + * Version: 0.3.1.1 * Author: AndrΓ© Menrath * Author URI: https://graz.social/@linos * Text Domain: event-bridge-for-activitypub @@ -27,6 +27,8 @@ define( 'EVENT_BRIDGE_FOR_ACTIVITYPUB_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); define( 'EVENT_BRIDGE_FOR_ACTIVITYPUB_PLUGIN_VERSION', current( get_file_data( __FILE__, array( 'Version' ), 'plugin' ) ) ); define( 'EVENT_BRIDGE_FOR_ACTIVITYPUB_DOMAIN', 'event-bridge-for-activitypub' ); define( 'EVENT_BRIDGE_FOR_ACTIVITYPUB_ACTIVITYPUB_PLUGIN_MIN_VERSION', '3.2.2' ); +define( 'EVENT_BRIDGE_FOR_ACTIVITYPUB_CUSTOM_SUMMARY', "