Skip to content

Replace - Inputs & buttons from blade-components #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/translations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Check translations

on:
push:
branches:
- master
- '*.x'
pull_request:

jobs:
translations:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
- name: Install dependencies
run: composer install --prefer-dist --no-interaction
- name: Check translations
uses: rapidez/laravel-translation-checker@master
49 changes: 49 additions & 0 deletions lang/nl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"Account information": "Account informatie",
"Account overview": "Account overzicht",
"Add billing address": "Factuuradres toevoegen",
"Add new address": "Nieuw adres toevoegen",
"Add shipping address": "Verzendadres toevoegen",
"Additional address entries": "Extra adressen",
"Address": "Adres",
"Addresses": "Adressen",
"Change": "Wijzigen",
"Change billing address": "Factuuradres wijzigen",
"Change email": "E-mail wijzigen",
"Change password": "Wachtwoord wijzigen",
"Change shipping address": "Verzendadres wijzigen",
"Changed successfully!": "Succesvol gewijzigd!",
"Contact information": "Contactgegevens",
"Current password": "Huidig wachtwoord",
"Date": "Datum",
"Default address": "Standaard adres",
"Default addresses": "Standaard adressen",
"Default billing address": "Standaard factuuradres",
"Default shipping address": "Standaard verzendadres",
"Delete": "Verwijderen",
"Edit": "Wijzigen",
"Edit account": "Account informatie wijzigen",
"Grand Total": "Totaal",
"Latest orders": "Laatste bestellingen",
"Name": "Naam",
"New password": "Nieuw wachtwoord",
"Order": "Bestelling",
"Order #": "Bestelnummer",
"Order information": "Bestel informatie",
"Order total": "Bestelbedrag",
"Overview": "Overzicht",
"Phone": "Telefoonnummer",
"Price": "Prijs",
"Product name": "Productnaam",
"QTY": "Aantal",
"Register": "Registreren",
"Register your account": "Account aanmaken",
"Reorder": "Opnieuw bestellen",
"Reset password": "Wachtwoord resetten",
"Ship to": "Verzend naar",
"Shipping & Handling": "Verzendkosten",
"SKU": "SKU",
"Status": "Status",
"Tax/VAT ID": "BTW-nummer",
"Your password has been changed, please login.": "Je wachtwoord is gewijzigd, log nu in."
}
12 changes: 6 additions & 6 deletions resources/views/account/addresses.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
@include('rapidez::account.partials.default-addresses', ['edit' => true])

<div :set="data.customer.additionalAddresses = data.customer.addresses.filter(a => a.default_billing == false && a.default_shipping == false)">
<h2 class="mt-2 mb-2 text-2xl font-bold">@lang('Additional Address Entries')</h2>
<h2 class="mt-2 mb-2 text-2xl font-bold">@lang('Additional address entries')</h2>
<div v-if="data.customer.additionalAddresses.length">
<table class="w-full table-auto text-left text-gray-700 -mx-4">
<table class="w-full table-auto text-left -mx-4">
<thead>
<tr>
<th class="px-4">@lang('Firstname')</th>
Expand All @@ -22,7 +22,7 @@
@endif
<th class="px-4">@lang('Lastname')</th>
<th class="px-4">@lang('Address')</th>
<th class="px-4">@lang('Zipcode')</th>
<th class="px-4">@lang('Postcode')</th>
<th class="px-4">@lang('City')</th>
<th class="px-4">@lang('Country')</th>
<th class="px-4">@lang('Phone')</th>
Expand Down Expand Up @@ -62,13 +62,13 @@
</tbody>
</table>
</div>
<div v-else class="text-gray-700">
<div v-else>
@lang('You have no other address entries in your address book.')
</div>

<x-rapidez::button :href="route('account.address.create')" class="mt-5">
<x-rapidez::button.secondary :href="route('account.address.create')" class="mt-5">
@lang('Add new address')
</x-rapidez::button>
</x-rapidez::button.secondary>
</div>
</div>
</graphql>
Expand Down
7 changes: 4 additions & 3 deletions resources/views/account/forgotpassword.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@
:notify="{ message: '@lang('An email is send with a password reset link if an account exists with the provided email address.')' }"
>
<div class="flex flex-col items-center" slot-scope="{ mutate, variables }">
<div class="flex flex-col items-center rounded bg-highlight mt-3.5 max-w-lg w-full">
<div class="flex flex-col items-center rounded bg mt-3.5 max-w-lg w-full">
<h1 class="mt-8 text-3xl font-bold px-8">@lang('Forgot Your Password?')</h1>
<form v-on:submit.prevent="mutate" class="flex w-full flex-col gap-3 p-8">
<x-rapidez::input
name="email"
type="email"
:placeholder="__('Email')"
v-model="variables.email"
required
/>

