From ebdc50a6978a79d9eac6ead7dcbbd1f36df17c88 Mon Sep 17 00:00:00 2001
From: Paul Couture <paul@paulcouture.com>
Date: Sun, 17 Dec 2023 21:43:00 +0000
Subject: [PATCH] fix: fixing issues found at launch

---
 docker-compose.yml                                   |  2 +-
 site/app/Http/Controllers/ArtistController.php       |  5 -----
 site/app/Http/Controllers/ArtworkController.php      |  2 +-
 site/app/Http/Controllers/PageController.php         |  4 ++--
 site/app/Models/Artist.php                           |  2 +-
 site/resources/views/artworks/card.blade.php         |  2 +-
 site/resources/views/explore/artworks.blade.php      | 12 ++++++++++++
 site/resources/views/home/leaderboard/card.blade.php | 10 +++++-----
 site/resources/views/partials/nav/head.blade.php     |  2 +-
 site/resources/views/podcasts/podcast.blade.php      |  2 +-
 .../profile/partials/single-artist-card.blade.php    |  2 +-
 11 files changed, 26 insertions(+), 19 deletions(-)

diff --git a/docker-compose.yml b/docker-compose.yml
index a2663b1..373d72e 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -35,7 +35,7 @@ services:
       - "traefik.docker.network=proxy"
       # Entry Point for https
       - "traefik.http.routers.podcastartgen-secure.entrypoints=websecure"
-      - "traefik.http.routers.podcastartgen-secure.rule=Host(`new.noagendaartgenerator.com`)"
+      - "traefik.http.routers.podcastartgen-secure.rule=Host(`www.noagendaartgenerator.com`) || HOST(`noagendaartgenerator.com`)"
       - "traefik.http.routers.podcastartgen-secure.service=podcastartgen-service"
       - "traefik.http.services.podcastartgen-service.loadbalancer.server.port=80"
     links:
diff --git a/site/app/Http/Controllers/ArtistController.php b/site/app/Http/Controllers/ArtistController.php
index e50bebf..5d55c2d 100644
--- a/site/app/Http/Controllers/ArtistController.php
+++ b/site/app/Http/Controllers/ArtistController.php
@@ -31,11 +31,6 @@ public function index()
         ]);
     }
 
