From b61beda148b36d18d8b4417f5134891a738cf019 Mon Sep 17 00:00:00 2001 From: bakaneko Date: Wed, 28 Jun 2023 18:16:36 +0900 Subject: [PATCH 01/40] remove address management support --- app/Http/Controllers/StoreController.php | 86 ------------------- app/Models/Store/Address.php | 29 +------ resources/views/store/checkout/show.blade.php | 2 - .../views/store/objects/address.blade.php | 24 +----- .../views/store/objects/new_address.blade.php | 62 ------------- routes/web.php | 3 - 6 files changed, 7 insertions(+), 199 deletions(-) delete mode 100644 resources/views/store/objects/new_address.blade.php diff --git a/app/Http/Controllers/StoreController.php b/app/Http/Controllers/StoreController.php index f11dcdcf377..c94ca481095 100644 --- a/app/Http/Controllers/StoreController.php +++ b/app/Http/Controllers/StoreController.php @@ -20,21 +20,16 @@ public function __construct() { $this->middleware('auth', ['only' => [ 'getInvoice', - 'postNewAddress', - 'postUpdateAddress', ]]); if (!$this->isAllowRestrictedUsers()) { $this->middleware('check-user-restricted', ['only' => [ 'getInvoice', - 'postNewAddress', - 'postUpdateAddress', ]]); } $this->middleware('verify-user', ['only' => [ 'getInvoice', - 'postUpdateAddress', ]]); parent::__construct(); @@ -69,85 +64,4 @@ public function missingMethod($parameters = []) { abort(404); } - - public function postUpdateAddress() - { - $address_id = (int) Request::input('id'); - $address = Store\Address::find($address_id); - $order = $this->userCart(); - - if (!$address || $address->user_id !== Auth::user()->user_id) { - return error_popup('invalid address'); - } - - switch (Request::input('action')) { - default: - case 'use': - $order->address()->associate($address); - $order->save(); - - return ext_view('layout.ujs-reload', [], 'js'); - break; - case 'remove': - if ($order->address_id === $address_id) { - return error_popup('Address is being used for this order!'); - } - - if ($otherOrders = Store\Order::where('address_id', '=', $address_id)->first()) { - return error_popup('Address was used in a previous order!'); - } - - Store\Address::destroy($address_id); - - return ext_view('store.address-destroy', ['address_id' => $address_id], 'js'); - break; - } - } - - public function postNewAddress() - { - \Log::info(json_encode([ - 'tag' => 'NEW_ADDRESS', - 'user_id' => Auth::user()->user_id, - 'address' => Request::input('address'), - ])); - - $addressInput = get_params(request()->all(), 'address', [ - 'first_name', - 'last_name', - 'street', - 'city', - 'state', - 'zip', - 'country_code', - 'phone', - ]); - - $validator = Validator::make($addressInput, [ - 'first_name' => ['required'], - 'last_name' => ['required'], - 'street' => ['required', 'mixture'], - 'city' => ['required'], - 'state' => ['required'], - 'zip' => ['required', 'required'], - 'country_code' => ['required'], - 'phone' => ['required'], - ]); - - $addressInput['user_id'] = Auth::user()->user_id; - - if ($validator->fails()) { - return error_popup($validator->errors()->first()); - } - - $address = Store\Address::create($addressInput); - $address->user()->associate(Auth::user()); - $address->save(); - - $order = $this->userCart(); - $order->address()->associate($address); - $order->save(); - - return ext_view('layout.ujs-reload', [], 'js'); - } } diff --git a/app/Models/Store/Address.php b/app/Models/Store/Address.php index c2b5b3d9c3f..595ad6a08eb 100644 --- a/app/Models/Store/Address.php +++ b/app/Models/Store/Address.php @@ -58,31 +58,8 @@ public function countryName() public static function sender() { - //todo: move to database - switch (Auth::user()->user_id) { - default: - case 4916903: - return new self([ - 'first_name' => 'osu!store', - 'last_name' => '', - 'street' => 'Room 304, Build 700 Nishijin 7-7-1', - 'city' => 'Sawara', - 'state' => 'Fukuoka', - 'zip' => '814-0002', - 'country' => Country::find('JP'), - 'phone' => '+819064201305', - ]); - case 2: - return new self([ - 'first_name' => 'osu!store', - 'last_name' => '', - 'street' => 'Nishi-Ooi 4-21-3 Birdie House A', - 'city' => 'Shinagawa', - 'state' => 'Tokyo', - 'zip' => '140-0015', - 'country' => Country::find('JP'), - 'phone' => '+818013811430', - ]); - } + return new static([ + 'first_name' => 'osu!store', + ]); } } diff --git a/resources/views/store/checkout/show.blade.php b/resources/views/store/checkout/show.blade.php index fa7069ff36e..c077369aea6 100644 --- a/resources/views/store/checkout/show.blade.php +++ b/resources/views/store/checkout/show.blade.php @@ -72,8 +72,6 @@ @endforeach @endif - - @include('store.objects.new_address') @endif diff --git a/resources/views/store/objects/address.blade.php b/resources/views/store/objects/address.blade.php index 11d7e3e3859..4c93df95b97 100644 --- a/resources/views/store/objects/address.blade.php +++ b/resources/views/store/objects/address.blade.php @@ -24,27 +24,11 @@ $mainClasses .= ' clickable-row'; } @endphp -{!! Form::open([ - 'action' => 'StoreController@postUpdateAddress', - 'class' => $mainClasses, - 'data-remote' => true, - 'id' => "address-{$data->address_id}", -]) !!} + +
{{ $data->first_name }} {{ $data->last_name }}
{{ $data->street }}
-
{{ $data->city }}, {{ $data->state }}, {{ $data->zip }}
+
{{ implode(', ', array_filter([$data->city, $data->state, $data->zip])) }}
{{ $data->countryName() }}
{{ $data->phone }}
- - @if ($withButtons) - {!! Form::hidden('id', $data->address_id) !!} - - - - - @endif -{!! Form::close() !!} +
diff --git a/resources/views/store/objects/new_address.blade.php b/resources/views/store/objects/new_address.blade.php deleted file mode 100644 index ee333754ead..00000000000 --- a/resources/views/store/objects/new_address.blade.php +++ /dev/null @@ -1,62 +0,0 @@ -{{-- - Copyright (c) ppy Pty Ltd . Licensed under the GNU Affero General Public License v3.0. - See the LICENCE file in the repository root for full licence text. ---}} -@php - $showForm = count($addresses) === 0; -@endphp -{!! Form::open(['action' => 'StoreController@postNewAddress', "data-remote" => true]) !!} -
-
-
-

Adding new shipping address

-
- -
- {!! Form::label('address[first_name]', 'First Name', ["class" => "sr-only"]) !!} - {!! Form::text("address[first_name]", null, ['class' => 'form-control', "placeholder" => "First Name"]) !!} -
-
- {!! Form::label('address[last_name]', 'Last Name', ["class" => "sr-only"]) !!} - {!! Form::text("address[last_name]", null, ['class' => 'form-control', "placeholder" => "Last Name"]) !!} -
-
- {!! Form::label('address[street]', 'Street Number, Name, Building, etc', ["class" => "sr-only"]) !!} - {!! Form::text("address[street]", null, ['class' => 'form-control', "placeholder" => "Street Number, Name, Building, etc"]) !!} -
-
- {!! Form::label('address[city]', 'City', ["class" => "sr-only"]) !!} - {!! Form::text("address[city]", null, ['class' => 'form-control', "placeholder" => "City"]) !!} -
-
- {!! Form::label('address[state]', 'State', ["class" => "sr-only"]) !!} - {!! Form::text("address[state]", null, ['class' => 'form-control', "placeholder" => "State"]) !!} -
-
- {!! Form::label('address[zip]', 'Post Code', ["class" => "sr-only"]) !!} - {!! Form::text("address[zip]", null, ['class' => 'form-control', "placeholder" => "Post Code"]) !!} -
-
- {!! Form::label('address[country_code]', 'Country', ["class" => "sr-only"]) !!} - {!!Form::select('address[country_code]', countries_array_for_select(), request_country(), ['class' => 'form-control']) !!} -
-
- {!! Form::label('address[phone]', 'Phone Number', ["class" => "sr-only"]) !!} - {!! Form::text("address[phone]", null, ['class' => 'form-control', "placeholder" => "Phone Number"]) !!} -
-
-
- -
- - @if (!$showForm) - Add new shipping address - @endif -
-{!! Form::close() !!} diff --git a/routes/web.php b/routes/web.php index ee02e21cd03..cbe2f921739 100644 --- a/routes/web.php +++ b/routes/web.php @@ -325,9 +325,6 @@ Route::get('listing', 'StoreController@getListing')->name('products.index'); Route::get('invoice/{invoice}', 'StoreController@getInvoice')->name('invoice.show'); - Route::post('update-address', 'StoreController@postUpdateAddress'); - Route::post('new-address', 'StoreController@postNewAddress'); - Route::group(['namespace' => 'Store'], function () { Route::post('products/{product}/notification-request', 'NotificationRequestsController@store')->name('notification-request'); Route::delete('products/{product}/notification-request', 'NotificationRequestsController@destroy'); From 4414a17ec6492cc125b47357c8e74b9b1d133331 Mon Sep 17 00:00:00 2001 From: bakaneko Date: Wed, 28 Jun 2023 18:22:57 +0900 Subject: [PATCH 02/40] ununsed --- resources/views/store/address-destroy.blade.php | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 resources/views/store/address-destroy.blade.php diff --git a/resources/views/store/address-destroy.blade.php b/resources/views/store/address-destroy.blade.php deleted file mode 100644 index d7ef27522c1..00000000000 --- a/resources/views/store/address-destroy.blade.php +++ /dev/null @@ -1,8 +0,0 @@ -{{-- - Copyright (c) ppy Pty Ltd . Licensed under the GNU Affero General Public License v3.0. - See the LICENCE file in the repository root for full licence text. ---}} -(function() { - var $el = $("#address-{{ $address_id }}") - $el.slideUp(function() { $el.remove() }) -}).call(this) From 9f325811f05509095af70ddb5dab58c6ddafb868 Mon Sep 17 00:00:00 2001 From: bakaneko Date: Wed, 28 Jun 2023 18:24:52 +0900 Subject: [PATCH 03/40] remove logic handling shipping addresses --- .../store/_shipping_germany_warning.blade.php | 16 ----------- resources/views/store/checkout/show.blade.php | 28 +------------------ .../views/store/objects/address.blade.php | 22 --------------- 3 files changed, 1 insertion(+), 65 deletions(-) delete mode 100644 resources/views/store/_shipping_germany_warning.blade.php diff --git a/resources/views/store/_shipping_germany_warning.blade.php b/resources/views/store/_shipping_germany_warning.blade.php deleted file mode 100644 index d6bed9f1fbe..00000000000 --- a/resources/views/store/_shipping_germany_warning.blade.php +++ /dev/null @@ -1,16 +0,0 @@ -{{-- - Copyright (c) ppy Pty Ltd . Licensed under the GNU Affero General Public License v3.0. - See the LICENCE file in the repository root for full licence text. ---}} - -
-

NOTE TO GERMAN CUSTOMERS

- -

- We have recently been notified of issues regarding deliveries within Germany, possibly due to a change in German customs regulations. Multiple cases have been reported where packages are not delivered to the addressee, but instead to a customs house. The addressee is then sent a notice to pick up the item in person and pay an import sales tax. Unfortunately international customs procedures are out of our control, but please take this into account when placing your order. -

- -

- -

-
diff --git a/resources/views/store/checkout/show.blade.php b/resources/views/store/checkout/show.blade.php index c077369aea6..42840e1bf37 100644 --- a/resources/views/store/checkout/show.blade.php +++ b/resources/views/store/checkout/show.blade.php @@ -49,40 +49,14 @@ - @if ($order->requiresShipping()) -
-

Shipping Address

- - @if (count($addresses)) -
- @foreach($addresses as $a) - @include('store.objects.address', [ - 'data' => $a, - 'selected' => (isset($order->address) && $order->address->address_id === $a->address_id), - 'modifiable' => true, - ]) - @endforeach -
- @endif -
- @endif - - @if(!$order->requiresShipping() || $order->shipping) + @if (!$order->requiresShipping() || $order->shipping > 0) @endsection From df171eda8aa107d6b5c563e53315c92bf1234f47 Mon Sep 17 00:00:00 2001 From: bakaneko Date: Wed, 28 Jun 2023 19:07:05 +0900 Subject: [PATCH 05/40] no longer used --- resources/css/bem-index.less | 1 - resources/css/bem/address-list.less | 12 -------- resources/css/bem/address.less | 43 ----------------------------- 3 files changed, 56 deletions(-) delete mode 100644 resources/css/bem/address-list.less diff --git a/resources/css/bem-index.less b/resources/css/bem-index.less index 3a4014018ba..918f9d66ce1 100644 --- a/resources/css/bem-index.less +++ b/resources/css/bem-index.less @@ -6,7 +6,6 @@ @import "bem/account-edit-status"; @import "bem/account-verification-message"; @import "bem/address"; -@import "bem/address-list"; @import "bem/admin-contest"; @import "bem/admin-contest-entry"; @import "bem/admin-menu"; diff --git a/resources/css/bem/address-list.less b/resources/css/bem/address-list.less deleted file mode 100644 index 71478b859c0..00000000000 --- a/resources/css/bem/address-list.less +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the GNU Affero General Public License v3.0. -// See the LICENCE file in the repository root for full licence text. - -.address-list { - margin: 20px 0; - display: grid; - grid-gap: 20px; - - @media @desktop { - grid-template-columns: 1fr 1fr; - } -} diff --git a/resources/css/bem/address.less b/resources/css/bem/address.less index 0ec682959af..11a71601396 100644 --- a/resources/css/bem/address.less +++ b/resources/css/bem/address.less @@ -3,47 +3,4 @@ .address { margin-bottom: 20px; - - &--card { - .default-box-shadow(); - .default-border-radius(); - background: @osu-colour-b4; - padding: 20px; - margin: 0; - } - - &--card-active { - .default-box-shadow(); - box-shadow: 0 0 0 3px @osu-colour-l4; - } - - &--card-hover { - &:hover { - .default-box-shadow(); - box-shadow: 0 0 0 3px @osu-colour-l4; - } - } - - &__button-delete { - .reset-input(); - color: @osu-colour-c1; - position: absolute; - padding: 10px; - top: 0; - right: 0; - font-size: 20px; // icon size - - &:hover { - color: @osu-colour-red-2; - } - } - - &__button-select { - position: absolute; - top: 0; - left: 0; - width: 1px; - height: 1px; - opacity: 0; - } } From 8e17fe64c2f9cf405e2829ecc39bc7434890fe47 Mon Sep 17 00:00:00 2001 From: Liam DeVoe Date: Wed, 28 Jun 2023 21:31:15 -0400 Subject: [PATCH 06/40] mark UserCompact.default_group as nullable --- resources/views/docs/_structures/user_compact.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/docs/_structures/user_compact.md b/resources/views/docs/_structures/user_compact.md index c48ec7b5233..aeffcca5e2e 100644 --- a/resources/views/docs/_structures/user_compact.md +++ b/resources/views/docs/_structures/user_compact.md @@ -20,7 +20,7 @@ Field | Type | Description --------------- | ------------------------- | ---------------------------------------------------------------------- avatar_url | string | url of user's avatar country_code | string | two-letter code representing user's country -default_group | string | Identifier of the default [Group](#group) the user belongs to. +default_group | string? | Identifier of the default [Group](#group) the user belongs to. id | number | unique identifier for user is_active | boolean | has this account been active in the last x months? is_bot | boolean | is this a bot account? From 444590655368952eb5e916b7cde921b6c6b61448 Mon Sep 17 00:00:00 2001 From: bakaneko Date: Wed, 28 Jun 2023 19:15:12 +0900 Subject: [PATCH 07/40] just hard code osu!store text --- resources/views/store/orders/_details.blade.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/resources/views/store/orders/_details.blade.php b/resources/views/store/orders/_details.blade.php index 1b744385276..d93c8c5309b 100644 --- a/resources/views/store/orders/_details.blade.php +++ b/resources/views/store/orders/_details.blade.php @@ -37,7 +37,9 @@

Sent Via:

- @include('store.objects.address', ['data' => $sentViaAddress, 'grid' => '']) +
+ osu!store +
@@ -46,7 +48,7 @@

Shipping To:

- @include('store.objects.address', ['data' => $order->address, 'grid' => '']) + @include('store.objects.address', ['data' => $order->address])
@endif @@ -77,7 +79,7 @@ $showTrackingCode = ($order->isShipped() || $order->isDelivered() || Auth::user()->isAdmin()) && $order->tracking_code; $transactionDetails = [ - 'Salesperson' => "{$sentViaAddress->first_name} {$sentViaAddress->last_name}", + 'Salesperson' => 'osu!store', 'Order #' => "#{$order->order_id}", 'Shipping Method' => $showTrackingCode ? 'EMS ('.trim($order->tracking_code).')' : 'N/A', 'Shipping Terms' => 'FOB Japan', From dc18ef8db013868b71b82305702ae81019ac11cc Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 29 Jun 2023 15:25:29 +0900 Subject: [PATCH 08/40] Add clockworkd enable flag to example `.env` file --- .env.example | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.env.example b/.env.example index 246c9d9a484..52cb488c082 100644 --- a/.env.example +++ b/.env.example @@ -13,6 +13,10 @@ APP_LOG_LEVEL=debug # DOCS_URL= +# clockwork provides local development insights (at /__clockwork/) +# adds a slight performance overhead. +CLOCKWORK_ENABLE=true + DB_HOST=localhost DB_DATABASE=osu DB_USERNAME=osuweb From 6847bf750286ef1e740fecb135e64b51cd3c95c0 Mon Sep 17 00:00:00 2001 From: bakaneko Date: Thu, 29 Jun 2023 17:15:41 +0900 Subject: [PATCH 09/40] update tests for new rules --- database/factories/Store/ProductFactory.php | 10 ++++++++++ tests/Libraries/OrderCheckoutTest.php | 22 ++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/database/factories/Store/ProductFactory.php b/database/factories/Store/ProductFactory.php index cece4411d43..654f18dc9c0 100644 --- a/database/factories/Store/ProductFactory.php +++ b/database/factories/Store/ProductFactory.php @@ -96,4 +96,14 @@ public function masterTshirt(): static 'weight' => 100, ]); } + + public function virtual(): static + { + return $this->state([ + 'base_shipping' => 0.00, + 'next_shipping' => 0.00, + 'weight' => null, + ]); + } + } diff --git a/tests/Libraries/OrderCheckoutTest.php b/tests/Libraries/OrderCheckoutTest.php index e50ca04800d..f33d1ce62f3 100644 --- a/tests/Libraries/OrderCheckoutTest.php +++ b/tests/Libraries/OrderCheckoutTest.php @@ -69,10 +69,30 @@ public function testTournamentBannerWhenNotAvailable() $this->assertNotEmpty($checkout->validate()); } + public function testShippableItemRequiresShopify() + { + $product = Product::factory()->create(['stock' => 5, 'max_quantity' => 5, 'shopify_id' => null]); + $orderItem = OrderItem::factory()->create([ + 'product_id' => $product, + 'quantity' => 1, + ]); + + $order = Order::factory()->create(); + $order->items()->save($orderItem); + + $checkout = new OrderCheckout($order); + $result = $checkout->validate(); + + $this->assertSame( + [osu_trans('model_validation/store/product.not_available')], + array_get($result, "orderItems.{$orderItem->getKey()}") + ); + } + public function testShopifyItemDoesNotMix() { $product1 = Product::factory()->create(['stock' => 5, 'max_quantity' => 5, 'shopify_id' => 1]); - $product2 = Product::factory()->create(['stock' => 5, 'max_quantity' => 5, 'shopify_id' => null]); + $product2 = Product::factory()->virtual()->create(['stock' => 5, 'max_quantity' => 5, 'shopify_id' => null]); $orderItem1 = OrderItem::factory()->create([ 'product_id' => $product1, 'quantity' => 1, From 99a4fcd72a50cd35f15e66ec1d9bf2f253d075b3 Mon Sep 17 00:00:00 2001 From: bakaneko Date: Thu, 29 Jun 2023 17:31:49 +0900 Subject: [PATCH 10/40] lint --- app/Http/Controllers/StoreController.php | 1 - app/Models/Store/Address.php | 1 - database/factories/Store/ProductFactory.php | 1 - 3 files changed, 3 deletions(-) diff --git a/app/Http/Controllers/StoreController.php b/app/Http/Controllers/StoreController.php index c94ca481095..3eb0ef604be 100644 --- a/app/Http/Controllers/StoreController.php +++ b/app/Http/Controllers/StoreController.php @@ -9,7 +9,6 @@ use App\Models\Store; use Auth; use Request; -use Validator; class StoreController extends Controller { diff --git a/app/Models/Store/Address.php b/app/Models/Store/Address.php index 595ad6a08eb..d9d2ff8c5cb 100644 --- a/app/Models/Store/Address.php +++ b/app/Models/Store/Address.php @@ -7,7 +7,6 @@ use App\Models\Country; use App\Models\User; -use Auth; /** * @property int $address_id diff --git a/database/factories/Store/ProductFactory.php b/database/factories/Store/ProductFactory.php index 654f18dc9c0..439f543d111 100644 --- a/database/factories/Store/ProductFactory.php +++ b/database/factories/Store/ProductFactory.php @@ -105,5 +105,4 @@ public function virtual(): static 'weight' => null, ]); } - } From a4ebb2e3a972e970a08ec40349af5bbbe0def3da Mon Sep 17 00:00:00 2001 From: bakaneko Date: Thu, 29 Jun 2023 17:48:52 +0900 Subject: [PATCH 11/40] unneeded --- app/Http/Controllers/StoreController.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Http/Controllers/StoreController.php b/app/Http/Controllers/StoreController.php index 3eb0ef604be..82e313cd1f6 100644 --- a/app/Http/Controllers/StoreController.php +++ b/app/Http/Controllers/StoreController.php @@ -52,11 +52,10 @@ public function getInvoice($id = null) abort(403); } - $sentViaAddress = Store\Address::sender(); $forShipping = Auth::user()->isAdmin() && get_bool(Request::input('for_shipping')); $copies = clamp(get_int(request('copies')), 1, config('store.invoice.max_copies')); - return ext_view('store.invoice', compact('order', 'forShipping', 'copies', 'sentViaAddress')); + return ext_view('store.invoice', compact('order', 'forShipping', 'copies')); } public function missingMethod($parameters = []) From 4946190839d1f48ba1c6e64c2e2a41f63a8f6e85 Mon Sep 17 00:00:00 2001 From: bakaneko Date: Thu, 29 Jun 2023 17:49:14 +0900 Subject: [PATCH 12/40] ??? --- app/Http/Controllers/StoreController.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/Http/Controllers/StoreController.php b/app/Http/Controllers/StoreController.php index 82e313cd1f6..adc76cca510 100644 --- a/app/Http/Controllers/StoreController.php +++ b/app/Http/Controllers/StoreController.php @@ -57,9 +57,4 @@ public function getInvoice($id = null) return ext_view('store.invoice', compact('order', 'forShipping', 'copies')); } - - public function missingMethod($parameters = []) - { - abort(404); - } } From 06263ff02623b9b5bbe8068028383f1662e4969c Mon Sep 17 00:00:00 2001 From: bakaneko Date: Thu, 29 Jun 2023 19:10:29 +0900 Subject: [PATCH 13/40] ...why is that even grid --- resources/views/store/invoice.blade.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/resources/views/store/invoice.blade.php b/resources/views/store/invoice.blade.php index f5b0b821ae3..caf66143b81 100644 --- a/resources/views/store/invoice.blade.php +++ b/resources/views/store/invoice.blade.php @@ -9,13 +9,11 @@
@if (Request::has('thanks')) -
-
-

Thanks for your order!

-

- You will receive a confirmation email soon. If you have any enquiries, please contact us! -

-
+
+

Thanks for your order!

+

+ You will receive a confirmation email soon. If you have any enquiries, please contact us! +

@endif From d6565f3298122f1ef4a7c0950883494e7e2832bf Mon Sep 17 00:00:00 2001 From: bakaneko Date: Thu, 29 Jun 2023 21:22:56 +0900 Subject: [PATCH 14/40] removing fake grid --- resources/css/bem/address.less | 1 + resources/css/bem/store-page.less | 14 ++ .../views/store/orders/_details.blade.php | 147 ++++++++---------- 3 files changed, 82 insertions(+), 80 deletions(-) diff --git a/resources/css/bem/address.less b/resources/css/bem/address.less index 11a71601396..ee7f23c3281 100644 --- a/resources/css/bem/address.less +++ b/resources/css/bem/address.less @@ -3,4 +3,5 @@ .address { margin-bottom: 20px; + overflow-wrap: break-word; } diff --git a/resources/css/bem/store-page.less b/resources/css/bem/store-page.less index bb37c2f2f4a..31dbc67dd57 100644 --- a/resources/css/bem/store-page.less +++ b/resources/css/bem/store-page.less @@ -15,6 +15,15 @@ background-color: @osu-colour-b4; } + &__address { + @media @desktop { + display: grid; + grid-auto-columns: minmax(0, 1fr); + grid-auto-flow: column; + gap: 33%; + } + } + &__option { text-transform: inherit; margin: 0; @@ -34,4 +43,9 @@ margin-bottom: 20px; } } + + &__invoice-header { + display: flex; + gap: 10px; + } } diff --git a/resources/views/store/orders/_details.blade.php b/resources/views/store/orders/_details.blade.php index d93c8c5309b..ab96a71e9d4 100644 --- a/resources/views/store/orders/_details.blade.php +++ b/resources/views/store/orders/_details.blade.php @@ -2,100 +2,87 @@ Copyright (c) ppy Pty Ltd . Licensed under the GNU Affero General Public License v3.0. See the LICENCE file in the repository root for full licence text. --}} -
-
-
-
-
-

