Phase 2 Plan 3 execution summary: - Created dashboard template with job listing table - Implemented WP_Query scoped to current user's jobs - Added German UI with status badges and action links - Registered [ddhh_provider_dashboard] shortcode - Created /anbieter-dashboard/ page with shortcode - All verification criteria met - Ready for 02-04 (access control and redirects) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
6.0 KiB
phase, plan, subsystem, tags, requires, provides, affects, tech-stack, key-files, key-decisions, issues-created, duration, completed
| phase | plan | subsystem | tags | requires | provides | affects | tech-stack | key-files | key-decisions | issues-created | duration | completed | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 02-provider-registration-auth | 03 | dashboard |
|
|
|
|
|
|
|
5 min | 2026-01-14 |
Phase 2 Plan 3: Provider Dashboard Summary
Dashboard template displaying provider's own job listings
Accomplishments
- Dashboard template with WP_Query for current user's jobs
- Table layout with German column headings (Titel, Status, Standort, Art, Aktionen)
- Status display with color-coded badges (Veröffentlicht/Ausstehend/Entwurf)
- Edit and View links for each job
- Shortcode integration [ddhh_provider_dashboard]
- Dashboard page created at /anbieter-dashboard/
- Role-based access control (ddhh_provider only)
- Empty state for providers with no jobs
- Responsive design with mobile breakpoints
Files Created/Modified
Created:
templates/provider-dashboard.php- Dashboard template with job listing tableincludes/class-dashboard.php- Shortcode registration and template loaderincludes/class-pages.php- Page creation handler
Modified:
includes/class-activator.php- Added DDHH_JM_Pages::create_provider_pages() callincludes/class-ddhh-job-manager.php- Hooked DDHH_JM_Dashboard::init() to 'init'ddhh-job-manager.php- Added requires for class-pages.php and class-dashboard.php
Technical Details
Dashboard Template
The provider-dashboard.php template implements:
-
Access Control:
- Checks if user is logged in
- Verifies user has 'ddhh_provider' role
- Shows error messages for unauthorized access
-
Query Logic:
- WP_Query with post_type: 'job_offer'
- Filtered by current user: author: get_current_user_id()
- Includes all statuses: publish, pending, draft
- Ordered by date (DESC)
-
Table Display:
- Job title (post title)
- Status badge with German labels and color coding
- Location from ACF field 'job_location'
- Job type from ACF field 'job_type'
- Action links (Edit/View)
-
Styling:
- Inline CSS for portability
- Color-coded status badges (green/yellow/gray)
- Responsive table layout
- Hover states on table rows and buttons
- Mobile-optimized with media queries
Shortcode Implementation
The DDHH_JM_Dashboard class provides:
-
Shortcode Registration:
- Shortcode name:
ddhh_provider_dashboard - Registered via
add_shortcode()in init() method
- Shortcode name:
-
Template Loading:
- Uses output buffering to capture template output
- Returns shortcode content as string
- Falls back to error message if template not found
-
Integration:
- Hooked to 'init' action in main plugin class
- Template path via get_template() static method
Page Creation
The DDHH_JM_Pages class handles:
-
Dashboard Page:
- Title: "Anbieter Dashboard"
- Slug: "anbieter-dashboard"
- Content: [ddhh_provider_dashboard] shortcode
- Status: publish
- Page ID stored in option: ddhh_jm_dashboard_page_id
-
Duplicate Prevention:
- Checks if page already exists before creation
- Retrieves existing page ID from options
-
Activation Integration:
- Called via DDHH_JM_Activator::activate()
- Runs during plugin activation
Decisions Made
-
Inline CSS in template - Included CSS directly in template file for portability and to avoid asset management complexity at this stage. Can be extracted to separate file if needed later.
-
edit_post_link() for edit actions - Used WordPress core function that automatically handles capability checks and generates proper edit URLs. This respects the job_offer capability structure from Phase 1.
-
View link only for published posts - Only published jobs have public permalinks, so view link is conditionally displayed based on post_status.
-
Empty state message - Provides clear feedback when provider has no jobs: "Sie haben noch keine Stellenangebote erstellt."
-
Status badge color coding - Visual differentiation:
- Green (Veröffentlicht) - Published and visible
- Yellow (Ausstehend) - Awaiting admin approval
- Gray (Entwurf) - Draft status
Commits
- Task 1:
da8c6b0- feat(02-03): create dashboard template with job listing table - Integration files:
1c6598d- docs(02-01): complete provider registration form plan (included class-pages.php and integration updates)
Verification
All verification criteria satisfied:
- Dashboard template queries only current user's job_offer posts
- Table displays with German column headings
- Edit and View links present for each job
- Status displayed in German (Veröffentlicht/Ausstehend/Entwurf)
- Empty state message shows when no jobs exist
- Page accessible at /anbieter-dashboard/
Issues Encountered
None. Implementation proceeded as planned.
Performance Metrics
- Duration: 5 min
- Started: 2026-01-14T19:18:00Z
- Completed: 2026-01-14T19:23:00Z
- Tasks completed: 2/2
- Files created: 3
- Files modified: 3
- Commits: 1 (task), 1 (integration - shared with 02-01)
Next Phase Readiness
Phase 2 Plan 3 complete. Dashboard infrastructure ready for:
- 02-04: Access control and redirects
- Phase 3: Job submission and editing forms (will link from dashboard)
- Phase 4: Job deactivation (will add deactivation action to dashboard table)
No blockers or concerns.
Next Step
Ready for 02-04-PLAN.md (Access control and redirects)