diff --git a/site/app/Livewire/Artist/Avatar.php b/site/app/Livewire/Artist/Avatar.php index 2dd0fda..7076efe 100644 --- a/site/app/Livewire/Artist/Avatar.php +++ b/site/app/Livewire/Artist/Avatar.php @@ -36,6 +36,10 @@ public function save() Image::load($disk->path($avatar)) ->manualCrop($this->width, $this->height, $this->x, $this->y) ->save(); + Image::load($disk->path($avatar)) + ->width(350) + ->height(350) + ->save(); ImageOptimizer::optimize($disk->path($avatar)); auth()->user()->artists()->first()->update(compact('avatar')); $this->avatar = null; diff --git a/site/app/Livewire/Artist/Header.php b/site/app/Livewire/Artist/Header.php new file mode 100644 index 0000000..ae5cae5 --- /dev/null +++ b/site/app/Livewire/Artist/Header.php @@ -0,0 +1,48 @@ +header->store('artist_headers', 'static'); + + Image::load($disk->path($header)) + ->manualCrop($this->width, $this->height, $this->x, $this->y) + ->save(); + Image::load($disk->path($header)) + ->width(270) + ->height(185) + ->save(); + ImageOptimizer::optimize($disk->path($header)); + auth()->user()->artists()->first()->update(compact('header')); + $this->header = null; + return redirect(request()->header('Referer')); + } +} diff --git a/site/app/Models/Artist.php b/site/app/Models/Artist.php index 7e1f7a9..15d7634 100644 --- a/site/app/Models/Artist.php +++ b/site/app/Models/Artist.php @@ -64,9 +64,17 @@ public function wallets() public function avatar() { if (!$this->avatar) { - return config('app.static_asset_url') . '/' . ('avatars/default_avatar_male.svg'); + return config('app.static_asset_url') . '/avatars/default_avatar_male.svg'; } return config('app.static_asset_url') . '/' . $this->avatar; } + public function header() + { + if (!$this->header) { + return config('app.static_asset_url') . '/artist_headers/default_artist_banner.png'; + } + return config('app.static_asset_url') . '/' . $this->header; + } + } diff --git a/site/resources/views/livewire/artist/avatar.blade.php b/site/resources/views/livewire/artist/avatar.blade.php index 77fcb8f..977cf4f 100644 --- a/site/resources/views/livewire/artist/avatar.blade.php +++ b/site/resources/views/livewire/artist/avatar.blade.php @@ -21,7 +21,7 @@ class="d-flex flex-column justify-content-center" x-init="setUp" >
- +
+
+ + @else +
+ +
+
+ +
+ @endif + diff --git a/site/resources/views/partials/nav/head.blade.php b/site/resources/views/partials/nav/head.blade.php index 60a6b9b..4601936 100644 --- a/site/resources/views/partials/nav/head.blade.php +++ b/site/resources/views/partials/nav/head.blade.php @@ -77,9 +77,6 @@ @endif - @if (auth()->user()) - - @else
  • - @endif
  • - is(['artists', 'artists/*']) ? 'class="active"' : '' !!} href="/artists">Artists + is(['artists', 'artists/*', 'artist', 'artist/*', 'profile']) ? 'class="active"' : '' !!} href="/artists">Artists
  • @if (auth()->user())
  • diff --git a/site/resources/views/profile/edit.blade.php b/site/resources/views/profile/edit.blade.php index 5aab319..27a62f0 100644 --- a/site/resources/views/profile/edit.blade.php +++ b/site/resources/views/profile/edit.blade.php @@ -27,6 +27,9 @@
    @include('profile.partials.update-avatar-form')
    +
    + @include('profile.partials.update-header-form') +
    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 d0e87f0..58cfd76 100644 --- a/site/resources/views/profile/partials/single-artist-card.blade.php +++ b/site/resources/views/profile/partials/single-artist-card.blade.php @@ -1,6 +1,6 @@
    - {{ $artist->name }}'s Cover Photo + {{ $artist->name }}'s Cover Photo
    +
    diff --git a/site/resources/views/profile/partials/update-header-form.blade.php b/site/resources/views/profile/partials/update-header-form.blade.php new file mode 100644 index 0000000..d3377ee --- /dev/null +++ b/site/resources/views/profile/partials/update-header-form.blade.php @@ -0,0 +1,18 @@ +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    diff --git a/site/resources/views/profile/partials/update-password-form.blade.php b/site/resources/views/profile/partials/update-password-form.blade.php index 38cbbc7..dc0ecc6 100644 --- a/site/resources/views/profile/partials/update-password-form.blade.php +++ b/site/resources/views/profile/partials/update-password-form.blade.php @@ -1,9 +1,9 @@ -
    +
    diff --git a/site/resources/views/profile/partials/update-profile-information-form.blade.php b/site/resources/views/profile/partials/update-profile-information-form.blade.php index e1dde59..8b31293 100644 --- a/site/resources/views/profile/partials/update-profile-information-form.blade.php +++ b/site/resources/views/profile/partials/update-profile-information-form.blade.php @@ -1,9 +1,9 @@ -
    +