Invoice

-
-
- Date: - @if($order->shipped_at) - {{ $order->shipped_at->toDateString() }} - @elseif($order->paid_at) - {{ $order->paid_at->toDateString() }} - @else - {{ $order->updated_at->toDateString() }} - @endif -
-
-
-

- ppy Pty Ltd
- ACN 163 593 413 a.t.f. Dean Herbert Family Trust -

- -

contact: pe@ppy.sh / +81 80 1381 1430

+
+
+
+

Invoice

+
+ Date: + @if($order->shipped_at) + {{ $order->shipped_at->toDateString() }} + @elseif($order->paid_at) + {{ $order->paid_at->toDateString() }} + @else + {{ $order->updated_at->toDateString() }} + @endif
+
+

+ ppy Pty Ltd
+ ACN 163 593 413 a.t.f. Dean Herbert Family Trust +

-
+

contact: pe@ppy.sh / +81 80 1381 1430

+
+
- @if($order->address !== null) -
-
-

Sent Via:

+
-
- osu!store -
-
+ @if($order->address !== null) +
+
+

Sent Via:

-
-
- -
-

Shipping To:

- - @include('store.objects.address', ['data' => $order->address]) +
+ osu!store
- @endif - -
-
-

Order Details

-
-
-
-
- @include('store.objects.order', [ - 'order' => $order, - 'weight' => true, - 'checkout' => false, - 'forShipping' => $forShipping, - ]) +
+

