An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
Add tags to show and index views
Andras Bacsai8b58c8f85621
diff --git a/app/Livewire/Tags/Show.php b/app/Livewire/Tags/Show.phpindex 8574646d72..3bb6696154 100644--- a/app/Livewire/Tags/Show.php+++ b/app/Livewire/Tags/Show.php@@ -9,6 +9,7 @@ use Livewire\Component;class Show extends Component{+ public $tags;public Tag $tag;public $applications;public $services;@@ -17,7 +18,8 @@ class Show extends Componentpublic function mount(){- $tag = Tag::ownedByCurrentTeam()->where('name', request()->tag_name)->first();+ $this->tags = Tag::ownedByCurrentTeam()->get()->unique('name')->sortBy('name');+ $tag = $this->tags->where('name', request()->tag_name)->first();if (!$tag) {return redirect()->route('tags.index');}diff --git a/resources/views/livewire/tags/index.blade.php b/resources/views/livewire/tags/index.blade.phpindex 3f70d2d180..221e82a4ab 100644--- a/resources/views/livewire/tags/index.blade.php+++ b/resources/views/livewire/tags/index.blade.php@@ -1,11 +1,14 @@<div><h1>Tags</h1>- <div>Here you can see all the tags here</div>- <div class="flex gap-2 pt-10 flex-wrap">- @forelse ($tags as $tag)- <a class="box" href="{{ route('tags.show', ['tag_name' => $tag->name]) }}">{{ $tag->name }}</a>- @empty- <div>No tags yet defined yet. Go to a resource and add a tag there.</div>- @endforelse+ <div class="flex flex-col gap-2 pb-6 ">+ <div>Available tags: </div>+ <div class="flex flex-wrap gap-2">+ @forelse ($tags as $oneTag)+ <a class="flex items-center justify-center h-6 text-white min-w-14 w-fit hover:no-underline hover:bg-coolgray-200 bg-coolgray-100"+ href="{{ route('tags.show', ['tag_name' => $oneTag->name]) }}">{{ $oneTag->name }}</a>+ @empty+ <div>No tags yet defined yet. Go to a resource and add a tag there.</div>+ @endforelse+ </div></div></div>diff --git a/resources/views/livewire/tags/show.blade.php b/resources/views/livewire/tags/show.blade.phpindex ae318de1ab..fc1a22313f 100644--- a/resources/views/livewire/tags/show.blade.php+++ b/resources/views/livewire/tags/show.blade.php@@ -1,30 +1,44 @@<div><div class="flex items-start gap-2"><div>- <h1>Tag: {{ $tag->name }}</h1>- <div class="pt-2">Tag details</div>+ <h1>Tags</h1></div></div>- <div class="pt-4">+ <div class="flex flex-col gap-2 pb-6 ">+ <div>Available tags: </div>+ <div class="flex flex-wrap gap-2 ">+ @forelse ($tags as $oneTag)+ <a :class="{{ $tag->id == $oneTag->id }} && 'bg-coollabs hover:bg-coollabs-100'"+ class="flex items-center justify-center h-6 text-white min-w-14 w-fit hover:no-underline hover:bg-coolgray-200 bg-coolgray-100"+ href="{{ route('tags.show', ['tag_name' => $oneTag->name]) }}">{{ $oneTag->name }}</a>+ @empty+ <div>No tags yet defined yet. Go to a resource and add a tag there.</div>+ @endforelse+ </div>+ </div>+ <div>+ <h3 class="py-4">Details</h3><div class="flex items-end gap-2 "><div class="w-[500px]"><x-forms.input readonly label="Deploy Webhook URL" id="webhook" /></div>- <x-new-modal buttonTitle="Redeploy All" action="redeploy_all" class="mt-1">+ <x-new-modal isHighlighted buttonTitle="Redeploy All" action="redeploy_all">All resources will be redeployed.</x-new-modal></div><div class="grid grid-cols-1 gap-2 pt-4 lg:grid-cols-2 xl:grid-cols-3">@foreach ($applications as $application)<a href="{{ $application->link() }}" class="flex flex-col box group">- <span class="font-bold text-white">{{ $application->project()->name }}/{{$application->environment->name}}</span>+ <span+ class="font-bold text-white">{{ $application->project()->name }}/{{ $application->environment->name }}</span><span class="text-white ">{{ $application->name }}</span><span class="description">{{ $application->description }}</span></a>@endforeach@foreach ($services as $service)<a href="{{ $service->link() }}" class="flex flex-col box group">- <span class="font-bold text-white">{{ $service->project()->name }}/{{$service->environment->name}}</span>+ <span+ class="font-bold text-white">{{ $service->project()->name }}/{{ $service->environment->name }}</span><span class="text-white ">{{ $service->name }}</span><span class="description">{{ $service->description }}</span></a>