# CC Soccer D11 - Session Handoff
**Date:** March 8, 2026
**Session:** Page styling: My Orders, registration confirm, profile tabs, mobile checkout
**Branch:** `feature/update_look_and_feel`

## Last Updated
2026-03-08

## Current State
- All core functionality working
- User-facing page styling significantly improved this session
- My Orders, registration confirmation, user profile tabs, and mobile checkout all polished
- Player discount system and all previous features remain intact

---

## ⚠️ 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 cr
```

**Schema changes:** None.
**Note:** Cache rebuild is required — new Twig templates were added for local task tabs.

---

## What Was Done This Session

### 1. My Orders Page — Custom Controller

**Problem:** `/my-orders` previously redirected to Drupal's built-in Commerce Views page (`/user/{uid}/orders`), which showed raw profile tabs (View, Payment methods, Edit, Orders) as a bullet list and an unstyled table.

**Solution:** Replaced the redirect in `ContentController::myOrders()` with a proper controller that queries orders directly and renders them in a styled card-wrapped table:
- Gray uppercase header row (ORDER, DATE, TOTAL, STATUS)
- Order number links in primary red
- State badges with color coding (green "Completed", red "Canceled", yellow "Pending")
- Row hover states
- Mobile responsive — stacks into card-like rows on phones using `data-label` attributes
- Empty state with CTA to register if no orders exist

### 2. Registration Confirmation Page Restyled

**Problem:** The `/register/confirm` page used a flat emoji checkmark and simpler styling that didn't match the polished checkout complete page.

**Solution:** Restyled to match the `checkout-complete` card pattern:
- Circular green checkmark icon (replacing flat ✅ emoji)
- Consistent heading/subheading hierarchy using design tokens
- Primary CTA button ("Go to Log In →") styled like `completion-primary-btn`
- "What's Next?" section with `--color-gray-100` background
- "Return to Home" as secondary understated link

### 3. User Profile Local Task Tabs — Pill Style

**Problem:** All `/user/{uid}/*` pages (View, Payment methods, Edit, Orders) showed Drupal's default local task tabs as an unstyled bullet list.

**Solution:** Created Twig template overrides and CSS for horizontal pill-style tabs:
- `menu-local-tasks.html.twig` — wraps tabs in a `<nav class="ccs-tabs">` container
- `menu-local-task.html.twig` — renders each tab as a pill with `ccs-tabs__tab` class
- Active tab fills with CC Soccer red, inactive tabs are outlined pills
- Hover state highlights border in primary red
- Works for all tabs including the admin "Credits" tab

### 4. User Profile Page Styles

**Solution:** Created `user-pages.css` loaded globally by the theme, covering:
- **User profile view** (`/user/{uid}`) — field labels as small uppercase headers, constrained max-width
- **User edit form** (`/user/{uid}/edit`) — 620px max width, polished password strength indicator, primary save button with border separator
- **Payment methods** (`/user/{uid}/payment-methods`) — card-style payment method items, styled empty state
- **Commerce orders view** (`/user/{uid}/orders`) — attempted card-wrapped table styling (CSS selectors didn't match Drupal's output — low priority since users access `/my-orders` instead)

### 5. Mobile Checkout Overflow Fix

**Problem:** On iPhone, the billing address form in checkout was wider than the viewport, forcing the user to zoom out. This caused the footer to appear at half-width since it rendered at the original viewport size.

**Solution:** Two-layer fix:
- **`layout.css`** — Added `overflow-x: hidden` on `html` and `body` as a safety net preventing any content from expanding page width beyond viewport
- **`checkout.css`** — Added comprehensive overflow prevention for Commerce checkout:
  - All form containers get `max-width: 100%` and `box-sizing: border-box`
  - All form inputs (text, email, tel, select, textarea) constrained to container
  - Address-specific containers (`.address-container`, `.field--type-address`) constrained
  - On mobile (<600px): broad `*` selector forces all checkout children to respect max-width
  - Address inline rows (City/State/Zip) wrap vertically on mobile instead of overflowing

---

## Previous Session (March 7, 2026)

### Player Discount System + Duplicate Cart Messages Fix

- Player discount column on both admin player pages (inline AJAX editing)
- `DiscountOrderProcessor` applies percentage discount during checkout (before credits)
- 100% discount checkout flow working ($0 orders complete successfully)
- Duplicate "added to cart" status messages removed across 5 files

### Previous Session (March 4, 2026)

- Home page League/Tournament cards — images added via `picture` field on Tournament entity

---

## Files Modified This Session

### New Files
| File | Purpose |
|------|---------|
| `web/themes/custom/ccsoccer_theme/templates/menu-local-tasks.html.twig` | Tab container template — wraps primary/secondary tabs in pill-style nav |
| `web/themes/custom/ccsoccer_theme/templates/menu-local-task.html.twig` | Individual tab item template with active state class |
| `web/themes/custom/ccsoccer_theme/css/user-pages.css` | All user profile page styles: tabs, profile view, edit form, payment methods, Commerce orders |

### Modified Files
| File | Changes |
|------|---------|
| `web/modules/custom/ccsoccer/src/Controller/ContentController.php` | `registerConfirmPage()` restyled with card pattern; `myOrders()` replaced redirect with custom order query + styled table |
| `web/modules/custom/ccsoccer/css/content-pages.css` | Registration confirm CSS rewritten to match checkout-complete pattern; new My Orders table styles with card wrap, state badges, mobile stacking |
| `web/modules/custom/ccsoccer/css/checkout.css` | Added billing address overflow prevention for mobile; form inputs/containers constrained to viewport; address rows stack on small screens |
| `web/themes/custom/ccsoccer_theme/ccsoccer_theme.libraries.yml` | Added `css/user-pages.css` to global library |
| `web/themes/custom/ccsoccer_theme/css/layout.css` | Added `overflow-x: hidden` on `html` and `body` to prevent horizontal scroll |

---

## Remaining Work

### Recently Completed
- [x] My Orders page — custom styled controller
- [x] Registration confirmation page — restyled to match checkout complete
- [x] User profile local task tabs — pill-style navigation
- [x] User edit form — basic styling (max-width, labels, save button)
- [x] Mobile checkout overflow — billing address no longer breaks viewport

### Known Limitation
- [ ] `/user/{uid}/orders` Commerce Views table CSS didn't take effect (selectors don't match Drupal's actual output). Low priority — users access `/my-orders` from menu instead.

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

### Inner Page Styling
- [ ] Credits page
- [ ] Purchase Jerseys page
- [ ] Group management page

### Forms
- [ ] Registration form inputs, buttons, visual 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
