Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,41 @@ Versionierung folgt [Semantic Versioning](https://semver.org/).

---

## [1.7.0] — 2026-04-21

### Hinzugefügt
- **Tab 4 — Erweiterte Angaben** im Datensatz-Formular mit 8 neuen DCAT-AP 3.0 Feldern:
- `dcat:landingPage` — URL der Projektwebsite
- `dct:accrualPeriodicity` — Aktualisierungsfrequenz (EU Publications Office Vokabular: täglich bis zweijährlich)
- `dct:spatial` — Geographische Abdeckung (Freitext oder URI, z.B. GeoNames)
- `dct:temporal` — Zeitlicher Bezug mit Start- und Enddatum (`dcat:startDate`, `dcat:endDate`)
- `dcat:contactPoint` — Kontaktpunkt mit Name, E-Mail (`mailto:`-Prefix) und Website (`vcard:Organization`)
- **`vcard` und `skos` Namespaces** im JSON-LD `@context` der REST API
- **`ODW_Fields::get_periodicity_options()`** — Kontrolliertes Vokabular für Aktualisierungsfrequenzen

### Geändert
- Vorschau-Tab umbenannt von „4" auf „5" (Erweiterte Angaben ist jetzt Tab 4)
- Help Tab Beschreibung aktualisiert

---

## [1.6.0] — 2026-04-21

### Hinzugefügt
- **Settings-Seite** unter *Datensätze → Einstellungen* mit vier Sektionen:
- **Katalog**: Katalog-Titel (überschreibt den Standardwert im REST API), Herausgebende Organisation
- **Standardwerte**: Standard-Lizenz und Standard-Sprache — werden bei neuen Datensätzen automatisch vorausgefüllt (via `set_default_value()` in Carbon Fields)
- **REST API**: Cache-Laufzeit konfigurierbar (60–86400 s, Standard 300 s)
- **Deinstallation**: Checkbox für opt-in Datenlöschung (ersetzt separate Option)
- **„Alle Qualitätsscores neu berechnen"**-Button auf der Settings-Seite (nonce-gesichert, zeigt Anzahl aktualisierter Datensätze)
- **`ODW_Settings::get()`** — zentrale API für Einstellungszugriff in anderen Klassen
- **`ODW_Rest_API::delete_catalog_transients_public()`** — öffentlicher Alias für Cache-Invalidierung nach Einstellungsänderungen

### Geändert
- `uninstall.php`: liest jetzt `odw_settings[delete_on_uninstall]` statt separater Option; löscht auch `odw_settings`, `odw_demo_post_id`, `odw_show_welcome`

---

## [1.5.0] — 2026-04-21

### Hinzugefügt
Expand Down
57 changes: 57 additions & 0 deletions assets/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,63 @@
margin-top: 10px;
}

/* =========================================================================
Download-Datei Meta Box
========================================================================= */

.odw-file-upload {
padding: 4px 0;
}

/* Preview area */
.odw-file-preview {
display: flex;
align-items: flex-start;
gap: 8px;
padding: 10px 12px;
border: 1px solid var(--odw-color-border);
border-radius: var(--odw-radius);
background: var(--odw-color-bg-light);
margin-bottom: 10px;
min-height: 42px;
}

.odw-file-preview .odw-file-icon {
flex-shrink: 0;
font-size: 20px;
color: var(--odw-color-text-muted);
margin-top: 1px;
}

.odw-file-preview--has-file .odw-file-icon {
color: var(--odw-color-primary);
}

.odw-file-name {
font-size: 13px;
line-height: 1.5;
word-break: break-word;
}

.odw-file-preview--empty .odw-file-name {
color: var(--odw-color-text-muted);
font-style: italic;
}

/* Action buttons */
.odw-file-actions {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin-bottom: 8px;
}

.odw-file-actions .button .dashicons {
vertical-align: middle;
margin-top: -2px;
font-size: 16px;
}

/* =========================================================================
Responsive — WordPress admin breakpoint (782px)
========================================================================= */
Expand Down
70 changes: 70 additions & 0 deletions assets/js/odw-file-upload.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/* global wp, odwFileUpload */
/**
* Native WordPress Media Library integration for the Download-Datei meta box.
*
* Depends on: jquery, wp.media (loaded via wp_enqueue_media())
*/
( function ( $ ) {
'use strict';

var frame;

var $preview = $( '#odw-file-preview' );
var $fileName = $( '#odw-file-name' );
var $input = $( '#odw-file-id-input' );
var $selectBtn = $( '#odw-file-select-btn' );
var $removeBtn = $( '#odw-file-remove-btn' );

// Restore UI state from server-rendered data on page load.
if ( odwFileUpload.currentId > 0 && odwFileUpload.currentName ) {
_setHasFile( odwFileUpload.currentName );
}

// Open the WordPress Media Library frame.
$selectBtn.on( 'click', function ( e ) {
e.preventDefault();

if ( frame ) {
frame.open();
return;
}

frame = wp.media( {
title: odwFileUpload.labels.frameTitle,
button: { text: odwFileUpload.labels.frameButton },
multiple: false,
} );

frame.on( 'select', function () {
var attachment = frame.state().get( 'selection' ).first().toJSON();
$input.val( attachment.id );
_setHasFile( attachment.filename || attachment.title );
} );

frame.open();
} );

// Clear the current attachment selection.
$removeBtn.on( 'click', function ( e ) {
e.preventDefault();
$input.val( 0 );
_setEmpty();
} );

function _setHasFile( name ) {
$fileName.text( name );
$preview
.removeClass( 'odw-file-preview--empty' )
.addClass( 'odw-file-preview--has-file' );
$removeBtn.prop( 'disabled', false );
}

function _setEmpty() {
$fileName.text( odwFileUpload.labels.noFile );
$preview
.removeClass( 'odw-file-preview--has-file' )
.addClass( 'odw-file-preview--empty' );
$removeBtn.prop( 'disabled', true );
}

} )( jQuery );
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"szepeviktor/phpstan-wordpress": "^2.0",
"wp-coding-standards/wpcs": "^3.1",
"phpcsstandards/phpcsutils": "^1.0",
"phpunit/phpunit": "^10.5",
"10up/wp_mock": "^0.5"
"phpunit/phpunit": "^9.6",
"10up/wp_mock": "^1.0"
},
"config": {
"optimize-autoloader": true,
Expand Down
Loading
Loading