=== CM Event Overview ===
Contributors: conferencemanager
Tags: events, conference, calendar, listing, conference manager
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Display Conference Manager event listings on your WordPress site with a Gutenberg block or shortcode.

== Description ==

CM Event Overview connects to your Conference Manager account via the REST API and displays your events on your WordPress website. Visitors can browse events and click through to sign up on your Conference Manager event page.

**Features:**

* Gutenberg block ("CM Event Overview") and `[cm_event_overview]` shortcode (also works in widgets)
* Tabbed settings screen with a live preview
* Choose list or grid as the default layout
* Show/hide any field (image, dates, time zone, location, capacity, deadline, description) and any toolbar control
* No-code colour pickers for every part of the list — set globally or per block
* Layout controls: corner radius, padding, spacing, maximum width, card shadow
* Status badges (Sold Out, Waitlist, Few spots left, Archived/Past) with configurable thresholds and custom labels
* Search (name, location, dates, status, description), sorting, and pagination
* Responsive card grid layout
* CSS custom properties and prefixed classes for advanced theming
* Caching to minimize API calls
* Translations: English, Danish, Swedish, German (admin and front end)

== Installation ==

1. Upload the `cm-event-overview` folder to `/wp-content/plugins/`
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to Settings > CM Event Overview
4. Enter your company subdomain and API credentials (username + password). If you need a Conference Manager account or API credentials, contact Conference Manager at https://conference-manager.eu/about-us/contact.php
5. Click "Test Connection" to verify
6. Add the "CM Event Overview" block to any page, or use `[cm_event_overview]`

== Configuration ==

All settings live under **Settings > CM Event Overview**, organised into tabs:

= Connection =
* **Company Subdomain** — Your subdomain from `https://{subdomain}.cmapi.io`
* **API Username / Password** — Provided by Conference Manager support. Exchanged for a short-lived bearer token at runtime; the password is stored encrypted.
* **Test Connection** and **Clear Cache** tools.

= Display =
Default layout (list or grid), events per page, which card fields show, and which toolbar controls appear. These can be overridden per block.

= Status Badges =
When the "Few spots left" badge appears (capacity percentage, seat cap, and deadline window) and custom text for each badge.

= Colours =
A colour picker for every element — accent, text, card and section backgrounds, the date badge, all status-badge colours, toolbar/pagination, and the placeholder palette. Leave a colour blank to keep the theme default. Set globally or per block; a live preview shows changes instantly.

= Layout =
Corner radius, card padding, spacing between cards, maximum width, and card shadow.

= Developer =
An in-admin reference of the targetable CSS classes and CSS variables (also listed below).

== Styling reference ==

Most branding is done from the Colours and Layout tabs with no code. For finer control, override these CSS custom properties (scope them to `.cm-event-overview-wrapper`):

    .cm-event-overview-wrapper {
        --cm-event-overview-primary: #0073aa;            /* accent: active page button, focus outline */
        --cm-event-overview-bg: #ffffff;                 /* card background */
        --cm-event-overview-text: #333333;               /* main text */
        --cm-event-overview-text-muted: #666666;         /* secondary / description text */
        --cm-event-overview-border: transparent;         /* card border */
        --cm-event-overview-border-radius: 4px;          /* corner rounding */
        --cm-event-overview-shadow: 0 1px 3px rgba(0,0,0,0.2);
        --cm-event-overview-shadow-hover: 0 4px 10px rgba(0,0,0,0.2);
        --cm-event-overview-thumb-color: #ffffff;        /* date-badge text */
        --cm-event-overview-thumb-backdrop: rgba(0,0,0,0.45);
        --cm-event-overview-thumb-1: #991f47;            /* fallback palette, cycles per card */
        --cm-event-overview-thumb-2: #e6955c;
        --cm-event-overview-thumb-3: #8f47b3;
        --cm-event-overview-thumb-4: #9ccc3d;
        --cm-event-overview-thumb-5: #3d6b99;
        --cm-event-overview-thumb-6: #47b3b3;
        --cm-event-overview-ribbon-sold-out-bg: yellow;
        --cm-event-overview-ribbon-sold-out-text: #333333;
        --cm-event-overview-ribbon-waitlist-bg: orange;
        --cm-event-overview-ribbon-waitlist-text: #ffffff;
        --cm-event-overview-ribbon-few-spots-bg: #52cc66;
        --cm-event-overview-ribbon-few-spots-text: #ffffff;
        --cm-event-overview-ribbon-archived-bg: #6c757d; /* also the "Past" badge */
        --cm-event-overview-ribbon-archived-text: #ffffff;
        --cm-event-overview-toolbar-bg: transparent;
        --cm-event-overview-toolbar-border: #dbdbdb;
        --cm-event-overview-toolbar-btn-bg: #ffffff;
        --cm-event-overview-toolbar-btn-hover: #f5f5f5;
        --cm-event-overview-pagination-btn-bg: #ffffff;
        --cm-event-overview-pagination-btn-border: #dbdbdb;
        --cm-event-overview-pagination-btn-disabled: #cccccc;
        --cm-event-overview-section-bg: #ffffff;
        --cm-event-overview-gap: 12px;                   /* gap between cards */
        --cm-event-overview-card-padding: 15px;
        --cm-event-overview-font-family: inherit;
        --cm-event-overview-max-width: 1140px;
    }

