Files
wc-bootstrap/templates/global/form-login.html.twig
magdev 6ee95f4a2f
All checks were successful
Create Release Package / PHP Lint (push) Successful in 57s
Create Release Package / Build Release (push) Successful in 1m11s
Fix template quirks and bump version to 0.1.0
Audit and fix 14 Twig templates for escaping bugs, CSS conflicts,
and missing Bootstrap styling:
- Fix nl2br/esc_html filter order in order details
- Add WC gallery modifier classes for zoom/photoswipe JS init
- Fix HTML entity double-encoding in headings (up-sells, cross-sells, related)
- Remove wrong 'is defined' guards on function calls
- Remove duplicate deprecated hooks in dashboard
- Add |raw to brand description HTML filter chain
- Add role="alert" for accessibility, |esc_attr on notification types
- Style mini-cart remove button as Bootstrap btn
- Make shipping form-check class conditional
- Add shop_table CSS reset and gallery opacity fallback

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 18:50:19 +01:00

90 lines
3.2 KiB
Twig

{#
# Global Login Form (Bootstrap 5 Override)
#
# Inline login form used on checkout and other pages (not the My Account login).
# Can be initially hidden and toggled via a link.
#
# Expected context (from WooCommerce wc_get_template('global/form-login.php')):
# hidden - Whether form is initially hidden (boolean)
# message - Optional message to display above the form
# redirect - URL to redirect after login
#
# WooCommerce PHP equivalent: global/form-login.php
#
# @package WcBootstrap
# @since 0.1.0
#}
{% if not is_user_logged_in() %}
<form class="woocommerce-form woocommerce-form-login login{% if hidden is defined and hidden %} d-none{% endif %}" method="post">
{{ do_action('woocommerce_login_form_start') }}
{% if message %}
<div class="mb-3">
{{ message|wpautop }}
</div>
{% endif %}
<div class="row g-3 mb-3">
<div class="col-sm-6">
<label for="username" class="form-label">
{{ __('Username or email') }}&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"
autocomplete="username"
required
aria-required="true" />
</div>
<div class="col-sm-6">
<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"
autocomplete="current-password"
required
aria-required="true" />
</div>
</div>
{{ do_action('woocommerce_login_form') }}
<div class="d-flex align-items-center justify-content-between flex-wrap gap-2">
<div class="form-check">
<input class="form-check-input"
type="checkbox"
name="rememberme"
id="rememberme"
value="forever" />
<label class="form-check-label" for="rememberme">
{{ __('Remember me') }}
</label>
</div>
{{ wp_nonce_field('woocommerce-login', 'woocommerce-login-nonce') }}
<input type="hidden" name="redirect" value="{{ redirect|esc_url }}" />
<button type="submit"
class="btn btn-primary"
name="login"
value="{{ __('Login') }}">
{{ __('Login') }}
</button>
</div>
<p class="mt-3 mb-0">
<a href="{{ wp_lostpassword_url()|esc_url }}">{{ __('Lost your password?') }}</a>
</p>
{{ do_action('woocommerce_login_form_end') }}
</form>
{% endif %}