# CC Soccer D11 - Session Handoff
**Date:** March 4, 2026
**Session:** Home page league/tournament card images
**Branch:** `main`

## Last Updated
2026-03-04

## Current State
- All core functionality working
- Home page now shows cover images on all three cards (Coed, Men's 35+, Tournament)
- Tournament card is now dynamic — loads current/upcoming active Tournament entity instead of hardcoded text
- `drush updb` required on Andrew's side after pull (runs hooks 9056 + 9057)

---

## ⚠️ Andrew: What You Need To Do

```bash
cd ~/public_html/test_ccsoccer_site
git pull
PATH=/opt/cpanel/ea-php83/root/usr/bin:$PATH /opt/cpanel/ea-php83/root/usr/bin/php vendor/drush/drush/drush.php -r web updb -y
PATH=/opt/cpanel/ea-php83/root/usr/bin:$PATH /opt/cpanel/ea-php83/root/usr/bin/php vendor/drush/drush/drush.php -r web cr
```

**Schema changes:** Yes — update hooks 9056 and 9057 must run.

---

## What Was Done This Session

### Home Page League/Tournament Cards — Images Added

**Problem:** League and tournament cards on the home page had no images. The `picture` field existed on the League entity and the image logic was in `homePage()`, but the League entities had empty `picture` fields (lost when Andrew's DB was imported). The tournament card was also hardcoded HTML with no image.

**Solution:**
1. Added `picture` field to the `Tournament` entity (`Tournament.php`)
2. Moved all three cover images into `web/themes/custom/ccsoccer_theme/images/` so they're tracked in git
3. Update hook `9056` — installs the `picture` field on the tournament DB schema
4. Update hook `9057` — copies images from theme folder into `public://league_pictures/`, creates managed file entities, attaches to League entities (matched by `type` field) and Tournament entities (all get SLO Friendly cover as default, skips if already set)
5. Updated `homePage()` in `ContentController.php` to dynamically load the current/upcoming active Tournament instead of hardcoded card

**Tournament card logic:** Queries for active tournaments with `start_date >= today` (ascending, soonest first). Falls back to most recent past active tournament if none upcoming.

**Note:** Tournament description on the home page card comes from the Tournament entity's `description` field. Edit via `/admin/ccsoccer/tournaments`. Future improvement: fallback to a generic blurb if description is empty.

---

## Files Modified This Session
| File | Changes |
|------|---------|
| `web/modules/custom/ccsoccer/src/Entity/Tournament.php` | Added `picture` image field |
| `web/modules/custom/ccsoccer/ccsoccer.install` | Added update hooks 9056 (Tournament picture field) and 9057 (attach cover images) |
| `web/modules/custom/ccsoccer/src/Controller/ContentController.php` | `homePage()` — replaced hardcoded tournament card with dynamic Tournament entity query; refactored league cards to match; use `->processed` for descriptions so WYSIWYG HTML renders correctly |
| `web/themes/custom/ccsoccer_theme/images/coed-league-cover.jpg` | New — Coed league cover photo |
| `web/themes/custom/ccsoccer_theme/images/mens-league-cover.jpg` | New — Men's 35+ cover photo |
| `web/themes/custom/ccsoccer_theme/images/slo-friendly-cover.jpg` | New — SLO Friendly tournament cover photo |

---

## Remaining Work

### Content
- [ ] Add description to 2026 Summer Cup tournament entity (`/admin/ccsoccer/tournaments`)

### Inner Page Styling
- [ ] My Orders page
- [ ] My Registrations page
- [ ] Credits page
- [ ] Purchase Jerseys page
- [ ] User profile / edit form
- [ ] Group management page

### Forms
- [ ] Registration form inputs, buttons, visual styling
- [ ] User edit form styling

### Navigation / Mobile
- [ ] Re-add Tournament Schedule to main nav

### Notifications
- [ ] "Don't send to already registered" logic
- [ ] Automated reminders (6/4/2/1 week intervals)

### Deployment Prep
- [ ] Self-host Inter font
- [ ] Re-enable CSS/JS aggregation
- [ ] Final mobile/browser testing
- [ ] Remove IP whitelist block from production `.htaccess`
- [ ] Decide canonical domain (www vs non-www) and uncomment the appropriate redirect rule in `.htaccess`
- [ ] Confirm HTTPS redirect is handled at host level (InMotion), or add RewriteCond to `.htaccess`

### Small Items
- [ ] Breadcrumbs: custom builder for full trails on custom routes
- [ ] Game status: only show ON/CANCELLED after 3pm
- [ ] Contact page — does /contact exist? Footer links to it
- [ ] Social links — Facebook/Instagram URLs are placeholder (#)
- [ ] Hero width mismatch (doesn't go full bleed)
- [ ] Password reset flow for migrated users

---

## Test Server .htaccess (IP Whitelist)

The test server `.htaccess` has an IP whitelist block that is **not in git**.
It's protected from being overwritten by pulls via `skip-worktree`.

If the whitelist is ever lost again, paste this near the top of `web/.htaccess`
(before the `<FilesMatch>` block), then re-run the skip-worktree command:

```apache
# IP Whitelist - Test server only (DO NOT commit to git)
# Note: inline comments after IPs cause 500 errors - keep IPs on one line, no comments
# Note: <RequireAny> container causes 500 on InMotion shared hosting - use single line
# Caleb/Layne: 68.249.41.9 | Andrew: 35.151.50.130 | Dave: 99.8.107.54 | Haley: 97.84.70.141
Require ip 68.249.41.9 35.151.50.130 99.8.107.54 97.84.70.141

# Prevent search engine indexing - Test server only
<IfModule mod_headers.c>
  Header set X-Robots-Tag "noindex, nofollow, noarchive"
</IfModule>
```

```bash
# Run once after editing - prevents git pull from overwriting
git update-index --skip-worktree web/.htaccess

# Verify (should show lowercase 's' prefix)
git ls-files -v web/.htaccess

# To temporarily undo (e.g. to pull a legit .htaccess change)
git update-index --no-skip-worktree web/.htaccess
```

---

## Server Quick Reference
```bash
cd ~/public_html/test_ccsoccer_site
git pull
PATH=/opt/cpanel/ea-php83/root/usr/bin:$PATH /opt/cpanel/ea-php83/root/usr/bin/php vendor/drush/drush/drush.php -r web updb -y
PATH=/opt/cpanel/ea-php83/root/usr/bin:$PATH /opt/cpanel/ea-php83/root/usr/bin/php vendor/drush/drush/drush.php -r web cr
```

## Git Workflow
- Always `git pull` before `git push` — Andrew may have pushed changes
- `main` is the primary branch
- `settings.local.php` is NOT in git — never commit it, manage per-environment manually
- **Before running `drush cex`:** check diff to avoid reverting config changes from other contributors
