Files
wc-bootstrap/templates/auth/form-login.html.twig
magdev 49b1d52701 Implement Phase 9 & reusable components; skip Phase 8 (emails)
Phase 8 (Emails) skipped: WooCommerce email rendering uses
wc_get_template_html() which bypasses the Twig pipeline entirely.
Email customization deferred to plugins or block email editor.

Phase 9 - Supplementary (7 templates):
- Brand description with thumbnail, taxonomy archive delegate
- Brands A-Z shortcode with alphabetical index navigation
- Single brand thumbnail shortcode
- REST API OAuth login and grant-access forms
- Back-in-stock notification form with email input

Reusable Components (6 templates):
- price: product price display with sale handling
- rating: star rating with Bootstrap Icons (filled/half/empty)
- address-card: billing/shipping address card with edit link
- status-badge: contextual order status badges
- quantity-input: +/- input group widget
- form-field: universal form field renderer (text/select/textarea/checkbox)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 10:53:44 +01:00

70 lines
2.2 KiB
Twig

{#
# REST API Auth Login Form (Bootstrap 5 Override)
#
# Login form for third-party app OAuth authentication.
# Rendered outside the WordPress theme (standalone page).
#
# Expected context:
# app_name - Name of the requesting application
# return_url - URL to return to on cancel
# redirect_url - URL to redirect to after login
#
# WooCommerce PHP equivalent: auth/form-login.php
#
# @package WcBootstrap
# @since 0.1.0
#}
{{ do_action('woocommerce_auth_page_header') }}
<h1 class="h3 mb-4">
{{ __('%s would like to connect to your store')|format(app_name|esc_html) }}
</h1>
{{ wc_print_notices() }}
<p class="mb-4">
{{ __('To connect to %1$s you need to be logged in. Log in to your store below, or <a href="%2$s">cancel and return to %1$s</a>')|format(app_name|esc_html, return_url|esc_url)|wp_kses_post }}
</p>
<form method="post" class="wc-auth-login">
<div class="mb-3">
<label for="username" class="form-label">
{{ __('Username or email address') }}&nbsp;<span class="text-danger" aria-hidden="true">*</span>
<span class="visually-hidden">{{ __('Required') }}</span>
</label>
<input type="text"
class="form-control"
name="username"
id="username"
required
aria-required="true" />
</div>
<div class="mb-3">
<label for="password" class="form-label">
{{ __('Password') }}&nbsp;<span class="text-danger" aria-hidden="true">*</span>
<span class="visually-hidden">{{ __('Required') }}</span>
</label>
<input type="password"
class="form-control"
name="password"
id="password"
required
aria-required="true" />
</div>
<div class="mt-3">
{{ wp_nonce_field('woocommerce-login', 'woocommerce-login-nonce') }}
<button type="submit"
class="btn btn-primary btn-lg"
name="login"
value="{{ __('Login') }}">
{{ __('Login') }}
</button>
<input type="hidden" name="redirect" value="{{ redirect_url|esc_url }}" />
</div>
</form>
{{ do_action('woocommerce_auth_page_footer') }}