docs(02): create phase 2 plans
Phase 02: Provider Registration & Auth - 4 plans created - 8 total tasks defined - Ready for execution Plans: - 02-01: Formidable registration form with auto-login - 02-02: Combined login/registration page - 02-03: Provider dashboard template - 02-04: Access control and redirects
This commit is contained in:
148
.planning/phases/02-provider-registration-auth/02-03-PLAN.md
Normal file
148
.planning/phases/02-provider-registration-auth/02-03-PLAN.md
Normal file
@@ -0,0 +1,148 @@
|
||||
---
|
||||
phase: 02-provider-registration-auth
|
||||
plan: 03
|
||||
type: execute
|
||||
depends_on: []
|
||||
files_modified: [includes/class-dashboard.php, templates/provider-dashboard.php]
|
||||
---
|
||||
|
||||
<objective>
|
||||
Create provider dashboard template that lists user's own job_offer posts.
|
||||
|
||||
Purpose: Give providers a central view of their published job listings.
|
||||
Output: Dashboard page accessible at /anbieter-dashboard/ showing provider's jobs with edit/view links.
|
||||
</objective>
|
||||
|
||||
<execution_context>
|
||||
~/.claude/get-shit-done/workflows/execute-plan.md
|
||||
./summary.md
|
||||
</execution_context>
|
||||
|
||||
<context>
|
||||
@.planning/PROJECT.md
|
||||
@.planning/ROADMAP.md
|
||||
@.planning/phases/01-foundation-setup/01-02-SUMMARY.md
|
||||
@.planning/phases/01-foundation-setup/01-03-SUMMARY.md
|
||||
|
||||
**From Phase 1:**
|
||||
- Custom post type `job_offer` exists with custom capabilities
|
||||
- Providers have edit_job_offers capability (own posts only)
|
||||
- ACF fields available: job_location, job_type, job_deadline, job_contact_email, job_logo
|
||||
|
||||
**Requirements:**
|
||||
- German UI
|
||||
- List only current user's job_offer posts
|
||||
- Show edit and view links
|
||||
- Simple table layout
|
||||
</context>
|
||||
|
||||
<tasks>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 1: Create dashboard template</name>
|
||||
<files>templates/provider-dashboard.php, includes/class-dashboard.php</files>
|
||||
<action>
|
||||
Create `templates/provider-dashboard.php`:
|
||||
- Check if user is logged in and has ddhh_provider role (else show error message)
|
||||
- Query current user's job_offer posts using WP_Query:
|
||||
- post_type: 'job_offer'
|
||||
- author: get_current_user_id()
|
||||
- post_status: ['publish', 'pending', 'draft']
|
||||
- orderby: 'date'
|
||||
- order: 'DESC'
|
||||
- Display results in HTML table with columns:
|
||||
1. Title (job post title)
|
||||
2. Status (Veröffentlicht / Ausstehend / Entwurf)
|
||||
3. Location (ACF field job_location)
|
||||
4. Type (ACF field job_type)
|
||||
5. Actions (Bearbeiten link to edit screen, Ansehen link to public view if published)
|
||||
- German labels for all headings
|
||||
- If no jobs, show message "Sie haben noch keine Stellenangebote erstellt."
|
||||
|
||||
Create `includes/class-dashboard.php` with static method get_template():
|
||||
- Returns path to templates/provider-dashboard.php
|
||||
- Handles template loading with load_template()
|
||||
|
||||
DO NOT use wp-admin edit links - providers should not access WP-Admin. Use frontend edit approach or direct edit_post_link() which WordPress handles based on capabilities.
|
||||
</action>
|
||||
<verify>Template file exists, displays current user's jobs in table format, German labels present</verify>
|
||||
<done>Dashboard template created, queries user's posts correctly, displays in table with German labels</done>
|
||||
</task>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 2: Create dashboard page and shortcode</name>
|
||||
<files>includes/class-dashboard.php, includes/class-pages.php</files>
|
||||
<action>
|
||||
In class-pages.php create_provider_pages(), add second page creation:
|
||||
- post_title: 'Anbieter Dashboard'
|
||||
- post_name: 'anbieter-dashboard'
|
||||
- post_content: [ddhh_provider_dashboard] shortcode
|
||||
- Store page ID in option 'ddhh_jm_dashboard_page_id'
|
||||
|
||||
In class-dashboard.php, register shortcode 'ddhh_provider_dashboard':
|
||||
- Shortcode handler loads templates/provider-dashboard.php
|
||||
- Returns output buffered content
|
||||
|
||||
Check page doesn't already exist before creating.
|
||||
|
||||
Hook shortcode registration to 'init' action in main class.
|
||||
</action>
|
||||
<verify>Dashboard page exists at /anbieter-dashboard/, shortcode renders template, table displays user's jobs</verify>
|
||||
<done>Dashboard page created, shortcode functional, displays job list for logged-in provider</done>
|
||||
</task>
|
||||
|
||||
</tasks>
|
||||
|
||||
<verification>
|
||||
Before declaring plan complete:
|
||||
- [ ] 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/
|
||||
</verification>
|
||||
|
||||
<success_criteria>
|
||||
|
||||
- All tasks completed
|
||||
- Dashboard functional for providers
|
||||
- Queries scoped to current user
|
||||
- German UI throughout
|
||||
- Ready for 02-04 (access control)
|
||||
</success_criteria>
|
||||
|
||||
<output>
|
||||
After completion, create `.planning/phases/02-provider-registration-auth/02-03-SUMMARY.md`:
|
||||
|
||||
# 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
|
||||
- Status display (Veröffentlicht/Ausstehend/Entwurf)
|
||||
- Edit and View links for each job
|
||||
- Shortcode integration
|
||||
- Dashboard page created at /anbieter-dashboard/
|
||||
|
||||
## Files Created/Modified
|
||||
|
||||
- `templates/provider-dashboard.php` - Dashboard template
|
||||
- `includes/class-dashboard.php` - Shortcode and template loader
|
||||
- `includes/class-pages.php` - Added dashboard page creation
|
||||
|
||||
## Decisions Made
|
||||
|
||||
[Document query approach, template structure]
|
||||
|
||||
## Issues Encountered
|
||||
|
||||
[Problems and resolutions, or "None"]
|
||||
|
||||
## Next Step
|
||||
|
||||
Ready for 02-04-PLAN.md
|
||||
</output>
|
||||
Reference in New Issue
Block a user