diff --git a/templates/provider-dashboard.php b/templates/provider-dashboard.php index 102bbd6..792b99f 100644 --- a/templates/provider-dashboard.php +++ b/templates/provider-dashboard.php @@ -29,6 +29,9 @@ if ( ! in_array( 'ddhh_provider', $current_user->roles, true ) ) { // Check if we're in edit mode $is_edit_mode = isset( $_GET['action'] ) && $_GET['action'] === 'edit_job' && isset( $_GET['job_id'] ); +// Check if we're in deactivate mode +$is_deactivate_mode = isset( $_GET['action'] ) && $_GET['action'] === 'deactivate_job' && isset( $_GET['job_id'] ); + if ( $is_edit_mode ) { $job_id = absint( $_GET['job_id'] ); $form_id = DDHH_JM_Formidable::get_job_edit_form_id(); @@ -47,6 +50,24 @@ if ( $is_edit_mode ) { } } +if ( $is_deactivate_mode ) { + $job_id = absint( $_GET['job_id'] ); + $form_id = DDHH_JM_Formidable::get_job_deactivation_form_id(); + + if ( $form_id ) { + ?> +
+
+

Stellenangebot deaktivieren

+

← Zurück zur Übersicht

+ +
+
+ 'job_offer', @@ -130,6 +151,18 @@ $job_query = new WP_Query( $args ); if ( 'publish' === $post_status ) { echo ' Ansehen'; } + + // Deactivate link - only for published posts + if ( 'publish' === $post_status ) { + $deactivate_url = add_query_arg( + array( + 'action' => 'deactivate_job', + 'job_id' => $post_id, + ), + get_permalink() + ); + echo ' Deaktivieren'; + } ?> @@ -167,14 +200,16 @@ $job_query = new WP_Query( $args ); color: #333; } -.ddhh-job-edit-section { +.ddhh-job-edit-section, +.ddhh-job-deactivate-section { padding: 2rem; background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); } -.ddhh-job-edit-section h2 { +.ddhh-job-edit-section h2, +.ddhh-job-deactivate-section h2 { margin-top: 0; margin-bottom: 1rem; font-size: 1.5rem; @@ -291,6 +326,15 @@ $job_query = new WP_Query( $args ); background-color: #059669; } +.deactivate-link { + background-color: #ef4444; + margin-left: 0.5rem; +} + +.deactivate-link:hover { + background-color: #dc2626; +} + .ddhh-empty-state, .ddhh-error-message { padding: 3rem;