Skip to content

Commit

Permalink
Merge branch 'main' into feat/discounts
Browse files Browse the repository at this point in the history
  • Loading branch information
alecritson authored Dec 9, 2022
2 parents f69f393 + b279c81 commit 3c207dc
Show file tree
Hide file tree
Showing 39 changed files with 840 additions and 651 deletions.
3 changes: 2 additions & 1 deletion docs/src/extending/shipping.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class CustomShippingModifier extends ShippingModifier

ShippingManifest::addOption(
new ShippingOption(
description: 'Basic Delivery',
name: 'Basic Delivery',
description: 'A basic delivery option',
identifier: 'BASDEL',
price: new Price(500, $cart->currency, 1),
taxClass: $taxClass
Expand Down
1 change: 1 addition & 0 deletions docs/src/lunar/orders.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Lunar\Models\Order
|:-|:-|
|id||
|user_id|If this is not a guest order, this will have the users id|
|customer_id|Can be `null`, stores customer|
|channel_id|Which channel this was purchased through|
|status|A status that makes sense to you as the store owner|
|reference|Your stores own reference
Expand Down
2 changes: 1 addition & 1 deletion packages/admin/public/app.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/admin/resources/lang/en/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
'staff.show.title' => 'Edit Staff',
'staff.show.delete_btn' => 'Deactivate account',
'staff.show.delete_title' => 'Delete Staff',
'staff.show.restore_title' => 'Restore Staff',
/**
* Staff create page.
*/
Expand Down
1 change: 1 addition & 0 deletions packages/admin/resources/lang/en/tables.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

return [
'headings.deleted' => 'Deleted',
'headings.status' => 'Status',
'headings.reference' => 'Reference',
'headings.customer' => 'Customer',
Expand Down
77 changes: 44 additions & 33 deletions packages/admin/resources/views/components/input/group.blade.php
Original file line number Diff line number Diff line change
@@ -1,36 +1,47 @@
<div>
<label for="{{ $for }}" class="flex items-center text-sm font-medium text-gray-700">
<span class="block">{{ $labelPrefix ?? null }}</span>
<span class="block">{{ $label }}@if($required)<sup class="text-xs text-red-600">&#42;</sup>@endif</span>
</label>
<div class="relative mt-1">
{{ $slot }}
@if($error && $errorIcon)
<div class="absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none">
<!-- Heroicon name: solid/exclamation-circle -->
<svg class="w-5 h-5 text-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z" clip-rule="evenodd" />
</svg>
</div>
@endif
</div>
@if($instructions)
<p class="mt-2 text-sm text-gray-500">{{ $instructions }}</p>
@endif
@if($error)
<p class="mt-2 text-sm text-red-600">{{ $error }}</p>
@endif
@if(count($errors))
<div class="space-y-1">
@foreach($errors as $error)
@if(is_array($error))
@foreach($error as $text)
<p class="text-sm text-red-600">{{ $text }}</p>
@endforeach
@else
<p class="text-sm text-red-600">{{ $error }}</p>
@endif
@endforeach
<label for="{{ $for }}"
class="flex items-center text-sm font-medium text-gray-700">
<span class="block">{{ $labelPrefix ?? null }}</span>

<span class="block">
{{ $label }}

@if ($required)
<sup class="text-xs text-red-600">&#42;</sup>
@endif
</span>
</label>

<div class="relative mt-1">
{{ $slot }}
</div>
@endif

@if ($instructions)
<p class="mt-2 text-sm text-gray-500">{{ $instructions }}</p>
@endif

@if ($error)
<div class="flex items-center gap-1 mt-2">
@if ($errorIcon)
<x-hub::icon ref="exclamation-circle"
class="w-5 h-5 text-red-500" />
@endif

<p class="text-sm text-red-600">{{ $error }}</p>
</div>
@endif

@if (count($errors))
<div class="space-y-1">
@foreach ($errors as $error)
@if (is_array($error))
@foreach ($error as $text)
<p class="text-sm text-red-600">{{ $text }}</p>
@endforeach
@else
<p class="text-sm text-red-600">{{ $error }}</p>
@endif
@endforeach
</div>
@endif
</div>
17 changes: 8 additions & 9 deletions packages/admin/resources/views/components/input/text.blade.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<input
{{ $attributes->merge([
'type' => 'text',
'class' => 'form-input block w-full border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm disabled:opacity-50 disabled:cursor-not-allowed',
])->class([
'border-red-400' => !!$error,
]) }}
maxlength="255"
>
<input {{ $attributes->merge([
'type' => 'text',
'class' =>
'form-input block w-full border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm disabled:opacity-50 disabled:cursor-not-allowed',
])->class([
'border-red-400' => !!$error,
]) }}
maxlength="255">
2 changes: 2 additions & 0 deletions packages/admin/resources/views/components/thumbnail.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<img src="{{ $src }}"
{{ $attributes->merge(['class' => 'w-16 h-16 rounded']) }} />
80 changes: 42 additions & 38 deletions packages/admin/resources/views/components/translatable.blade.php
Original file line number Diff line number Diff line change
@@ -1,42 +1,46 @@
<div
x-data="{ showTranslations: {{ $expanded ? 'true' : 'false' }} }"
>
@if($languages->count())
<div class="absolute top-0 left-0 -ml-10 -mt-7">
<button
@click.prevent="showTranslations = !showTranslations"
class="inline-flex items-center px-2 py-1 text-sm font-medium text-gray-700 uppercase bg-white border rounded shadow-sm hover:bg-gray-100"
>
<x-hub::icon ref="translate" class="w-3 h-4" />
</button>
<div x-data="{ showTranslations: {{ $expanded ? 'true' : 'false' }} }">
<div class="flex items-center gap-2">
<div x-show="showTranslations"
x-cloak>
<span class="px-2 py-1 text-xs text-gray-600 uppercase bg-gray-100 border rounded">
{{ $default->code }}
</span>
</div>

<div class="w-full">
{{ $slot }}
</div>
</div>

@if ($languages->count())
<div class="mt-2 space-y-2"
x-show="showTranslations"
x-cloak>
@foreach ($languages as $language)
@if (${"{$language->code}"} ?? null)
<div class="relative flex items-center gap-2"
wire:key="language-{{ $language->id }}">
<span class="px-2 py-1 text-xs text-gray-600 uppercase bg-gray-100 border rounded">
{{ $language->code }}
</span>

<div class="w-full">
{{ ${"{$language->code}"} ?? null }}
</div>
</div>
@endif
@endforeach
</div>
@endif
<div class="flex items-center">
<div x-show="showTranslations" x-cloak>
<span class="p-2 pr-3 text-xs text-gray-600 uppercase bg-gray-100 border rounded-l border-r-none">
{{ $default->code }}
</span>
</div>
<div class="w-full">
{{ $slot }}
</div>
</div>
@if($languages->count())
<div class="pb-2 mt-2 space-y-2" x-show="showTranslations" x-cloak>
@foreach($languages as $language)
@if(${"{$language->code}"} ?? null)
<div class="relative flex items-center" wire:key="language-{{ $language->id }}">
<div x-show="showTranslations">
<span class="p-2 pr-3 text-xs text-gray-600 uppercase bg-gray-100 border rounded-l border-r-none">
{{ $language->code }}
</span>
</div>
<div class="w-full">
{{ ${"{$language->code}"} ?? null }}
</div>
</div>
@endif
@endforeach
</div>

@if ($languages->count())
<button x-on:click.prevent="showTranslations = !showTranslations"
class="inline-flex items-center gap-2 px-2 py-1 mt-2 text-gray-700 bg-white border rounded shadow-sm hover:bg-gray-100"
:class="{ 'bg-gray-100': showTranslations }">
<x-hub::icon ref="translate"
class="w-4 h-4" />

<span class="text-xs font-medium">Locales</span>
</button>
@endif
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,9 @@ class="mr-2 text-gray-400 hover:text-gray-700" />

<div
class="flex items-center justify-between w-full px-3 py-3 text-sm bg-white border rounded sort-item-element">
<div class="flex items-center">
<div class="flex items-center gap-4">
@if ($product['thumbnail'])
<img src="{{ $product['thumbnail'] }}"
class="w-6 mr-2 rounded" />
<x-hub::thumbnail :src="$product['thumbnail']" />
@endif

<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class="ml-2">{{ $group->name }}</span>
</div>

<div>
<div x-data="{ tab: 'order_history' }">
<div x-data="{ tab: @entangle('tab') }">
<div>
<div class="hidden sm:block">
<nav class="flex space-x-4"
Expand Down
Loading

0 comments on commit 3c207dc

Please sign in to comment.