fix tags + ui

This commit is contained in:
Andras Bacsai 2024-04-25 15:04:49 +02:00
parent da521020f6
commit 96883dabe3
3 changed files with 17 additions and 14 deletions

View File

@ -71,7 +71,7 @@ class="items-center justify-center box">+ Add New Resource</a>
<div class="max-w-full px-4 truncate box-description" x-text="item.fqdn"></div> <div class="max-w-full px-4 truncate box-description" x-text="item.fqdn"></div>
</div> </div>
</a> </a>
<div class="flex gap-1 pt-1 group-hover:dark:text-white group-hover:text-black group min-h-6"> <div class="flex flex-wrap gap-1 pt-1 group-hover:dark:text-white group-hover:text-black group min-h-6">
<template x-for="tag in item.tags"> <template x-for="tag in item.tags">
<div class="tag" @click.prevent="gotoTag(tag.name)" x-text="tag.name"></div> <div class="tag" @click.prevent="gotoTag(tag.name)" x-text="tag.name"></div>
</template> </template>

View File

@ -1,6 +1,6 @@
<div> <div>
<h2>Tags</h2> <h2>Tags</h2>
<div class="flex gap-2 pt-4"> <div class="flex flex-wrap gap-2 pt-4">
@if (data_get($this->resource, 'tags')) @if (data_get($this->resource, 'tags'))
@forelse (data_get($this->resource,'tags') as $tagId => $tag) @forelse (data_get($this->resource,'tags') as $tagId => $tag)
<div <div
@ -29,7 +29,7 @@ class="inline-block w-3 h-3 rounded cursor-pointer stroke-current hover:bg-red-5
@if (count($tags) > 0) @if (count($tags) > 0)
<h3 class="pt-4">Exisiting Tags</h3> <h3 class="pt-4">Exisiting Tags</h3>
<div>Click to add quickly</div> <div>Click to add quickly</div>
<div class="flex gap-2 pt-4"> <div class="flex flex-wrap gap-2 pt-4">
@foreach ($tags as $tag) @foreach ($tags as $tag)
<x-forms.button wire:click="addTag('{{ $tag->id }}','{{ $tag->name }}')"> <x-forms.button wire:click="addTag('{{ $tag->id }}','{{ $tag->name }}')">
{{ $tag->name }}</x-forms.button> {{ $tag->name }}</x-forms.button>

View File

@ -8,8 +8,7 @@
<div>Available tags</div> <div>Available tags</div>
<div class="flex flex-wrap gap-2 "> <div class="flex flex-wrap gap-2 ">
@forelse ($tags as $oneTag) @forelse ($tags as $oneTag)
<a :class="{{ $tag->id == $oneTag->id }} && 'bg-coollabs hover:bg-coollabs-100'" <a :class="{{ $tag->id == $oneTag->id }} && 'bg-coollabs hover:bg-coollabs-100'" class="w-64 box"
class="w-64 box"
href="{{ route('tags.show', ['tag_name' => $oneTag->name]) }}">{{ $oneTag->name }}</a> href="{{ route('tags.show', ['tag_name' => $oneTag->name]) }}">{{ $oneTag->name }}</a>
@empty @empty
<div>No tags yet defined yet. Go to a resource and add a tag there.</div> <div>No tags yet defined yet. Go to a resource and add a tag there.</div>
@ -28,19 +27,23 @@ class="w-64 box"
</div> </div>
<div class="grid grid-cols-1 gap-2 pt-4 lg:grid-cols-2 xl:grid-cols-3"> <div class="grid grid-cols-1 gap-2 pt-4 lg:grid-cols-2 xl:grid-cols-3">
@foreach ($applications as $application) @foreach ($applications as $application)
<a href="{{ $application->link() }}" class="flex flex-col box group"> <a href="{{ $application->link() }}" class="box group">
<span <div class="flex flex-col">
class="font-bold dark:text-white">{{ $application->project()->name }}/{{ $application->environment->name }}</span> <div class="box-title">{{ $application->project()->name }}/{{ $application->environment->name }}
<span class="dark:text-white ">{{ $application->name }}</span> </div>
<span class="description">{{ $application->description }}</span> <div class="box-description">{{ $application->name }}</div>
<div class="box-description">{{ $application->description }}</div>
</div>
</a> </a>
@endforeach @endforeach
@foreach ($services as $service) @foreach ($services as $service)
<a href="{{ $service->link() }}" class="flex flex-col box group"> <a href="{{ $service->link() }}" class="flex flex-col box group">
<span <div class="flex flex-col">
class="font-bold dark:text-white">{{ $service->project()->name }}/{{ $service->environment->name }}</span> <div class="box-title">{{ $service->project()->name }}/{{ $service->environment->name }}
<span class="dark:text-white ">{{ $service->name }}</span> </div>
<span class="description">{{ $service->description }}</span> <div class="box-description">{{ $service->name }}</div>
<div class="box-description">{{ $service->description }}</div>
</div>
</a> </a>
@endforeach @endforeach
</div> </div>