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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@ Versionierung folgt [Semantic Versioning](https://semver.org/).

---

## [1.5.0] — 2026-04-21

### Hinzugefügt
- **Demo-Datensatz bei Installation**: Beim ersten Admin-Aufruf nach der Aktivierung wird automatisch ein vollständig befüllter Demo-Datensatz (`odw_dataset`) erstellt — inklusive Beispiel-CSV aus der Mediathek (`assets/sample/beispiel-datensatz.csv`), allen Meta-Feldern, CF-Distribution und berechnetem Qualitätsscore
- **Willkommens-Notice** (einmalig, dismissible): Zeigt nach der Aktivierung den fertigen Shortcode (`[odw_dataset id="…"]`) zum direkten Copy-Paste, Links zum Demo-Datensatz und zur Übersicht sowie einen „Hinweis ausblenden"-Link (Nonce-gesichert)
- **`includes/class-setup.php`**: Kapselt die gesamte Installations-Logik; `on_activation()` setzt nur eine Option (kein CF-Zugriff), `maybe_create_demo()` läuft auf `admin_init` wenn Carbon Fields vollständig initialisiert ist

---

## [1.4.0] — 2026-04-21

### Hinzugefügt
- **Shortcode `[odw_dataset id="…"]`** — gibt eine Download-Card im Frontend aus mit Titel, Thema-Badge, Lizenz, DCAT-Qualität, Dateigröße/Format und Download-Button
- **Download-Datei über Mediathek** (`_odw_file_id`): Neues File-Feld in Tab 3 verknüpft eine Datei aus der WordPress-Mediathek; Dateigröße und Format werden automatisch ermittelt
- **Shortcode-Spalte in der Admin-Übersicht**: Zeigt `[odw_dataset id="123"]` als klickbares, schreibgeschütztes Textfeld (Klick = Markierung für Copy-Paste)
- **`assets/css/frontend.css`**: Strukturelles Layout der Download-Card (Flexbox/Grid, Abstände, Rahmen) ohne feste Farben — erbt vollständig vom aktiven Theme

---

## [1.3.0] — 2026-04-21

### Hinzugefügt
Expand Down
16 changes: 16 additions & 0 deletions assets/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,22 @@
width: 130px;
}

.column-odw_shortcode {
width: 210px;
}

.odw-shortcode-input {
width: 100%;
font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
font-size: 11px;
cursor: text;
background: var(--odw-color-bg-light);
border: 1px solid var(--odw-color-border);
border-radius: var(--odw-radius);
padding: 3px 6px;
color: var(--odw-color-text);
}