Shipping To:

- @if ($order->isHideSupporterFromActivity()) - {{ osu_trans('store.invoice.hide_from_activity') }} - @endif + @include('store.objects.address', ['data' => $order->address])
+ @endif + +
+

Order Details

- @if ($order->address !== null) - @php - $showTrackingCode = ($order->isShipped() || $order->isDelivered() || Auth::user()->isAdmin()) && $order->tracking_code; + @include('store.objects.order', [ + 'order' => $order, + 'weight' => true, + 'checkout' => false, + 'forShipping' => $forShipping, + ]) - $transactionDetails = [ - 'Salesperson' => 'osu!store', - 'Order #' => "#{$order->order_id}", - 'Shipping Method' => $showTrackingCode ? 'EMS ('.trim($order->tracking_code).')' : 'N/A', - 'Shipping Terms' => 'FOB Japan', - 'Payment Terms' => studly_case($order->getPaymentProvider()).' ('.$order->getPaymentStatusText().')', - ]; - @endphp -
- @foreach ($transactionDetails as $key => $value) -
- {{ $key }} -
-
- {{ $value }} -
- @endforeach -
+ @if ($order->isHideSupporterFromActivity()) + {{ osu_trans('store.invoice.hide_from_activity') }} @endif
+ + @if ($order->address !== null) + @php + $showTrackingCode = ($order->isShipped() || $order->isDelivered() || Auth::user()->isAdmin()) && $order->tracking_code; + + $transactionDetails = [ + 'Salesperson' => 'osu!store', + 'Order #' => "#{$order->order_id}", + 'Shipping Method' => $showTrackingCode ? 'EMS ('.trim($order->tracking_code).')' : 'N/A', + 'Shipping Terms' => 'FOB Japan', + 'Payment Terms' => studly_case($order->getPaymentProvider()).' ('.$order->getPaymentStatusText().')', + ]; + @endphp +
+ @foreach ($transactionDetails as $key => $value) +
+ {{ $key }} +
+
+ {{ $value }} +
+ @endforeach +
+ @endif
From 488c4368c69177a7a2e4c4bf94901dc4faf3ce12 Mon Sep 17 00:00:00 2001 From: nanaya Date: Fri, 30 Jun 2023 16:45:53 +0900 Subject: [PATCH 15/40] Only stick beatmap discussion timestamp on the discussion page --- resources/css/bem/beatmap-discussion-timestamp.less | 13 +++++++------ resources/js/beatmap-discussions/discussion.tsx | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/resources/css/bem/beatmap-discussion-timestamp.less b/resources/css/bem/beatmap-discussion-timestamp.less index 683abcd82e1..f1d7a25d912 100644 --- a/resources/css/bem/beatmap-discussion-timestamp.less +++ b/resources/css/bem/beatmap-discussion-timestamp.less @@ -11,14 +11,15 @@ // avatar + paddings + margins height: (@beatmap-discussion--avatar-size + 20px + 10px); - align-items: center; - display: flex; - position: sticky; - // 36px is page-extra-tabs height on desktop. - // This doesn't work when the new discussion box is visible. - top: calc(var(--navbar-height) + 36px); + + &--sticky { + position: sticky; + // 36px is page-extra-tabs height on desktop. + // This doesn't work when the new discussion box is visible. + top: calc(var(--navbar-height) + 36px); + } &__icons { display: flex; diff --git a/resources/js/beatmap-discussions/discussion.tsx b/resources/js/beatmap-discussions/discussion.tsx index 06a17b49d19..2b4c6d305c4 100644 --- a/resources/js/beatmap-discussions/discussion.tsx +++ b/resources/js/beatmap-discussions/discussion.tsx @@ -290,7 +290,7 @@ export class Discussion extends React.Component { private renderTimestamp() { return ( -
+
{this.props.discussion.timestamp != null && this.props.isTimelineVisible &&
}
From 71db2a359983dce0a589001c02209edb3b921beb Mon Sep 17 00:00:00 2001 From: bakaneko Date: Fri, 30 Jun 2023 17:13:41 +0900 Subject: [PATCH 16/40] don't need the extra funny grids if actual grid --- resources/css/bem/store-page.less | 9 ++++ resources/views/store/products/show.blade.php | 47 +++++-------------- 2 files changed, 22 insertions(+), 34 deletions(-) diff --git a/resources/css/bem/store-page.less b/resources/css/bem/store-page.less index 31dbc67dd57..a7b6a525b63 100644 --- a/resources/css/bem/store-page.less +++ b/resources/css/bem/store-page.less @@ -48,4 +48,13 @@ display: flex; gap: 10px; } + + &__product { + @media @desktop { + display: grid; + grid-auto-columns: minmax(0, 1fr); + grid-auto-flow: column; + gap: 40px; + } + } } diff --git a/resources/views/store/products/show.blade.php b/resources/views/store/products/show.blade.php index 6a5cdb05e75..3c28984b5a8 100644 --- a/resources/views/store/products/show.blade.php +++ b/resources/views/store/products/show.blade.php @@ -19,18 +19,11 @@