-    public function avatar() {
-        $user = auth()->user();
-        return view('')
-    }
-
     /**
      * Show the form for creating a new resource.
      *
diff --git a/site/app/Http/Controllers/ArtworkController.php b/site/app/Http/Controllers/ArtworkController.php
index f62a400..4fb14b6 100644
--- a/site/app/Http/Controllers/ArtworkController.php
+++ b/site/app/Http/Controllers/ArtworkController.php
@@ -30,7 +30,7 @@ public function index()
             ->with('artist')
             ->orderBy('episode_id', 'desc')
             ->orderBy('created_at', 'desc')
-            ->paginate($perPage = 92, $columns = ['*'], $pageName = 'artworks');
+            ->paginate($perPage = 54, $columns = ['*'], $pageName = 'artworks');
         $podcasts = Podcast::where('published', true)->with('episodes')->get();
         return view('explore.artworks', [
             'user' => $user,
diff --git a/site/app/Http/Controllers/PageController.php b/site/app/Http/Controllers/PageController.php
index 0a4dd93..e0a4aa0 100644
--- a/site/app/Http/Controllers/PageController.php
+++ b/site/app/Http/Controllers/PageController.php
@@ -38,7 +38,7 @@ private function mostRecentSubmissions() {
                 ->with('episode')
                 ->with('podcast')
                 ->orderBy('created_at', 'desc')
-                ->limit(50)
+                ->limit(10)
                 ->get();
         });
         return $artworks;
@@ -53,7 +53,7 @@ private function mostRecentEpisodes()
                 ->with('artwork')
                 ->with('artwork.artist')
                 ->orderBy('episode_date', 'desc')
-                ->limit(10)
+                ->limit(5)
                 ->get();
         });
         return $episodes;
diff --git a/site/app/Models/Artist.php b/site/app/Models/Artist.php
index b8ba6ed..7e1f7a9 100644
--- a/site/app/Models/Artist.php
+++ b/site/app/Models/Artist.php
@@ -64,7 +64,7 @@ public function wallets()
     public function avatar()
     {
         if (!$this->avatar) {
-            return asset('resources/img/default_avatars/default_avatar_male.svg');
+            return config('app.static_asset_url') . '/' . ('avatars/default_avatar_male.svg');
         }
         return config('app.static_asset_url') . '/' . $this->avatar;
     }
diff --git a/site/resources/views/artworks/card.blade.php b/site/resources/views/artworks/card.blade.php
index 790e9e3..0b0ef57 100644
--- a/site/resources/views/artworks/card.blade.php
+++ b/site/resources/views/artworks/card.blade.php
@@ -35,7 +35,7 @@
                 class="avatar" data-bs-toggle="tooltip"
                 data-bs-placement="top"
                 title="{{ $thisArtwork->artist->name }}">
-                    <img src="{{ Vite::asset($thisArtwork->artist->avatar ?? 'resources/img/default_avatars/default_avatar_male.svg') }}"
+                    <img src="{{ $thisArtwork->artist->avatar() }}"
                         alt="{{ $thisArtwork->artist->name }}"></a>
             </span>
         </div>
diff --git a/site/resources/views/explore/artworks.blade.php b/site/resources/views/explore/artworks.blade.php
index 4f7bbc6..958cfcd 100644
--- a/site/resources/views/explore/artworks.blade.php
+++ b/site/resources/views/explore/artworks.blade.php
@@ -18,6 +18,18 @@
 </section>
 @endsection
 @section('page-content')
+<div class="container mt-4">
+    <div class="row">
+        <div class="col">
+            <div class="alert alert-success text-success">
+                <p style="color:#20202d;">
+                    <strong style="color:#20202d;">NOTE:</strong> Still working out some bugs, episodes 1613-1616 will be added later today
+                    after the show. You can find those submissions here: <a style="color: #000;" href="https://noagenda.dev/old/">https://noagenda.dev/old/</a>
+                </p>
+            </div>
+        </div>
+    </div>
+</div>
 <section class="pt-120 pb-90 masonary-wrapper-activation">
     <div class="container">
         <div class="row">
diff --git a/site/resources/views/home/leaderboard/card.blade.php b/site/resources/views/home/leaderboard/card.blade.php
index 938f64a..a148be3 100644
--- a/site/resources/views/home/leaderboard/card.blade.php
+++ b/site/resources/views/home/leaderboard/card.blade.php
@@ -2,25 +2,25 @@
     <div class="top-seller-style-two d-flex-between">
         <div class="d-flex-center">
             <div class="thumb-wrapper">
-                <a href="author-profile.html" class="thumb">
-                    <img src="{{ Vite::asset($leaderboardArtist->artist->avatar ?? 'resources/img/default_avatars/default_avatar_male.svg') }}" alt="{{ $leaderboardArtist->artist->name }}"
+                <a href="/artist/{{ $leaderboardArtist->artist->slug }}" class="thumb">
+                    <img src="{{ $leaderboardArtist->artist->avatar() }}" alt="{{ $leaderboardArtist->artist->name }}"
                         title="{{ $leaderboardArtist->artist->name }}">
                 </a>
             </div>
             {{-- End .thumb-wrapper --}}
             {{-- End .thumb --}}
             <div class="content">
-                <h4 class="title pb-1"><a href="author-profile.html">{{ $leaderboardArtist->artist->name }}</a></h4>
+                <h4 class="title pb-1"><a href="/artist/{{ $leaderboardArtist->artist->slug }}">{{ $leaderboardArtist->artist->name }}</a></h4>
                 <span class="price">Chosen {{ $leaderboardArtist->artworkCount }} {{ Str::plural('Time', $leaderboardArtist->artworkCount) }}</span>
             </div>
             {{-- End .content --}}
         </div>
         {{-- End .d-flex-center --}}
-        <a href="author-profile.html" class="items-number d-flex-center flex-column">
+        <a href="/artist/{{ $leaderboardArtist->artist->slug }}" class="items-number d-flex-center flex-column">
             <strong class="pb-1">{{ $leaderboardArtist->position }}<sup>{{ numberSuffix($leaderboardArtist->position) }}</sup></strong>
             <span>Place</span>
         </a>
     </div>
     {{-- End .top-seller-style-two --}}
 </div>
-{{-- End .col --}}
\ No newline at end of file
+{{-- End .col --}}
diff --git a/site/resources/views/partials/nav/head.blade.php b/site/resources/views/partials/nav/head.blade.php
index 8f8a948..0b5c22c 100644
--- a/site/resources/views/partials/nav/head.blade.php
+++ b/site/resources/views/partials/nav/head.blade.php
@@ -58,7 +58,7 @@
                     @if (Auth::user() && Auth::user()->artists->first() && Auth::user()->artists->first()->avatar)
                         src="{{ Auth::user()->artists->first()->avatar() }}"
                     @else
-                        src="{{ Vite::asset('resources/img/default_avatars/default_avatar_male.svg') }}"
+                        src="{{ config('app.static_asset_url') . '/' . ('avatars/default_avatar_male.svg') }}"
                     @endif
                         alt="user avatar"></a>
                     <ul class="submenu">
diff --git a/site/resources/views/podcasts/podcast.blade.php b/site/resources/views/podcasts/podcast.blade.php
index 76ea550..68c6799 100644
--- a/site/resources/views/podcasts/podcast.blade.php
+++ b/site/resources/views/podcasts/podcast.blade.php
@@ -60,7 +60,7 @@
                                     class="avatar" data-bs-toggle="tooltip"
                                     data-bs-placement="top"
                                     title="{{ $episode->artwork->artist->name }}">
-                                        <img src="{{ Vite::asset($episode->artwork->artist->avatar ?? 'resources/img/default_avatars/default_avatar_male.svg') }}"
+                                        <img src="{{ $episode->artwork->artist->avatar() }}"
                                             alt="{{ $episode->artwork->artist->name }}"></a>
                                 </span>
                             </div>
diff --git a/site/resources/views/profile/partials/single-artist-card.blade.php b/site/resources/views/profile/partials/single-artist-card.blade.php
index c16c743..9e4b7ef 100644
--- a/site/resources/views/profile/partials/single-artist-card.blade.php
+++ b/site/resources/views/profile/partials/single-artist-card.blade.php
@@ -3,7 +3,7 @@
         <img src="{{ Vite::asset($artist->header ?? 'resources/img/artist-dark-banner-default.png') }}" alt="{{ $artist->name }}'s Cover Photo" />
     </div>
     <div class="content">
-        <a href="/artist/{{ $artist->slug }}"><img class="author-thumb" src="{{ Vite::asset($artist->avatar ?? 'resources/img/default_avatars/default_avatar_male.svg') }}"
+        <a href="/artist/{{ $artist->slug }}"><img class="author-thumb" src="{{ $artist->avatar() }}"
             alt="{{ $artist->name }}" /></a>
         <h4 class="title"><a href="/artists/{{ $artist->slug }}">{{ $artist->name }}</a></h4>
         <p class="title">{{  $artist->location ?? 'No Agenda Nation' }}</p>