Profile: store covers in object storage (WebP); add covers config; remember artworks categories content-type preference
This commit is contained in:
@@ -10,7 +10,7 @@ class BrowseCategoriesController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
$contentTypes = \App\Models\ContentType::with(['rootCategories.children'])->orderBy('id')->get();
|
||||
$contentTypes = \App\Models\ContentType::with(['rootCategories.children'])->ordered()->get();
|
||||
|
||||
$categoriesByType = [];
|
||||
$categories = collect();
|
||||
|
||||
@@ -17,7 +17,7 @@ use Illuminate\Pagination\AbstractCursorPaginator;
|
||||
|
||||
class BrowseGalleryController extends \App\Http\Controllers\Controller
|
||||
{
|
||||
private const CONTENT_TYPE_SLUGS = ['photography', 'wallpapers', 'skins', 'other'];
|
||||
private const CONTENT_TYPE_SLUGS = ['photography', 'wallpapers', 'skins', 'other', 'digital-art'];
|
||||
|
||||
/**
|
||||
* Meilisearch sort-field arrays per sort alias.
|
||||
@@ -108,7 +108,7 @@ class BrowseGalleryController extends \App\Http\Controllers\Controller
|
||||
'sort_options' => self::SORT_OPTIONS,
|
||||
'hero_title' => 'Browse Artworks',
|
||||
'hero_description' => 'List of all uploaded artworks across Skins, Wallpapers, Photography, and Other.',
|
||||
'breadcrumbs' => collect(),
|
||||
'breadcrumbs' => collect([(object) ['name' => 'Explore', 'url' => '/browse']]),
|
||||
'page_title' => 'Browse Uploaded Artworks - Photography, Wallpapers and Skins at SkinBase',
|
||||
'page_meta_description' => "Browse Uploaded Photography, Wallpapers and Skins to one of the world's oldest online social community for artists and art enthusiasts.",
|
||||
'page_meta_keywords' => 'photography, wallpapers, skins, stock, browse, social, community, artist, picture, photo',
|
||||
@@ -164,7 +164,10 @@ class BrowseGalleryController extends \App\Http\Controllers\Controller
|
||||
'sort_options' => self::SORT_OPTIONS,
|
||||
'hero_title' => $contentType->name,
|
||||
'hero_description' => $contentType->description ?? ($contentType->name . ' artworks on Skinbase.'),
|
||||
'breadcrumbs' => collect([(object) ['name' => $contentType->name, 'url' => '/' . $contentSlug]]),
|
||||
'breadcrumbs' => collect([
|
||||
(object) ['name' => 'Explore', 'url' => '/browse'],
|
||||
(object) ['name' => $contentType->name, 'url' => '/' . $contentSlug],
|
||||
]),
|
||||
'page_title' => $contentType->name . ' – Skinbase Nova',
|
||||
'page_meta_description' => $contentType->description ?? ('Discover the best ' . $contentType->name . ' artworks on Skinbase'),
|
||||
'page_meta_keywords' => strtolower($contentType->slug) . ', skinbase, artworks, wallpapers, skins, photography',
|
||||
@@ -204,8 +207,17 @@ class BrowseGalleryController extends \App\Http\Controllers\Controller
|
||||
$subcategories = $rootCategories;
|
||||
}
|
||||
|
||||
$breadcrumbs = collect($category->breadcrumbs)
|
||||
->map(function (Category $crumb) {
|
||||
$breadcrumbs = collect(array_merge([
|
||||
(object) [
|
||||
'name' => 'Explore',
|
||||
'url' => '/browse',
|
||||
],
|
||||
(object) [
|
||||
'name' => $contentType->name,
|
||||
'url' => '/' . $contentSlug,
|
||||
],
|
||||
], $category->breadcrumbs))
|
||||
->map(function ($crumb) {
|
||||
return (object) [
|
||||
'name' => $crumb->name,
|
||||
'url' => $crumb->url,
|
||||
@@ -344,7 +356,8 @@ class BrowseGalleryController extends \App\Http\Controllers\Controller
|
||||
|
||||
private function mainCategories(): Collection
|
||||
{
|
||||
return ContentType::orderBy('id')
|
||||
return ContentType::ordered()
|
||||
->whereIn('slug', self::CONTENT_TYPE_SLUGS)
|
||||
->get(['name', 'slug'])
|
||||
->map(function (ContentType $type) {
|
||||
return (object) [
|
||||
|
||||
@@ -225,7 +225,7 @@ final class ExploreController extends Controller
|
||||
|
||||
private function mainCategories(): Collection
|
||||
{
|
||||
$categories = ContentType::orderBy('id')
|
||||
$categories = ContentType::ordered()
|
||||
->get(['name', 'slug'])
|
||||
->map(fn ($ct) => (object) [
|
||||
'name' => $ct->name,
|
||||
|
||||
@@ -24,7 +24,7 @@ class SectionsController extends Controller
|
||||
->orderBy('sort_order')
|
||||
->orderBy('name');
|
||||
},
|
||||
])->orderBy('id')->get();
|
||||
])->ordered()->get();
|
||||
|
||||
// Total artwork counts per content type via a single aggregation query
|
||||
$artworkCountsByType = DB::table('artworks')
|
||||
|
||||
@@ -73,7 +73,7 @@ final class TagController extends Controller
|
||||
$artworks->getCollection()->each(fn($m) => $m->loadMissing(['user.profile', 'categories']));
|
||||
|
||||
// Sidebar: main content type links (same as browse gallery)
|
||||
$mainCategories = ContentType::orderBy('id')->get(['name', 'slug'])
|
||||
$mainCategories = ContentType::ordered()->get(['name', 'slug'])
|
||||
->map(fn ($type) => (object) [
|
||||
'id' => $type->id,
|
||||
'name' => $type->name,
|
||||
|
||||
Reference in New Issue
Block a user