{{ $product->name }}

@if($product->custom_class && View::exists("store.products.{$product->custom_class}")) - -
-
- {!! markdown($product->description, 'store') !!} -
-
- + {!! markdown($product->description, 'store') !!} @include("store.products.{$product->custom_class}") - @else -
-
+
+
-
-
-
- {!! markdown($product->description, 'store') !!} -
-
-
-
-

{{ currency($product->cost) }}

- @if($product->requiresShipping()) -

excluding shipping fees

- @endif -
-
+
+ {!! markdown($product->description, 'store') !!} + +

{{ currency($product->cost) }}

+ @if($product->requiresShipping()) +

excluding shipping fees

+ @endif @if($product->types()) @foreach($product->types() as $type => $values) @@ -120,17 +106,10 @@ class=" ) !!}
- @elseif($product->inStock(1, true)) -
-
- {{ osu_trans('store.product.stock.out_with_alternative') }} -
-
+ @elseif ($product->inStock(1, true)) + {{ osu_trans('store.product.stock.out_with_alternative') }} @else -
-
- {{ osu_trans('store.product.stock.out') }} -
+ {{ osu_trans('store.product.stock.out') }}
@endif
From 3228b8ee22bf82c06d7ee61df4750a7a9ab5abbf Mon Sep 17 00:00:00 2001 From: bakaneko Date: Fri, 30 Jun 2023 17:15:37 +0900 Subject: [PATCH 17/40] indent --- resources/views/store/products/show.blade.php | 162 +++++++++--------- 1 file changed, 81 insertions(+), 81 deletions(-) diff --git a/resources/views/store/products/show.blade.php b/resources/views/store/products/show.blade.php index 3c28984b5a8..a88520eb622 100644 --- a/resources/views/store/products/show.blade.php +++ b/resources/views/store/products/show.blade.php @@ -22,98 +22,98 @@ {!! markdown($product->description, 'store') !!} @include("store.products.{$product->custom_class}") @else -
-
- -