<x-rapidez::button type="submit" class="mt-2">
<x-rapidez::button.secondary type="submit" class="mt-2">
@lang('Reset password')
</x-rapidez::button>
</x-rapidez::button.secondary>
</form>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions resources/views/account/order.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<graphql query='@include('rapidez::account.partials.queries.order')' :variables="{orderNumber: '{{ request()->id }}'}" check="customer.orders.items[0]" redirect="{{ route('account.orders') }}">
<div v-if="data" slot-scope="{ data }">
<div class="overflow-auto max-w-full">
<table class="text-left text-gray-700">
<table class="text-left">
<thead>
<tr>
<th class="px-4 py-2">@lang('Product name')</th>
Expand Down Expand Up @@ -48,7 +48,7 @@
<div class="flex flex-wrap">
<div class="w-full sm:w-1/2 lg:w-1/4 mt-3" v-if="shipping = data.customer.orders.items[0].shipping_address">
<h3 class="font-bold text-xl">@lang('Shipping address')</h3>
<div class="text-gray-700">
<div>
@{{ shipping.firstname }} @{{ shipping.lastname }}<br>
@{{ shipping.street[0] }} @{{ shipping.street[1] }}<br>
@{{ shipping.postcode }} @{{ shipping.city }}<br>
Expand All @@ -58,13 +58,13 @@
</div>
<div class="w-full sm:w-1/2 lg:w-1/4 mt-3" v-if="data.customer.orders.items[0].shipping_method">
<h3 class="font-bold text-xl">@lang('Shipping method')</h3>
<div class="text-gray-700">
<div>
@{{ data.customer.orders.items[0].shipping_method }}
</div>
</div>
<div class="w-full sm:w-1/2 lg:w-1/4 mt-3">
<h3 class="font-bold text-xl">@lang('Billing address')</h3>
<div class="text-gray-700">
<div>
@{{ (billing = data.customer.orders.items[0].billing_address).firstname }} @{{ billing.lastname }}<br>
@{{ billing.street[0] }} @{{ billing.street[1] }}<br>
@{{ billing.postcode }} @{{ billing.city }}<br>
Expand All @@ -74,7 +74,7 @@
</div>
<div class="w-full sm:w-1/2 lg:w-1/4 mt-3">
<h3 class="font-bold text-xl">@lang('Payment method')</h3>
<div class="text-gray-700">
<div>
@{{ data.customer.orders.items[0].payment_methods[0].name }}
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions resources/views/account/overview.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<graphql query="@include('rapidez::account.partials.queries.overview')" :callback="sortOrdersCallback">
<div class="flex flex-col gap-4" v-if="data" slot-scope="{ data }">
<div>
<h2 class="text-2xl font-bold text-neutral">@lang('Account information')</h2>
<div class="text-inactive">
<span class="font-bold text-neutral">@lang('Name'):</span> @{{ data.customer.firstname }} @{{ data.customer.lastname }}<br>
<span class="font-bold text-neutral">@lang('E-mail'):</span> @{{ data.customer.email }}
<h2 class="text-2xl font-bold">@lang('Account information')</h2>
<div class="text-muted">
<span class="font-bold text">@lang('Name'):</span> @{{ data.customer.firstname }} @{{ data.customer.lastname }}<br>
<span class="font-bold text">@lang('Email'):</span> @{{ data.customer.email }}
</div>
</div>
<div>
Expand Down
117 changes: 74 additions & 43 deletions resources/views/account/partials/address-form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,98 +2,129 @@
<div class="grid grid-cols-12 gap-4">
<h2 class="col-span-12 font-bold text-2xl">@lang('Contact information')</h2>
<div class="col-span-12 sm:col-span-6">
<x-rapidez::input name="firstname" v-model="variables.firstname" label="Firstname" required />
<label>
<x-rapidez::label>@lang('Firstname')</x-rapidez::label>
<x-rapidez::input name="firstname" v-model="variables.firstname" required />
</label>
</div>
@if(Rapidez::config('customer/address/middlename_show', 0))
<div class="col-span-12 sm:col-span-6">
<x-rapidez::input name="middlename" v-model="variables.middlename" label="Middlename" />
<label>
<x-rapidez::label>@lang('Middlename')</x-rapidez::label>
<x-rapidez::input name="middlename" v-model="variables.middlename" />
</label>
</div>
@endif
<div class="col-span-12 sm:col-span-6">
<x-rapidez::input name="lastname" v-model="variables.lastname" label="Lastname" required />
<label>
<x-rapidez::label>@lang('Lastname')</x-rapidez::label>
<x-rapidez::input name="lastname" v-model="variables.lastname" required />
</label>
</div>

<div class="col-span-12 sm:col-span-6">
@if(Rapidez::config('customer/address/company_show', 'opt'))
<x-rapidez::input name="company" v-model="variables.company" label="Company" :required="Rapidez::config('customer/address/company_show', 'opt') == 'req'" />
<label>
<x-rapidez::label>@lang('Company')</x-rapidez::label>
<x-rapidez::input name="company" v-model="variables.company" :required="Rapidez::config('customer/address/company_show', 'opt') == 'req'" />
</label>
@endif
</div>

