Skip to content

Commit

Permalink
Merge branch 'master' into search-rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
momijizukamori committed Jun 19, 2024
2 parents e99d74e + 021c4e6 commit c50cbef
Show file tree
Hide file tree
Showing 13 changed files with 72 additions and 32 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@ on:
jobs:
build-push-sakura:
container:
image: ghcr.io/lolibrary/builder
image: ghcr.io/lolibrary/builder@sha256:80ca803642b16c17df149f402b4ea5d440eaef0fa19d54c9431dc4b9acfc6cb5
credentials:
username: ${{ github.actor }}
password: ${{ secrets.PAT }}
runs-on: ubuntu-latest
steps:
- name: Checkout build tools
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: lolibrary/build
token: ${{ secrets.PAT }}
ref: cea7b09494c6541c8bdfc7d919e1d58428061117
- name: Checkout Sakura
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: cache
- name: GHCR login
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deploy-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout build tools
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: lolibrary/build
token: ${{ secrets.PAT }}
ref: cea7b09494c6541c8bdfc7d919e1d58428061117
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout build tools
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: lolibrary/build
token: ${{ secrets.PAT }}
ref: cea7b09494c6541c8bdfc7d919e1d58428061117
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected function validator(array $data)
'string',
'min:3',
'max:40',
'regex:/^[^-_][0-9a-z_-]+$/u',
'regex:/^[0-9a-z][0-9a-z_-]+$/u',
'unique:users',
],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
Expand Down
7 changes: 6 additions & 1 deletion app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Database\Eloquent\Builder;
use App\Models\Brand;
use App\Models\Category;
use App\Models\Item;
Expand All @@ -28,8 +29,12 @@ public function homepage()
$brands = Brand::all();
$categories = Category::all();
$recent = Item::with(Item::PARTIAL_LOAD)
->drafts(false)
->whereNotNull('published_at')
->orderBy('published_at', 'desc')
->whereNotNull('image')
->whereDoesntHave('tags', function (Builder $query) {
$query->whereIn('slug', ['partial', 'sensitive-content']);
})
->take(15)
->get();

Expand Down
4 changes: 2 additions & 2 deletions app/Nova/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ public function fields(Request $request)
BelongsTo::make('Brand')->sortable(),
AttachMany::make('Category', 'categories', Category::class)->rules('min:1', 'required'),

Trix::make('Additional Details', 'notes')->alwaysShow(),
Trix::make('Sources & Notes', 'internal_notes')->alwaysShow()
Trix::make('Notes', 'notes')->alwaysShow(),
Trix::make('Internal Notes & Sources', 'internal_notes')->alwaysShow()
->help('Please provide sources and credit images that aren\'t yours'),