/* Status badges */
.odw-status-badge {
display: inline-block;
Expand Down
133 changes: 133 additions & 0 deletions assets/css/frontend.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
/**
* Open Data Wizard — Frontend Styles (Download-Card)
*
* Nur strukturelle Styles (Abstände, Layout, Rahmen).
* Farben und Schriften werden vom aktiven Theme geerbt.
*/

/* =========================================================================
Download-Card
========================================================================= */

.odw-download-card {
border: 1px solid currentColor;
border-radius: 4px;
padding: 1.25rem;
margin: 1.5rem 0;
opacity: 0.99; /* Stacking context für border-color inherit */
}

/* Header: Titel + Thema-Badge nebeneinander */
.odw-download-card__header {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
justify-content: space-between;
gap: 0.5rem 0.75rem;
margin-bottom: 0.875rem;
}

.odw-download-card__title {
margin: 0;
font-size: 1.1em;
font-weight: 600;
line-height: 1.3;
flex: 1 1 auto;
}

.odw-download-card__theme {
flex-shrink: 0;
display: inline-block;
padding: 0.2em 0.65em;
border: 1px solid currentColor;
border-radius: 99px;
font-size: 0.8em;
opacity: 0.65;
white-space: nowrap;
}

/* Metadaten-Liste */
.odw-download-card__meta {
display: grid;
grid-template-columns: max-content 1fr;
gap: 0.3rem 1rem;
margin: 0 0 1rem;
padding: 0;
font-size: 0.9em;
}

.odw-download-card__meta-row {
display: contents;
}

.odw-download-card__meta dt {
font-weight: 500;
opacity: 0.65;
}

.odw-download-card__meta dd {
margin: 0;
}

/* Footer: Download-Button + Datei-Info */
.odw-download-card__footer {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.625rem;
padding-top: 0.875rem;
border-top: 1px solid currentColor;
opacity: inherit;
}

.odw-download-card__button {
display: inline-block;
padding: 0.45em 1.1em;
border: 1px solid currentColor;
border-radius: 3px;
font-weight: 600;
font-size: 0.9em;
text-decoration: none;
line-height: 1.4;
}

.odw-download-card__button:hover {
opacity: 0.8;
}

.odw-download-card__file-info {
font-size: 0.85em;
opacity: 0.65;
}

/* =========================================================================
Responsive
========================================================================= */

@media screen and (max-width: 480px) {
.odw-download-card__header {
flex-direction: column;
}

.odw-download-card__meta {
grid-template-columns: 1fr;
gap: 0;
}

.odw-download-card__meta-row {
display: block;
margin-bottom: 0.4rem;
}

.odw-download-card__meta dt {
display: inline;
}

.odw-download-card__meta dt::after {
content: ': ';
}

.odw-download-card__meta dd {
display: inline;
}
}
9 changes: 9 additions & 0 deletions assets/sample/beispiel-datensatz.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Name,Kategorie,Stadt,Schwerpunkt,Aktiv_seit,Mitglieder
Bürgerinitiative Grünstadt e.V.,Umweltschutz,Beispielstadt,Lokaler Umwelt- und Klimaschutz,2015,120
Nachbarschaftshilfe Nord e.V.,Soziale Hilfe,Musterort,Alltagshilfe und Begegnung,2018,45
Kulturverein Bunt,Kultur & Kunst,Testdorf,Kulturvermittlung und Integration,2010,230
Sportjugend West,Sport,Demostadt,Jugendsport und Prävention,2005,380
Digitale Bürger e.V.,Digitale Bildung,Netzstadt,Medienkompetenz und Open Data,2020,67
Tafelrunde Mitte,Soziale Hilfe,Musterhausen,Lebensmittelversorgung Bedürftiger,2003,155
Förderverein Stadtbibliothek,Bildung,Beispieldorf,Leseförderung und Bildungszugang,2012,89
Repair-Café Südstadt,Umweltschutz,Demogemeinde,Reparatur und Ressourcenschonung,2019,34
12 changes: 11 additions & 1 deletion includes/class-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ public static function set_columns( array $columns ): array {
$new_columns['title'] = __( 'Titel', 'open-data-wizard' );
$new_columns['odw_license'] = __( 'Lizenz', 'open-data-wizard' );
$new_columns['odw_theme'] = __( 'Thema', 'open-data-wizard' );
$new_columns['odw_quality'] = __( 'Qualität', 'open-data-wizard' );
$new_columns['odw_quality'] = __( 'Qualität', 'open-data-wizard' );
$new_columns['odw_status'] = __( 'Status', 'open-data-wizard' );
$new_columns['odw_modified'] = __( 'Änderungsdatum', 'open-data-wizard' );
$new_columns['odw_shortcode'] = __( 'Shortcode', 'open-data-wizard' );

return $new_columns;
}
Expand Down Expand Up @@ -92,6 +93,15 @@ public static function render_column( string $column, int $post_id ): void {
$modified = get_post_meta( $post_id, '_odw_modified', true );
echo esc_html( $modified ?: '—' );
break;

case 'odw_shortcode':
$shortcode = '[odw_dataset id="' . $post_id . '"]';
printf(
'<input type="text" class="odw-shortcode-input" readonly value="%s" onclick="this.select();" title="%s">',
esc_attr( $shortcode ),
esc_attr__( 'Klicken zum Markieren', 'open-data-wizard' )
);
break;
}
}

Expand Down
3 changes: 3 additions & 0 deletions includes/class-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ private static function register_required_fields(): void {
->set_attribute( 'type', 'number' )
->set_attribute( 'min', '0' ),
] ),

Field::make( 'file', 'odw_file_id', __( 'Download-Datei (Mediathek)', 'open-data-wizard' ) )
->set_help_text( __( 'Datei aus der WordPress-Mediathek verknüpfen. Dateigröße und Format werden automatisch aus der Datei ermittelt und vom [odw_dataset]-Shortcode als Download-Button verwendet.', 'open-data-wizard' ) ),
]
)
->add_tab(
Expand Down
Loading
Loading