<div class="col-span-12 sm:col-span-6">
@if(Rapidez::config('customer/address/taxvat_show', 0))
<x-rapidez::input
name="vat_id"
label="Tax/VAT ID"
placeholder="Tax/VAT ID"
v-model="variables.vat_id"
v-on:change="window.app.$emit('vat-change', $event)"
:required="Rapidez::config('customer/address/taxvat_show', '0') == 'req'"
/>
<label>
<x-rapidez::label>@lang('Tax/VAT ID')</x-rapidez::label>
<x-rapidez::input
name="vat_id"
v-model="variables.vat_id"
v-on:change="window.app.$emit('vat-change', $event)"
:required="Rapidez::config('customer/address/taxvat_show', '0') == 'req'"
/>
</label>
@endif
@if(Rapidez::config('customer/address/telephone_show', 'req'))
<x-rapidez::input name="telephone" v-model="variables.telephone" label="Telephone" :required="Rapidez::config('customer/address/telephone_show', 'req') == 'req'" />
<label>
<x-rapidez::label>@lang('Telephone')</x-rapidez::label>
<x-rapidez::input name="telephone" v-model="variables.telephone" :required="Rapidez::config('customer/address/telephone_show', 'req') == 'req'" />
</label>
@endif
</div>

<h2 class="col-span-12 font-bold text-2xl mt-2">@lang('Address')</h2>
<div class="col-span-12 sm:col-span-4">
<x-rapidez::input name="street[0]" v-model="variables.street[0]" label="Street" placeholder="Street" required />
<label>
<x-rapidez::label>@lang('Street')</x-rapidez::label>
<x-rapidez::input name="street[0]" v-model="variables.street[0]" required />
</label>
</div>
<div class="col-span-12 sm:col-span-4">
@if(Rapidez::config('customer/address/street_lines', 2) >= 2)
<x-rapidez::input
name="street[1]"
v-model="variables.street[1]"
v-on:change="window.app.$emit('postcode-change', variables)"
label="Housenumber"
placeholder="Nr."
/>
<label>
<x-rapidez::label>@lang('Housenumber')</x-rapidez::label>
<x-rapidez::input
name="street[1]"
v-model="variables.street[1]"
v-on:change="window.app.$emit('postcode-change', variables)"
required
/>
</label>
@endif
</div>
<div class="col-span-12 sm:col-span-4">
@if(Rapidez::config('customer/address/street_lines', 2) >= 3)
<x-rapidez::input name="street[2]" v-model="variables.street[2]" label="Addition" placeholder="Nr." />
<label>
<x-rapidez::label>@lang('Addition')</x-rapidez::label>
<x-rapidez::input name="street[2]" v-model="variables.street[2]" />
</label>
@endif
</div>
@if(Rapidez::config('customer/address/street_lines', 2) >= 4)
<div class="col-span-12 sm:col-span-4">
<x-rapidez::input name="street[3]" v-model="variables.street[3]" label="" placeholder="" />
<x-rapidez::input name="street[3]" v-model="variables.street[3]" />
</div>
@endif
<div class="col-span-12 sm:col-span-4">
<x-rapidez::input
name="postcode"
v-model="variables.postcode"
v-on:change="window.app.$emit('postcode-change', variables)"
label="Postcode"
required
/>
<label>
<x-rapidez::label>@lang('Postcode')</x-rapidez::label>
<x-rapidez::input
name="postcode"
v-model="variables.postcode"
v-on:change="window.app.$emit('postcode-change', variables)"
required
/>
</label>
</div>
<div class="col-span-12 sm:col-span-4">
<x-rapidez::input name="city" v-model="variables.city" label="City" required />
<label>
<x-rapidez::label>@lang('City')</x-rapidez::label>
<x-rapidez::input name="city" v-model="variables.city" required />
</label>
</div>
<div class="col-span-12 sm:col-span-4">
<x-rapidez::country-select
name="country_code"
label="Country"
v-model="variables.country_code"
v-on:change="window.app.$emit('postcode-change', variables)"
class="w-full"
required
/>
<label>
<x-rapidez::label>@lang('Country')</x-rapidez::label>
<x-rapidez::country-select
name="country_code"
v-model="variables.country_code"
v-on:change="window.app.$emit('postcode-change', variables)"
class="w-full"
required
/>
</label>
</div>
<div class="col-span-12">
<x-rapidez::checkbox v-model="variables.default_billing">@lang('Default billing address')</x-rapidez::checkbox>
<x-rapidez::input.checkbox v-model="variables.default_billing">@lang('Default billing address')</x-rapidez::input.checkbox>
</div>
<div class="col-span-12">
<x-rapidez::checkbox v-model="variables.default_shipping">@lang('Default shipping address')</x-rapidez::checkbox>
<x-rapidez::input.checkbox v-model="variables.default_shipping">@lang('Default shipping address')</x-rapidez::input.checkbox>
</div>
</div>

<div class="flex items-center mt-5">
<x-rapidez::button type="submit">
<x-rapidez::button.secondary type="submit">
@lang(request()->id ? 'Change' : 'Add')
</x-rapidez::button>
</x-rapidez::button.secondary>

<div v-if="mutated" class="ml-3 text-green-500">
@lang('Changed successfully!')
Expand Down
Loading
Loading