new Panel('Submission Details', [
Expand Down
2 changes: 1 addition & 1 deletion config/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
|
*/

'default' => env('CACHE_DRIVER', 'file'),
'default' => env('CACHE_DRIVER', 'redis'),

/*
|--------------------------------------------------------------------------
Expand Down
19 changes: 11 additions & 8 deletions resources/js/components/Result.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@
style="white-space: nowrap; overflow-x: hidden; text-overflow: ellipsis;">
<a :href="item.url">{{ item.english_name }}</a>
</p>
<p class="text-muted small"
<p class="text-muted small mb-0"
style="white-space: nowrap; overflow-x: hidden; text-overflow: ellipsis;"
:title="item.foreign_name">
{{ item.foreign_name ? item.foreign_name : '&nbsp;' }}
</p>
<p class="text-muted itemnum"
style="white-space: nowrap; overflow-x: hidden; text-overflow: ellipsis;"
:title="item.product_number">
{{ item.product_number ? item.product_number : '&nbsp;' }}
</p>

<div class="text-center item-image-container">
<a :href="item.url">
Expand All @@ -19,17 +24,15 @@
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item py-1 px-3">
<div class="row small text-muted">
<p class="col m-0 text-left">Brand</p>
<p class="col m-0 text-right">Category</p>
</div>
<div class="d-flex small">
<p class="p-0 m-0 text-left flex-fill" style="white-space: nowrap; overflow-x: ellipsis;">
<p class="p-0 m-0 text-center flex-fill" style="white-space: nowrap; overflow-x: ellipsis;">
<a :href="item.brand.url" :title="item.brand.name">
{{ item.brand.name.substring(0, 21) }}
{{ item.brand.name }}
</a>
</p>
<p class="p-0 m-0 text-right flex-fill" style="white-space: nowrap; overflow-x: hidden;">
</div>
<div class="d-flex small">
<p class="p-0 m-0 text-center small flex-fill" style="white-space: nowrap; overflow-x: hidden;">
<a v-for="category in item.categories" :href="category.url" :title="category.name" class="category">
{{ category.name }}
</a>
Expand Down
2 changes: 1 addition & 1 deletion resources/lang/en/ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
'register' => 'Register',
'name' => 'Name',
'username' => 'Username',
'username_guide' => 'Your username can be english letters, numbers, hyphens (-) and underscores (_).',
'username_guide' => 'Your username can be lowercase english letters, numbers, hyphens (-) and underscores (_).',
'email' => 'E-Mail Address',
'email_txt' => "We'll never share your email with anyone else.",
'pw' => 'Password',
Expand Down
15 changes: 14 additions & 1 deletion resources/sass/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,17 @@ $slider-horizontal-width: 100%;

// Dropdowns
$chosen-svg-up: "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z";
$chosen-svg-down: "M7.41 7.84L12 12.42l4.59-4.58L18 9.25l-6 6-6-6z";
$chosen-svg-down: "M7.41 7.84L12 12.42l4.59-4.58L18 9.25l-6 6-6-6z";

$grid-breakpoints: (
// Extra small screen / phone
xs: 0,
// Small screen / phone
sm: 576px,
// Medium screen / tablet
md: 768px,
// Large screen / desktop
lg: 992px,
// Extra large screen / wide desktop
xl: 1400px
);
4 changes: 4 additions & 0 deletions resources/sass/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ $select-arrow-color: $gray-500;
margin-left: -.25em;
}

.itemnum {
font-size: 0.7em;
}

#slider-wrapper {
padding-left: 20px;
padding-right: 20px;
Expand Down
27 changes: 15 additions & 12 deletions resources/views/items/card.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{{ $item->english_name }}
</a>
</p>
<p class="text-muted small"
<p class="text-muted small mb-0"
title="{{ $item->foreign_name }}"
style="white-space: nowrap; overflow-x: hidden; text-overflow: ellipsis;">
@if ($item->foreign_name)
Expand All @@ -16,6 +16,15 @@
&nbsp;
@endif
</p>
<p class="text-muted itemnum mb-0"
title="{{ $item->product_number }}"
style="white-space: nowrap; overflow-x: hidden; text-overflow: ellipsis;">
@if ($item->product_number)
{{ $item->product_number }}
@else
&nbsp;
@endif
</p>

<div style="height: {{ ($type ?? null) === 'small' ? '7rem' : '14rem' }}" class="text-center">
<a href="{{ $item->url }}">
Expand All @@ -26,22 +35,16 @@
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item py-1 px-3">
<div class="row small text-muted">
<p class="col m-0 text-left">
{{ __('ui.item.brand') }}
</p>
<p class="col m-0 text-right">
{{ __('ui.item.category') }}
</p>
</div>
<div class="d-flex small">
<p class="p-0 m-0 text-left flex-fill" style="white-space: nowrap; overflow-x: ellipsis;">
<p class="p-0 m-0 text-center flex-fill" style="white-space: nowrap; overflow-x: ellipsis;">
<a href="{{ $item->brand->url }}" title="{{ $item->brand->name }}">
{{ Str::limit($item->brand->name, 21) }}
{{$item->brand->name}}
{{-- deliberately chose 21 as the cutoff since lots of brand names fit on word boundaries. --}}
</a>
</p>
<p class="p-0 m-0 text-right flex-fill" style="white-space: nowrap; overflow-x: hidden">
</div>
<div class="d-flex small">
<p class="p-0 m-0 text-center small flex-fill" style="white-space: nowrap; overflow-x: hidden">
@foreach($item->categories as $category)
<a href="{{ $category->url }}" class="category">
{{ $category->name }}
Expand Down
9 changes: 9 additions & 0 deletions resources/views/items/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,15 @@ class="text-regular">{{ $item->published_at->format('jS M Y, H:i') }} UTC
<div class="row">
<h4 class="my-4 px-4">{{ __('ui.item.images') }}</h4>
<div class="item-image-columns mb-5">
@if ($item->image)
<a class="card m-0 p-0" href="{{ cdn_link($item->image) }}"
data-lightbox="show">
<img src="{{ cdn_thumbnail($item->image) }}"
onerror="this.src = '{{ default_asset() }}'"
data-original-url="{{ cdn_thumbnail($item->image) }}"
class="mw-100">
</a>
@endif
@foreach ($item->images as $image)
@isset ($image['attributes']['image'])
<a class="card m-0 p-0" href="{{ cdn_link($image['attributes']['image']) }}"
Expand Down

0 comments on commit c50cbef

Please sign in to comment.