diff --git a/assets/css/frontend.css b/assets/css/frontend.css index eee119f..46add5b 100644 --- a/assets/css/frontend.css +++ b/assets/css/frontend.css @@ -100,6 +100,34 @@ opacity: 0.65; } +.odw-download-card__button--meta { + margin-left: auto; + font-weight: normal; + opacity: 0.75; + font-size: 0.85em; +} + +.odw-download-card__button--meta:hover { + opacity: 1; +} + +/* Keywords */ +.odw-download-card__keywords { + display: flex; + flex-wrap: wrap; + gap: 0.35rem; + margin-bottom: 1rem; +} + +.odw-download-card__keyword { + display: inline-block; + padding: 0.15em 0.6em; + border: 1px solid currentColor; + border-radius: 99px; + font-size: 0.8em; + opacity: 0.6; +} + /* ========================================================================= Responsive ========================================================================= */ diff --git a/composer.json b/composer.json index 1bf39ed..af84318 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "daimpad/open-data-wizard", - "description": "DCAT-AP 3.0 Open Data Plugin für WordPress — maschinenlesbarer Endpoint für Civora/Piveau-Harvesting", + "description": "DCAT-AP 3.0 Open Data Plugin für WordPress — maschinenlesbarer JSON-LD-Endpoint für offene Daten", "type": "wordpress-plugin", "license": "GPL-2.0-or-later", "require": { diff --git a/docs/I18N_IMPLEMENTATION.md b/docs/I18N_IMPLEMENTATION.md index 74a4953..1f1851a 100644 --- a/docs/I18N_IMPLEMENTATION.md +++ b/docs/I18N_IMPLEMENTATION.md @@ -170,7 +170,7 @@ xgettext \ **Dateiformat:** ``` # Open Data Wizard Translations -# Copyright (C) 2026 Datenatlas Zivilgesellschaft +# Copyright (C) 2026 nozilla # This file is distributed under the same license as the Open Data Wizard package. # msgid "" @@ -244,7 +244,7 @@ grep -c '^msgid ' languages/open-data-wizard.pot ```po # English translation for Open Data Wizard -# Copyright (C) 2026 Datenatlas Zivilgesellschaft +# Copyright (C) 2026 nozilla # This file is distributed under the same license as the Open Data Wizard package. # msgid "" diff --git a/includes/class-admin.php b/includes/class-admin.php index ed609cd..0977cac 100644 --- a/includes/class-admin.php +++ b/includes/class-admin.php @@ -520,7 +520,7 @@ private static function help_content_api(): string { ob_start(); ?> -
+' . esc_html__( 'Metadaten des Datenkatalogs — erscheinen in der REST-API-Antwort von /wp-json/datenatlas/v1/catalog.', 'open-data-wizard' ) . '
'; + echo '' . esc_html__( 'Metadaten des Datenkatalogs — erscheinen in der REST-API-Antwort des Catalog-Endpoints.', 'open-data-wizard' ) . '
'; }, 'odw-settings' ); diff --git a/includes/class-setup.php b/includes/class-setup.php index f7450a3..924a790 100644 --- a/includes/class-setup.php +++ b/includes/class-setup.php @@ -94,7 +94,7 @@ private static function create_demo_dataset(): int { 'open-data-wizard' ) ); - update_post_meta( $post_id, '_odw_publisher', __( 'Datenatlas Zivilgesellschaft e.V.', 'open-data-wizard' ) ); + update_post_meta( $post_id, '_odw_publisher', __( 'Musterorganisation e.V.', 'open-data-wizard' ) ); update_post_meta( $post_id, '_odw_license', 'https://creativecommons.org/publicdomain/zero/1.0/' ); update_post_meta( $post_id, '_odw_language', 'de' ); update_post_meta( $post_id, '_odw_keywords', "Zivilgesellschaft\nEngagement\nOrganisationen\nDemo" ); diff --git a/includes/class-shortcode.php b/includes/class-shortcode.php index cfc8467..a5614d3 100644 --- a/includes/class-shortcode.php +++ b/includes/class-shortcode.php @@ -72,13 +72,28 @@ public static function render( $atts ): string { wp_enqueue_style( 'odw-frontend' ); // --- Metadaten --- - $title = get_the_title( $post ); - $theme = (string) get_post_meta( $post_id, '_odw_theme', true ); - $license_uri = (string) get_post_meta( $post_id, '_odw_license', true ); - $license_label = ODW_Fields::get_license_label( $license_uri ); - $quality_level = (string) get_post_meta( $post_id, '_odw_quality_level', true ); - $quality_score = (int) get_post_meta( $post_id, '_odw_quality_score', true ); - $file_id = (int) get_post_meta( $post_id, '_odw_file_id', true ); + $title = get_the_title( $post ); + $theme = (string) get_post_meta( $post_id, '_odw_theme', true ); + $file_id = (int) get_post_meta( $post_id, '_odw_file_id', true ); + + // License from first distribution (per-distribution architecture). + $license_label = ''; + if ( function_exists( 'carbon_get_post_meta' ) ) { + $distributions = carbon_get_post_meta( $post_id, 'odw_distributions' ); + if ( is_array( $distributions ) && ! empty( $distributions ) ) { + $first_dist = $distributions[0]; + $license_uri = isset( $first_dist['license'] ) ? (string) $first_dist['license'] : ''; + if ( 'sonstige' === $license_uri && ! empty( $first_dist['license_custom'] ) ) { + $license_label = (string) $first_dist['license_custom']; + } elseif ( '' !== $license_uri ) { + $license_label = ODW_Fields::get_license_label( $license_uri ); + } + } + } + + // Keywords: newline-separated string → array of trimmed, non-empty values. + $keywords_raw = (string) get_post_meta( $post_id, '_odw_keywords', true ); + $keywords = array_filter( array_map( 'trim', explode( "\n", $keywords_raw ) ) ); // --- Datei-Informationen aus der Mediathek --- $file_url = ''; @@ -106,14 +121,7 @@ public static function render( $atts ): string { } } - // --- Qualitätslabel --- - $quality_label = ''; - if ( '' !== $quality_level ) { - $quality_label = ODW_Quality::get_level_label( $quality_level ); - if ( $quality_score > 0 ) { - $quality_label .= ' (' . $quality_score . '/100)'; - } - } + $metadata_url = rest_url( 'datenatlas/v1/datasets/' . $post_id ); // --- HTML aufbauen --- ob_start(); @@ -127,28 +135,25 @@ public static function render( $atts ): string { - + - + +