Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
96846d3cf9 | |||
e552dbab07 | |||
346193983f | |||
e25b617327 | |||
b14a77762d | |||
a989f3e92b |
@ -23,6 +23,7 @@ public function index()
|
||||
$user = auth()->user();
|
||||
$artists = Artist::whereHas('artworks')
|
||||
->withCount('artworks')
|
||||
->withCount('episodes')
|
||||
->orderBy('artworks_count', 'desc')
|
||||
->paginate(100);
|
||||
$podcasts = Podcast::where('published', true)->get();
|
||||
@ -65,6 +66,8 @@ public function show(Request $request, $slug)
|
||||
{
|
||||
$user = auth()->user();
|
||||
$artist = Artist::where('slug', $slug)
|
||||
->withCount('episodes')
|
||||
->withCount('artworks')
|
||||
->firstOrFail();
|
||||
$artworks = Artwork::where('artist_id', $artist->id)
|
||||
->with('episode')
|
||||
|
@ -90,6 +90,9 @@ public function approve(Request $request)
|
||||
'artwork_id' => 'required|exists:artworks,id'
|
||||
]);
|
||||
$artwork = Artwork::find($request->artwork_id);
|
||||
if ($artwork->artist_id == $user->artists->first()->id) {
|
||||
return redirect('/approve-artwork');
|
||||
}
|
||||
if (is_null($artwork->approved_by)) {
|
||||
$artwork->approved_by = $user->artists->first()->id;
|
||||
$artwork->save();
|
||||
@ -123,9 +126,20 @@ public function store(Request $request): RedirectResponse
|
||||
$episode = $podcast->episodes->first();
|
||||
$artist = auth()->user()->artists()->first();
|
||||
$rawFile = $request->file('file');
|
||||
$filename = now()->format('Y')
|
||||
$yearDirectory = now()->format('Y');
|
||||
$monthDirectory = now()->format('m');
|
||||
$indexPath = $yearDirectory . '/' . $monthDirectory . '/index.htm';
|
||||
$imgDirExists = Storage::disk('static')->exists('artworks/' . $indexPath);
|
||||
$thumbDirExists = Storage::disk('static')->exists('thumbnails/' . $indexPath);
|
||||
if (!$imgDirExists) {
|
||||
Storage::disk('static')->put('artworks/' . $indexPath, '');
|
||||
}
|
||||
if (!$thumbDirExists) {
|
||||
Storage::disk('static')->put('thumbnails/' . $indexPath, '');
|
||||
}
|
||||
$filename = $yearDirectory
|
||||
. '/'
|
||||
. now()->format('m')
|
||||
. $monthDirectory
|
||||
. '/'
|
||||
. Str::slug($artist->name)
|
||||
. '-'
|
||||
@ -140,17 +154,16 @@ public function store(Request $request): RedirectResponse
|
||||
'overlay_id' => null,
|
||||
'podcast_id' => $podcast->id,
|
||||
'episode_id' => $episode->id,
|
||||
//'approved_by' => 4,
|
||||
'filename' => $filename,
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
])->create();
|
||||
$img = Image::make($rawFile)->resize(3000, null, function($constraint){
|
||||
$img = Image::make($rawFile)->resize(3000, null, function($constraint) {
|
||||
$constraint->aspectRatio();
|
||||
})
|
||||
->encode('jpg', 100)
|
||||
->save(Storage::disk('static')->path('/artworks') . '/' . $artwork->filename);
|
||||
$thumbImg = Image::make($request->file('file'))->resize(512, null, function($constraint){
|
||||
$thumbImg = Image::make($request->file('file'))->resize(512, null, function($constraint) {
|
||||
$constraint->aspectRatio();
|
||||
})
|
||||
->encode('jpg', 100)
|
||||
|
@ -21,7 +21,7 @@ public function show(Request $request, $slug)
|
||||
$episodes = Episode::where('published', true)
|
||||
->whereNotNull('artwork_id')
|
||||
->with('artwork')
|
||||
->with('artworks')
|
||||
->with('approvedArtworks')
|
||||
->where('podcast_id', $podcast->id)
|
||||
->orderBy('episode_number', 'desc')->paginate(100);
|
||||
$podcasts = Podcast::where('published', true)->with('episodes')->get();
|
||||
|
36
site/app/Jobs/OptimizeArtistHeaderJob.php
Normal file
36
site/app/Jobs/OptimizeArtistHeaderJob.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use ImageOptimizer;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class OptimizeArtistHeaderJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
private $path;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*/
|
||||
public function __construct($path)
|
||||
{
|
||||
$this->path = $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
Log::info('Header: Optimizing ' . $this->path);
|
||||
ImageOptimizer::optimize($this->path);
|
||||
}
|
||||
}
|
36
site/app/Jobs/OptimizeAvatarJob.php
Normal file
36
site/app/Jobs/OptimizeAvatarJob.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use ImageOptimizer;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class OptimizeAvatarJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
private $path;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*/
|
||||
public function __construct($path)
|
||||
{
|
||||
$this->path = $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
Log::info('Avatar: Optimizing ' . $this->path);
|
||||
ImageOptimizer::optimize($this->path);
|
||||
}
|
||||
}
|
@ -11,6 +11,8 @@
|
||||
use Illuminate\Validation\Rules\File;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Jobs\OptimizeAvatarJob;
|
||||
|
||||
class Avatar extends Component
|
||||
{
|
||||
@ -32,7 +34,6 @@ public function save()
|
||||
{
|
||||
$disk = Storage::disk('static');
|
||||
$avatar = $this->avatar->store('avatars', 'static');
|
||||
|
||||
Image::load($disk->path($avatar))
|
||||
->manualCrop($this->width, $this->height, $this->x, $this->y)
|
||||
->save();
|
||||
@ -40,7 +41,9 @@ public function save()
|
||||
->width(350)
|
||||
->height(350)
|
||||
->save();
|
||||
ImageOptimizer::optimize($disk->path($avatar));
|
||||
Log::info('Avatar: Optimizing ' . $disk->path($avatar));
|
||||
OptimizeAvatarJob::dispatchSync($disk->path($avatar));
|
||||
//ImageOptimizer::optimize($disk->path($avatar));
|
||||
auth()->user()->artists()->first()->update(compact('avatar'));
|
||||
$this->avatar = null;
|
||||
return redirect(request()->header('Referer'));
|
||||
|
@ -11,6 +11,8 @@
|
||||
use Illuminate\Validation\Rules\File;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Jobs\OptimizeArtistHeaderJob;
|
||||
|
||||
class Header extends Component
|
||||
{
|
||||
@ -32,7 +34,6 @@ public function save()
|
||||
{
|
||||
$disk = Storage::disk('static');
|
||||
$header = $this->header->store('artist_headers', 'static');
|
||||
|
||||
Image::load($disk->path($header))
|
||||
->manualCrop($this->width, $this->height, $this->x, $this->y)
|
||||
->save();
|
||||
@ -40,7 +41,8 @@ public function save()
|
||||
->width(270)
|
||||
->height(185)
|
||||
->save();
|
||||
ImageOptimizer::optimize($disk->path($header));
|
||||
Log::info('Avatar: Optimizing ' . $disk->path($header));
|
||||
OptimizeArtistHeaderJob::dispatchSync($disk->path($header));
|
||||
auth()->user()->artists()->first()->update(compact('header'));
|
||||
$this->header = null;
|
||||
return redirect(request()->header('Referer'));
|
||||
|
1754
site/composer.lock
generated
1754
site/composer.lock
generated
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
function c(){return{collapsedGroups:[],isLoading:!1,selectedRecords:[],shouldCheckUniqueSelection:!0,init:function(){this.$wire.$on("deselectAllTableRecords",()=>this.deselectAllRecords()),this.$watch("selectedRecords",()=>{if(!this.shouldCheckUniqueSelection){this.shouldCheckUniqueSelection=!0;return}this.selectedRecords=[...new Set(this.selectedRecords)],this.shouldCheckUniqueSelection=!1})},mountBulkAction:function(e){this.$wire.set("selectedTableRecords",this.selectedRecords,!1),this.$wire.mountTableBulkAction(e)},toggleSelectRecordsOnPage:function(){let e=this.getRecordsOnPage();if(this.areRecordsSelected(e)){this.deselectRecords(e);return}this.selectRecords(e)},toggleSelectRecordsInGroup:async function(e){if(this.isLoading=!0,this.areRecordsSelected(this.getRecordsInGroupOnPage(e))){this.deselectRecords(await this.$wire.getGroupedSelectableTableRecordKeys(e));return}this.selectRecords(await this.$wire.getGroupedSelectableTableRecordKeys(e)),this.isLoading=!1},getRecordsInGroupOnPage:function(e){let s=[];for(let t of this.$root.getElementsByClassName("fi-ta-record-checkbox"))t.dataset.group===e&&s.push(t.value);return s},getRecordsOnPage:function(){let e=[];for(let s of this.$root.getElementsByClassName("fi-ta-record-checkbox"))e.push(s.value);return e},selectRecords:function(e){for(let s of e)this.isRecordSelected(s)||this.selectedRecords.push(s)},deselectRecords:function(e){for(let s of e){let t=this.selectedRecords.indexOf(s);t!==-1&&this.selectedRecords.splice(t,1)}},selectAllRecords:async function(){this.isLoading=!0,this.selectedRecords=await this.$wire.getAllSelectableTableRecordKeys(),this.isLoading=!1},deselectAllRecords:function(){this.selectedRecords=[]},isRecordSelected:function(e){return this.selectedRecords.includes(e)},areRecordsSelected:function(e){return e.every(s=>this.isRecordSelected(s))},toggleCollapseGroup:function(e){if(this.isGroupCollapsed(e)){this.collapsedGroups.splice(this.collapsedGroups.indexOf(e),1);return}this.collapsedGroups.push(e)},isGroupCollapsed:function(e){return this.collapsedGroups.includes(e)},resetCollapsedGroups:function(){this.collapsedGroups=[]}}}export{c as default};
|
||||
function c(){return{collapsedGroups:[],isLoading:!1,selectedRecords:[],shouldCheckUniqueSelection:!0,init:function(){this.$wire.$on("deselectAllTableRecords",()=>this.deselectAllRecords()),this.$watch("selectedRecords",()=>{if(!this.shouldCheckUniqueSelection){this.shouldCheckUniqueSelection=!0;return}this.selectedRecords=[...new Set(this.selectedRecords)],this.shouldCheckUniqueSelection=!1})},mountAction:function(e,s=null){this.$wire.set("selectedTableRecords",this.selectedRecords,!1),this.$wire.mountTableAction(e,s)},mountBulkAction:function(e){this.$wire.set("selectedTableRecords",this.selectedRecords,!1),this.$wire.mountTableBulkAction(e)},toggleSelectRecordsOnPage:function(){let e=this.getRecordsOnPage();if(this.areRecordsSelected(e)){this.deselectRecords(e);return}this.selectRecords(e)},toggleSelectRecordsInGroup:async function(e){if(this.isLoading=!0,this.areRecordsSelected(this.getRecordsInGroupOnPage(e))){this.deselectRecords(await this.$wire.getGroupedSelectableTableRecordKeys(e));return}this.selectRecords(await this.$wire.getGroupedSelectableTableRecordKeys(e)),this.isLoading=!1},getRecordsInGroupOnPage:function(e){let s=[];for(let t of this.$root?.getElementsByClassName("fi-ta-record-checkbox")??[])t.dataset.group===e&&s.push(t.value);return s},getRecordsOnPage:function(){let e=[];for(let s of this.$root?.getElementsByClassName("fi-ta-record-checkbox")??[])e.push(s.value);return e},selectRecords:function(e){for(let s of e)this.isRecordSelected(s)||this.selectedRecords.push(s)},deselectRecords:function(e){for(let s of e){let t=this.selectedRecords.indexOf(s);t!==-1&&this.selectedRecords.splice(t,1)}},selectAllRecords:async function(){this.isLoading=!0,this.selectedRecords=await this.$wire.getAllSelectableTableRecordKeys(),this.isLoading=!1},deselectAllRecords:function(){this.selectedRecords=[]},isRecordSelected:function(e){return this.selectedRecords.includes(e)},areRecordsSelected:function(e){return e.every(s=>this.isRecordSelected(s))},toggleCollapseGroup:function(e){if(this.isGroupCollapsed(e)){this.collapsedGroups.splice(this.collapsedGroups.indexOf(e),1);return}this.collapsedGroups.push(e)},isGroupCollapsed:function(e){return this.collapsedGroups.includes(e)},resetCollapsedGroups:function(){this.collapsedGroups=[]}}}export{c as default};
|
||||
|
File diff suppressed because one or more lines are too long
@ -68,11 +68,15 @@ class="avatar" data-bs-toggle="tooltip"
|
||||
</div>
|
||||
{{-- End .product-owner --}}
|
||||
<div class="action-wrapper py-5 d-flex align-items-center justify-content-center">
|
||||
@if (auth()->user()->artists->first()->id != $thisArtwork->artist_id)
|
||||
<form action="/approve-artworks" method="POST" class="approve-artwork-form" name="approve-artwork-{{ $thisArtwork->id}}" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<input name="artwork_id" type="hidden" value="{{ $thisArtwork->id }}">
|
||||
<button type="submit" class="btn btn-gradient btn-medium justify-content-center"><span>Approve and Publish</span></button>
|
||||
</form>
|
||||
@else
|
||||
<p>You cannot approve your own</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -2,7 +2,9 @@
|
||||
|
||||
@section('page-title', $pageTitle)
|
||||
|
||||
@if (!is_null($episode->artwork))
|
||||
@section('meta_og_img', config('app.static_asset_url') . '/thumbnails/' . $episode->artwork->filename)
|
||||
@endif
|
||||
|
||||
@section('meta_description', 'Artwork for the ' . $episode->podcast->name . ' podcast, episode ' . $episode->episode_number + 0 . ' by ' . $episode->artwork->artist->name)
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
</h1>
|
||||
<p data-aos="fade-up" data-aos-delay="100">
|
||||
A community collaboration producing the best podcast album art in the universe!<br>
|
||||
Once discussed on <em>The Joe Rogan Experience</em>, sadly,<br>
|
||||
Young Jamie was not asked to pull this up.
|
||||
Once discussed on <em>The Joe Rogan Experience</em>, sadly, young Jamie was not<br>
|
||||
asked to pull this up.
|
||||
</p>
|
||||
<div class="group-btn mt-8" data-aos="fade-up" data-aos-delay="200">
|
||||
<a href="/artworks" class="btn btn-gradient">
|
||||
|
@ -107,6 +107,7 @@ functionality, it took a few days to stabilize the cacheing and hardware, but yo
|
||||
<ul>
|
||||
<li><a class="d-block" href="http://dvorak.org/NA">Support the Show</a><span class="cate small">First and Foremost, support our boys.</span></li>
|
||||
<li><a class="d-block" href="https://paypal.me/caincouture">PayPal Me</a><span class="cate small">@CainCouture and buy me a coffee - or twelve.</span></li>
|
||||
<li><a class="d-block" href="https://venmo.com/ucturtle">Venmo</a><span class="cate small">@ucturtle if you prefer.</span></li>
|
||||
<li><a class="d-block" href="https://getalby.com/p/pcouture">V4V: ⚡pcouture@getalby.com</a><span class="cate small">Use the lightning network.</span></li>
|
||||
<li><a class="d-block" href="https://static.noagendaartgenerator.com/assets/img/btc-naart-qr.png">Crypto: <i class="ri-btc-line"></i> Old School BTC</a><span class="cate small">bc1qvkm9fpycc8q99kudqwukd8cf8xgxdrhp6a5zl8</span></li>
|
||||
</ul>
|
||||
|
@ -25,7 +25,7 @@
|
||||
<h4>Community</h4>
|
||||
<ul class="footer-list-widget">
|
||||
<li><a href="https://noagendashow.net">No Agenda Show</a></li>
|
||||
<li><a href="https://noagendasocial.com/">No Agenda Social</a></li>
|
||||
<li><a href="https://noauthority.social/">No Authority Social</a></li>
|
||||
<li><a href="https://noagendastream.com">No Agenda Stream</a></li>
|
||||
<li><a href="http://listen.noagendastream.com/">Alternate Stream Link</a></li>
|
||||
<li><a href="http://noagendanation.com/">No Agenda Nation</a></li>
|
||||
@ -51,7 +51,7 @@
|
||||
<ul class="footer-list-widget">
|
||||
<li><a href="https://dvorak.org/na">Donate to the No Agenda Podcast</a></li>
|
||||
<li><a rel="me" href="/support-development">Support The Generator</a></li>
|
||||
<li><a rel="me" href="https://noagendasocial.com/@SirPaulCouture">Argue with me on NA Social</a></li>
|
||||
<li><a rel="me" href="https://noauthority.social/@SirPaulCouture">Argue with me on NA Social</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -70,7 +70,7 @@ class="avatar" data-bs-toggle="tooltip"
|
||||
</span>
|
||||
</div>
|
||||
<div class="action-wrapper py-1 mb-1 d-flex-between">
|
||||
<span class="bid-owner">{{ number_format($episode->artworks->count()) }} Artworks Submitted</span>
|
||||
<span class="bid-owner">{{ number_format($episode->approvedArtworks->count()) }} Artworks Submitted</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -7,7 +7,9 @@
|
||||
alt="{{ $artist->name }}" /></a>
|
||||
<h4 class="title"><a href="/artist/{{ $artist->slug }}">{{ $artist->name }}</a></h4>
|
||||
<p class="title">{{ $artist->location ?? 'No Agenda Nation' }}</p>
|
||||
@if ($artist->artworks->count())
|
||||
<p class="title">Artist For {{ $artist->artworks->sortBy('created_at')->first()->created_at->diffForHumans(now(), Carbon\CarbonInterface::DIFF_ABSOLUTE) }}</p>
|
||||
@endif
|
||||
@if ($artist->bio)
|
||||
<h4>Bio:</h4>
|
||||
<p>{{ nl2br($artist->bio) }}</p>
|
||||
@ -21,7 +23,8 @@
|
||||
@endif
|
||||
</div>
|
||||
<div class="size-small justify-content-center mb-4">
|
||||
{{ number_format($artist->artworks->count()) }} Submitted Artworks
|
||||
{{ number_format($artist->artworks_count) }} Submitted Artworks<br>
|
||||
{{ number_format($artist->episodes_count) }} Artworks Selected
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -29,7 +29,7 @@
|
||||
<x-input-error class="mt-2" :messages="$errors->get('alby')" />
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
<x-input-label for="nasocial" :value="__('No Agenda Social Account')" />
|
||||
<x-input-label for="nasocial" :value="__('No Authority Social Account')" />
|
||||
<x-text-input id="nasocial" name="nasocial" type="text" class="mt-1 block w-full" :value="old('nasocial', $user->artists->first()->nasocial)" required autocomplete="naasocial" />
|
||||
<x-input-error class="mt-2" :messages="$errors->get('nasocial')" />
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user