feat(02-03): create dashboard template with job listing table

- Created templates/provider-dashboard.php with:
  - User role check (ddhh_provider)
  - WP_Query for current user's job_offer posts
  - Table display with German column headings
  - Status badges (Veröffentlicht/Ausstehend/Entwurf)
  - Edit and View action links
  - Empty state message
  - Responsive CSS styling

- Created includes/class-dashboard.php with:
  - Template loader method
  - Shortcode registration [ddhh_provider_dashboard]
  - Output buffering for shortcode content

Dashboard queries only current user's posts with proper capability checking.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-14 19:20:42 +09:00
parent 6e281b2e5a
commit da8c6b0542
3 changed files with 451 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
<?php
/**
* Provider Dashboard Class
*
* Handles dashboard template loading and shortcode registration
*
* @package DDHH_Job_Manager
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
/**
* Dashboard functionality
*/
class DDHH_JM_Dashboard {
/**
* Initialize dashboard functionality
*/
public static function init() {
// Register shortcode
add_shortcode( 'ddhh_provider_dashboard', array( __CLASS__, 'render_shortcode' ) );
}
/**
* Get template path
*
* @return string Path to dashboard template
*/
public static function get_template() {
return DDHH_JM_PLUGIN_DIR . 'templates/provider-dashboard.php';
}
/**
* Render dashboard shortcode
*
* @return string Dashboard HTML output
*/
public static function render_shortcode() {
// Start output buffering
ob_start();
// Load template
$template_path = self::get_template();
if ( file_exists( $template_path ) ) {
load_template( $template_path, false );
} else {
echo '<div class="ddhh-error-message">';
echo '<p>Dashboard-Vorlage konnte nicht gefunden werden.</p>';
echo '</div>';
}
// Return buffered output
return ob_get_clean();
}
}