Targetable CSS classes:

* `.cm-event-overview-wrapper` — outer container (section header is `.cm-event-overview-wrapper h2`)
* `.cm-event-overview-toolbar` — toolbar row; with `.cm-event-overview-search-group`, `.cm-event-overview-search-input`, `.cm-event-overview-search-clear`, `.cm-event-overview-search-btn`
* `.cm-event-overview-dropdown` (`.open`), `.cm-event-overview-dropdown-toggle`, `.cm-event-overview-dropdown-menu`, `.cm-event-overview-dropdown-item` (`.active`)
* `.cm-event-overview-view-toggles`, `.cm-event-overview-view-btn` (`.active`)
* `.cm-event-overview-list` with `.cm-event-overview-view-list` / `.cm-event-overview-view-grid`
* `.cm-event-overview-card` (an `a` when clickable); `.cm-event-overview-card__thumb` (`--has-image`, `--fallback`), `.cm-event-overview-card__date-badge`, `.cm-event-overview-card__date-day`, `.cm-event-overview-card__date-month`
* `.cm-event-overview-card__body` (with `h3`, `p`), `.cm-event-overview-card__detail-row`, `.cm-event-overview-icon`
* `.cm-event-overview-ribbon` with `--sold-out`, `--waitlist`, `--few-spots`, `--archived`
* `.cm-event-overview-pagination`, `.cm-event-overview-pagination__prev`, `.cm-event-overview-pagination__next`, `.cm-event-overview-pagination .pagination-item` (`.active`)
* `.cm-event-overview-no-results`, `.cm-event-overview-empty`, `.cm-event-overview-error`


== Frequently Asked Questions ==

= Do I need a Conference Manager account? =

Yes. The plugin connects to the Conference Manager REST API to fetch your events. You need a company subdomain and API credentials (username + password). Contact Conference Manager at https://conference-manager.eu/about-us/contact.php to get started.

= Does the plugin work without JavaScript? =

The initial event list is rendered server-side, so events are visible without JavaScript. Search, sort, pagination, and view-toggle features require JavaScript.

= Can I style the event cards? =

For most branding you don't need code — the Colours and Layout tabs (Settings > CM Event Overview) recolour and resize everything, globally or per block, with a live preview. For finer control the plugin also exposes CSS custom properties and prefixed CSS classes; see the Styling reference above and the Developer tab in the settings.

== Shortcode ==

`[cm_event_overview limit="10" view="grid" show_past="0" show_name="1" show_start="1" show_end="1" show_timezone="0" show_location="1" show_capacity="0" show_used="0" show_deadline="1" show_badges="1"]`

All attributes are optional and override the global defaults. Per-instance colours can also be passed (e.g. `color_primary="#0073aa"`); see the Help tab in the settings for the full list.

== Changelog ==

= 1.0.0 =
* Initial release
* Gutenberg block, shortcode, and widget support
* Tabbed settings screen with a live preview
* List/grid default, per-field and toolbar visibility toggles
* No-code colour pickers and layout controls (global and per block)
* Status badges with configurable thresholds and custom labels
* Search, sort, and pagination
* JWT bearer authentication (username/password exchanged for a short-lived token; password encrypted at rest)
* Translations (EN, DA, SV, DE) for admin and front end
* CSS custom properties and prefixed classes for advanced theming

== Upgrade Notice ==

= 1.0.0 =
Initial release.

== Privacy ==

This plugin connects to the Conference Manager REST API after a site administrator configures a company subdomain and API credentials.

When the plugin is used, WordPress sends the following data to Conference Manager:

* The configured company subdomain (used to build the API host name)
* The configured API username and password when exchanging them for a short-lived bearer token at the `/v1/auth` endpoint
* Event listing requests needed to render the event list on your site
* An identifying request header, `X-CM-Client: cm-event-overview/<plugin-version>`, so Conference Manager infrastructure can identify requests coming from the WordPress integration

The API password is stored encrypted in the WordPress database using libsodium with a key derived from your site's `AUTH_KEY` / `AUTH_SALT` constants. The bearer token returned by Conference Manager is cached in a WordPress transient until shortly before it expires.

The plugin may also load event images from URLs returned by Conference Manager and send visitors to Conference Manager-hosted event signup pages when they click an event.

The plugin does not include third-party analytics, advertising pixels, or tracking cookies.

Conference Manager Privacy Policy:
https://conferencemanager.co.uk/privacy-policy.php

== Support ==

For account setup, API access, or product support, contact Conference Manager:
https://conference-manager.eu/about-us/contact.php

== Contributing ==

See [CONTRIBUTING.md](https://github.com/Conference-Manager/cm-event-overview/blob/main/CONTRIBUTING.md) for development setup, coding standards, and how to submit changes.


