style: apply prettier formatting
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
<div class="checkout-page">
|
||||
<div class="container hero">
|
||||
<h1 class="section-title">{{ 'CHECKOUT.TITLE' | translate }}</h1>
|
||||
<h1 class="section-title">{{ "CHECKOUT.TITLE" | translate }}</h1>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container">
|
||||
<div class="checkout-layout">
|
||||
|
||||
<!-- LEFT COLUMN: Form -->
|
||||
<div class="checkout-form-section">
|
||||
<!-- Error Message -->
|
||||
@@ -14,50 +13,105 @@
|
||||
</div>
|
||||
|
||||
<form [formGroup]="checkoutForm" (ngSubmit)="onSubmit()" *ngIf="!error">
|
||||
|
||||
<!-- Contact Info Card -->
|
||||
<app-card class="mb-6">
|
||||
<div class="card-header-simple">
|
||||
<h3>{{ 'CHECKOUT.CONTACT_INFO' | translate }}</h3>
|
||||
<h3>{{ "CHECKOUT.CONTACT_INFO" | translate }}</h3>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<app-input formControlName="email" type="email" [label]="'CHECKOUT.EMAIL' | translate" [required]="true" [error]="checkoutForm.get('email')?.hasError('email') ? ('CHECKOUT.INVALID_EMAIL' | translate) : null"></app-input>
|
||||
<app-input formControlName="phone" type="tel" [label]="'CHECKOUT.PHONE' | translate" [required]="true"></app-input>
|
||||
<app-input
|
||||
formControlName="email"
|
||||
type="email"
|
||||
[label]="'CHECKOUT.EMAIL' | translate"
|
||||
[required]="true"
|
||||
[error]="
|
||||
checkoutForm.get('email')?.hasError('email')
|
||||
? ('CHECKOUT.INVALID_EMAIL' | translate)
|
||||
: null
|
||||
"
|
||||
></app-input>
|
||||
<app-input
|
||||
formControlName="phone"
|
||||
type="tel"
|
||||
[label]="'CHECKOUT.PHONE' | translate"
|
||||
[required]="true"
|
||||
></app-input>
|
||||
</div>
|
||||
</app-card>
|
||||
|
||||
<!-- Billing Address Card -->
|
||||
<app-card class="mb-6">
|
||||
<div class="card-header-simple">
|
||||
<h3>{{ 'CHECKOUT.BILLING_ADDR' | translate }}</h3>
|
||||
<h3>{{ "CHECKOUT.BILLING_ADDR" | translate }}</h3>
|
||||
</div>
|
||||
<div formGroupName="billingAddress">
|
||||
<!-- User Type Selector -->
|
||||
<app-toggle-selector class="mb-4 user-type-selector-compact"
|
||||
<app-toggle-selector
|
||||
class="mb-4 user-type-selector-compact"
|
||||
[options]="userTypeOptions"
|
||||
[selectedValue]="checkoutForm.get('customerType')?.value"
|
||||
(selectionChange)="setCustomerType($event)">
|
||||
(selectionChange)="setCustomerType($event)"
|
||||
>
|
||||
</app-toggle-selector>
|
||||
|
||||
|
||||
<!-- Private Person Fields -->
|
||||
<div *ngIf="!isCompany" class="form-row">
|
||||
<app-input formControlName="firstName" [label]="'CHECKOUT.FIRST_NAME' | translate" [required]="true"></app-input>
|
||||
<app-input formControlName="lastName" [label]="'CHECKOUT.LAST_NAME' | translate" [required]="true"></app-input>
|
||||
<app-input
|
||||
formControlName="firstName"
|
||||
[label]="'CHECKOUT.FIRST_NAME' | translate"
|
||||
[required]="true"
|
||||
></app-input>
|
||||
<app-input
|
||||
formControlName="lastName"
|
||||
[label]="'CHECKOUT.LAST_NAME' | translate"
|
||||
[required]="true"
|
||||
></app-input>
|
||||
</div>
|
||||
|
||||
<!-- Company Fields -->
|
||||
<div *ngIf="isCompany" class="company-fields mb-4">
|
||||
<app-input formControlName="companyName" [label]="'CHECKOUT.COMPANY_NAME' | translate" [required]="true" [placeholder]="'CONTACT.PLACEHOLDER_COMPANY' | translate"></app-input>
|
||||
<app-input formControlName="referencePerson" [label]="'CONTACT.REF_PERSON' | translate" [required]="true" [placeholder]="'CONTACT.PLACEHOLDER_REF_PERSON' | translate"></app-input>
|
||||
<app-input
|
||||
formControlName="companyName"
|
||||
[label]="'CHECKOUT.COMPANY_NAME' | translate"
|
||||
[required]="true"
|
||||
[placeholder]="'CONTACT.PLACEHOLDER_COMPANY' | translate"
|
||||
></app-input>
|
||||
<app-input
|
||||
formControlName="referencePerson"
|
||||
[label]="'CONTACT.REF_PERSON' | translate"
|
||||
[required]="true"
|
||||
[placeholder]="'CONTACT.PLACEHOLDER_REF_PERSON' | translate"
|
||||
></app-input>
|
||||
</div>
|
||||
|
||||
<app-input formControlName="addressLine1" [label]="'CHECKOUT.ADDRESS_1' | translate" [required]="true"></app-input>
|
||||
<app-input formControlName="addressLine2" [label]="'CHECKOUT.ADDRESS_2' | translate"></app-input>
|
||||
|
||||
<app-input
|
||||
formControlName="addressLine1"
|
||||
[label]="'CHECKOUT.ADDRESS_1' | translate"
|
||||
[required]="true"
|
||||
></app-input>
|
||||
<app-input
|
||||
formControlName="addressLine2"
|
||||
[label]="'CHECKOUT.ADDRESS_2' | translate"
|
||||
></app-input>
|
||||
|
||||
<div class="form-row three-cols">
|
||||
<app-input formControlName="zip" [label]="'CHECKOUT.ZIP' | translate" [required]="true"></app-input>
|
||||
<app-input formControlName="city" [label]="'CHECKOUT.CITY' | translate" class="city-field" [required]="true"></app-input>
|
||||
<app-input formControlName="countryCode" [label]="'CHECKOUT.COUNTRY' | translate" [disabled]="true" [required]="true"></app-input>
|
||||
<app-input
|
||||
formControlName="zip"
|
||||
[label]="'CHECKOUT.ZIP' | translate"
|
||||
[required]="true"
|
||||
></app-input>
|
||||
<app-input
|
||||
formControlName="city"
|
||||
[label]="'CHECKOUT.CITY' | translate"
|
||||
class="city-field"
|
||||
[required]="true"
|
||||
></app-input>
|
||||
<app-input
|
||||
formControlName="countryCode"
|
||||
[label]="'CHECKOUT.COUNTRY' | translate"
|
||||
[disabled]="true"
|
||||
[required]="true"
|
||||
></app-input>
|
||||
</div>
|
||||
</div>
|
||||
</app-card>
|
||||
@@ -65,60 +119,108 @@
|
||||
<!-- Shipping Option -->
|
||||
<div class="shipping-option">
|
||||
<label class="checkbox-container">
|
||||
<input type="checkbox" formControlName="shippingSameAsBilling">
|
||||
<input type="checkbox" formControlName="shippingSameAsBilling" />
|
||||
<span class="checkmark"></span>
|
||||
{{ 'CHECKOUT.SHIPPING_SAME' | translate }}
|
||||
{{ "CHECKOUT.SHIPPING_SAME" | translate }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<!-- Shipping Address Card (Conditional) -->
|
||||
<app-card *ngIf="!checkoutForm.get('shippingSameAsBilling')?.value" class="mb-6">
|
||||
<div class="card-header-simple">
|
||||
<h3>{{ 'CHECKOUT.SHIPPING_ADDR' | translate }}</h3>
|
||||
<app-card
|
||||
*ngIf="!checkoutForm.get('shippingSameAsBilling')?.value"
|
||||
class="mb-6"
|
||||
>
|
||||
<div class="card-header-simple">
|
||||
<h3>{{ "CHECKOUT.SHIPPING_ADDR" | translate }}</h3>
|
||||
</div>
|
||||
<div formGroupName="shippingAddress">
|
||||
<div class="form-row">
|
||||
<app-input formControlName="firstName" [label]="'CHECKOUT.FIRST_NAME' | translate"></app-input>
|
||||
<app-input formControlName="lastName" [label]="'CHECKOUT.LAST_NAME' | translate"></app-input>
|
||||
</div>
|
||||
|
||||
<div *ngIf="isCompany" class="company-fields">
|
||||
<app-input formControlName="companyName" [label]="'CHECKOUT.COMPANY_OPTIONAL' | translate"></app-input>
|
||||
<app-input formControlName="referencePerson" [label]="'CHECKOUT.REF_PERSON_OPTIONAL' | translate"></app-input>
|
||||
<div class="form-row">
|
||||
<app-input
|
||||
formControlName="firstName"
|
||||
[label]="'CHECKOUT.FIRST_NAME' | translate"
|
||||
></app-input>
|
||||
<app-input
|
||||
formControlName="lastName"
|
||||
[label]="'CHECKOUT.LAST_NAME' | translate"
|
||||
></app-input>
|
||||
</div>
|
||||
|
||||
<app-input formControlName="addressLine1" [label]="'CHECKOUT.ADDRESS_1' | translate"></app-input>
|
||||
|
||||
<div *ngIf="isCompany" class="company-fields">
|
||||
<app-input
|
||||
formControlName="companyName"
|
||||
[label]="'CHECKOUT.COMPANY_OPTIONAL' | translate"
|
||||
></app-input>
|
||||
<app-input
|
||||
formControlName="referencePerson"
|
||||
[label]="'CHECKOUT.REF_PERSON_OPTIONAL' | translate"
|
||||
></app-input>
|
||||
</div>
|
||||
|
||||
<app-input
|
||||
formControlName="addressLine1"
|
||||
[label]="'CHECKOUT.ADDRESS_1' | translate"
|
||||
></app-input>
|
||||
|
||||
<div class="form-row three-cols">
|
||||
<app-input formControlName="zip" [label]="'CHECKOUT.ZIP' | translate"></app-input>
|
||||
<app-input formControlName="city" [label]="'CHECKOUT.CITY' | translate" class="city-field"></app-input>
|
||||
<app-input formControlName="countryCode" [label]="'CHECKOUT.COUNTRY' | translate" [disabled]="true"></app-input>
|
||||
<app-input
|
||||
formControlName="zip"
|
||||
[label]="'CHECKOUT.ZIP' | translate"
|
||||
></app-input>
|
||||
<app-input
|
||||
formControlName="city"
|
||||
[label]="'CHECKOUT.CITY' | translate"
|
||||
class="city-field"
|
||||
></app-input>
|
||||
<app-input
|
||||
formControlName="countryCode"
|
||||
[label]="'CHECKOUT.COUNTRY' | translate"
|
||||
[disabled]="true"
|
||||
></app-input>
|
||||
</div>
|
||||
</div>
|
||||
</app-card>
|
||||
|
||||
<div class="legal-consent">
|
||||
<label class="checkbox-container">
|
||||
<input type="checkbox" formControlName="acceptLegal">
|
||||
<input type="checkbox" formControlName="acceptLegal" />
|
||||
<span class="checkmark"></span>
|
||||
<span>
|
||||
{{ 'LEGAL.CONSENT.LABEL_PREFIX' | translate }}
|
||||
<a href="/terms" target="_blank" rel="noopener">{{ 'LEGAL.CONSENT.TERMS_LINK' | translate }}</a>
|
||||
{{ 'LEGAL.CONSENT.AND' | translate }}
|
||||
<a href="/privacy" target="_blank" rel="noopener">{{ 'LEGAL.CONSENT.PRIVACY_LINK' | translate }}</a>.
|
||||
{{ "LEGAL.CONSENT.LABEL_PREFIX" | translate }}
|
||||
<a href="/terms" target="_blank" rel="noopener">{{
|
||||
"LEGAL.CONSENT.TERMS_LINK" | translate
|
||||
}}</a>
|
||||
{{ "LEGAL.CONSENT.AND" | translate }}
|
||||
<a href="/privacy" target="_blank" rel="noopener">{{
|
||||
"LEGAL.CONSENT.PRIVACY_LINK" | translate
|
||||
}}</a
|
||||
>.
|
||||
</span>
|
||||
</label>
|
||||
<div class="consent-error" *ngIf="checkoutForm.get('acceptLegal')?.invalid && checkoutForm.get('acceptLegal')?.touched">
|
||||
{{ 'LEGAL.CONSENT.REQUIRED_ERROR' | translate }}
|
||||
<div
|
||||
class="consent-error"
|
||||
*ngIf="
|
||||
checkoutForm.get('acceptLegal')?.invalid &&
|
||||
checkoutForm.get('acceptLegal')?.touched
|
||||
"
|
||||
>
|
||||
{{ "LEGAL.CONSENT.REQUIRED_ERROR" | translate }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<app-button type="submit" [disabled]="checkoutForm.invalid || isSubmitting()" [fullWidth]="true">
|
||||
{{ (isSubmitting() ? 'CHECKOUT.PROCESSING' : 'CHECKOUT.PLACE_ORDER') | translate }}
|
||||
<app-button
|
||||
type="submit"
|
||||
[disabled]="checkoutForm.invalid || isSubmitting()"
|
||||
[fullWidth]="true"
|
||||
>
|
||||
{{
|
||||
(isSubmitting()
|
||||
? "CHECKOUT.PROCESSING"
|
||||
: "CHECKOUT.PLACE_ORDER"
|
||||
) | translate
|
||||
}}
|
||||
</app-button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -126,53 +228,60 @@
|
||||
<div class="checkout-summary-section">
|
||||
<app-card class="sticky-card">
|
||||
<div class="card-header-simple">
|
||||
<h3>{{ 'CHECKOUT.SUMMARY_TITLE' | translate }}</h3>
|
||||
<h3>{{ "CHECKOUT.SUMMARY_TITLE" | translate }}</h3>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="summary-items" *ngIf="quoteSession() as session">
|
||||
<div class="summary-item" *ngFor="let item of session.items">
|
||||
<div class="item-details">
|
||||
<span class="item-name">{{ item.originalFilename }}</span>
|
||||
<div class="item-specs">
|
||||
<span>{{ 'CHECKOUT.QTY' | translate }}: {{ item.quantity }}</span>
|
||||
<span *ngIf="item.colorCode" class="color-dot" [style.background-color]="item.colorCode"></span>
|
||||
</div>
|
||||
<div class="item-specs-sub">
|
||||
{{ (item.printTimeSeconds / 3600) | number:'1.1-1' }}h | {{ item.materialGrams | number:'1.0-0' }}g
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-price">
|
||||
<span class="item-total-price">
|
||||
{{ (item.unitPriceChf * item.quantity) | currency:'CHF' }}
|
||||
</span>
|
||||
<small class="item-unit-price" *ngIf="item.quantity > 1">
|
||||
{{ item.unitPriceChf | currency:'CHF' }} {{ 'CHECKOUT.PER_PIECE' | translate }}
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="summary-item" *ngFor="let item of session.items">
|
||||
<div class="item-details">
|
||||
<span class="item-name">{{ item.originalFilename }}</span>
|
||||
<div class="item-specs">
|
||||
<span
|
||||
>{{ "CHECKOUT.QTY" | translate }}: {{ item.quantity }}</span
|
||||
>
|
||||
<span
|
||||
*ngIf="item.colorCode"
|
||||
class="color-dot"
|
||||
[style.background-color]="item.colorCode"
|
||||
></span>
|
||||
</div>
|
||||
<div class="item-specs-sub">
|
||||
{{ item.printTimeSeconds / 3600 | number: "1.1-1" }}h |
|
||||
{{ item.materialGrams | number: "1.0-0" }}g
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-price">
|
||||
<span class="item-total-price">
|
||||
{{ item.unitPriceChf * item.quantity | currency: "CHF" }}
|
||||
</span>
|
||||
<small class="item-unit-price" *ngIf="item.quantity > 1">
|
||||
{{ item.unitPriceChf | currency: "CHF" }}
|
||||
{{ "CHECKOUT.PER_PIECE" | translate }}
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="summary-totals" *ngIf="quoteSession() as session">
|
||||
<div class="total-row">
|
||||
<span>{{ 'CHECKOUT.SUBTOTAL' | translate }}</span>
|
||||
<span>{{ session.itemsTotalChf | currency:'CHF' }}</span>
|
||||
<span>{{ "CHECKOUT.SUBTOTAL" | translate }}</span>
|
||||
<span>{{ session.itemsTotalChf | currency: "CHF" }}</span>
|
||||
</div>
|
||||
<div class="total-row">
|
||||
<span>{{ 'CHECKOUT.SETUP_FEE' | translate }}</span>
|
||||
<span>{{ session.session.setupCostChf | currency:'CHF' }}</span>
|
||||
<span>{{ "CHECKOUT.SETUP_FEE" | translate }}</span>
|
||||
<span>{{ session.session.setupCostChf | currency: "CHF" }}</span>
|
||||
</div>
|
||||
<div class="total-row">
|
||||
<span>{{ 'CHECKOUT.SHIPPING' | translate }}</span>
|
||||
<span>{{ session.shippingCostChf | currency:'CHF' }}</span>
|
||||
<span>{{ "CHECKOUT.SHIPPING" | translate }}</span>
|
||||
<span>{{ session.shippingCostChf | currency: "CHF" }}</span>
|
||||
</div>
|
||||
<div class="grand-total">
|
||||
<span>{{ 'CHECKOUT.TOTAL' | translate }}</span>
|
||||
<span>{{ session.grandTotalChf | currency:'CHF' }}</span>
|
||||
<span>{{ "CHECKOUT.TOTAL" | translate }}</span>
|
||||
<span>{{ session.grandTotalChf | currency: "CHF" }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</app-card>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user