|
| 1 | +<section class="h-full"> |
| 2 | + <div class="bg-gray-100 rounded-xl min-w-[18rem] lg:w-92 flex flex-col max-h-full dark:bg-white/5"> |
| 3 | + <div |
| 4 | + class="p-2 font-semibold border-b border-gray-200 bg-gray-100/80 rounded-t-xl backdrop-blur-xl backdrop-saturate-150 dark:bg-gray-900 dark:text-white dark:border-b-gray-800"> |
| 5 | + <div class="flex items-center justify-between"> |
| 6 | + <a |
| 7 | + href="{{ route('projects.boards.show', [$project, $board]) }}" |
| 8 | + class="border-b border-dotted border-black text-gray-800 dark:text-white"> |
| 9 | + {{ $board->title }} |
| 10 | + </a> |
| 11 | + |
| 12 | + <div x-data="{ open: false }" @click.away="open = false" class="relative"> |
| 13 | + <button |
| 14 | + type="button" |
| 15 | + @click="open = !open" |
| 16 | + class="flex items-center justify-center w-8 h-8 rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-200 dark:text-gray-400 dark:hover:text-gray-200 dark:hover:bg-gray-700 transition" |
| 17 | + > |
| 18 | + <x-heroicon-o-adjustments-vertical class="w-4 h-4" /> |
| 19 | + </button> |
| 20 | + |
| 21 | + <div |
| 22 | + x-show="open" |
| 23 | + x-cloak |
| 24 | + class="absolute right-0 z-50 mt-1 w-52 origin-top-right rounded-lg bg-white dark:bg-gray-800 shadow-lg ring-1 ring-black/5 dark:ring-white/10" |
| 25 | + > |
| 26 | + <div class="p-2"> |
| 27 | + <input |
| 28 | + type="text" |
| 29 | + wire:model.live.debounce.300ms="search" |
| 30 | + placeholder="{{ trans('general.search-items') }}" |
| 31 | + class="w-full rounded-md border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 px-3 py-1.5 text-sm text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-1 focus:ring-brand-500 focus:border-brand-500" |
| 32 | + /> |
| 33 | + </div> |
| 34 | + <div class="border-t border-gray-100 dark:border-gray-700"> |
| 35 | + <div class="py-1"> |
| 36 | + <button |
| 37 | + type="button" |
| 38 | + wire:click="setSortBy('created_at')" |
| 39 | + @click="open = false" |
| 40 | + @class([ |
| 41 | + 'flex w-full items-center gap-2 px-4 py-2 text-sm whitespace-nowrap hover:bg-gray-100 dark:hover:bg-gray-700', |
| 42 | + 'text-brand-500 font-medium' => $sortBy === 'created_at', |
| 43 | + 'text-gray-700 dark:text-gray-300' => $sortBy !== 'created_at', |
| 44 | + ]) |
| 45 | + > |
| 46 | + {{ trans('general.sort-newest') }} |
| 47 | + </button> |
| 48 | + <button |
| 49 | + type="button" |
| 50 | + wire:click="setSortBy('total_votes')" |
| 51 | + @click="open = false" |
| 52 | + @class([ |
| 53 | + 'flex w-full items-center gap-2 px-4 py-2 text-sm whitespace-nowrap hover:bg-gray-100 dark:hover:bg-gray-700', |
| 54 | + 'text-brand-500 font-medium' => $sortBy === 'total_votes', |
| 55 | + 'text-gray-700 dark:text-gray-300' => $sortBy !== 'total_votes', |
| 56 | + ]) |
| 57 | + > |
| 58 | + {{ trans('general.sort-most-voted') }} |
| 59 | + </button> |
| 60 | + <button |
| 61 | + type="button" |
| 62 | + wire:click="setSortBy('last_commented')" |
| 63 | + @click="open = false" |
| 64 | + @class([ |
| 65 | + 'flex w-full items-center gap-2 px-4 py-2 text-sm whitespace-nowrap hover:bg-gray-100 dark:hover:bg-gray-700', |
| 66 | + 'text-brand-500 font-medium' => $sortBy === 'last_commented', |
| 67 | + 'text-gray-700 dark:text-gray-300' => $sortBy !== 'last_commented', |
| 68 | + ]) |
| 69 | + > |
| 70 | + {{ trans('general.sort-last-commented') }} |
| 71 | + </button> |
| 72 | + </div> |
| 73 | + </div> |
| 74 | + </div> |
| 75 | + </div> |
| 76 | + </div> |
| 77 | + </div> |
| 78 | + <ul class="p-2 space-y-2 o overflow-y-auto flex-1 min-h-0"> |
| 79 | + @forelse($items as $item) |
| 80 | + <li> |
| 81 | + <a href="{{ route('projects.items.show', [$project, $item]) }}" |
| 82 | + class="block p-4 space-y-4 bg-white shadow rounded-xl hover:bg-gray-50 dark:bg-gray-900 dark:hover:bg-gray-950"> |
| 83 | + <div class="flex justify-between"> |
| 84 | + <p> |
| 85 | + {{ $item->title }} |
| 86 | + </p> |
| 87 | + |
| 88 | + <div class="flex items-center"> |
| 89 | + @if($item->isPrivate()) |
| 90 | + <span x-data x-tooltip.raw="{{ trans('items.item-private') }}"> |
| 91 | + <x-heroicon-s-lock-closed class="text-gray-500 fill-gray-500 w-5 h-5" /> |
| 92 | + </span> |
| 93 | + @endif |
| 94 | + @if($item->isPinned()) |
| 95 | + <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" |
| 96 | + x-data |
| 97 | + x-tooltip.raw="{{ trans('items.item-pinned') }}" |
| 98 | + class="text-gray-500 fill-gray-500"> |
| 99 | + <path |
| 100 | + d="M15 11.586V6h2V4a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v2h2v5.586l-2.707 1.707A.996.996 0 0 0 6 14v2a1 1 0 0 0 1 1h4v3l1 2 1-2v-3h4a1 1 0 0 0 1-1v-2a.996.996 0 0 0-.293-.707L15 11.586z"></path> |
| 101 | + </svg> |
| 102 | + @endif |
| 103 | + </div> |
| 104 | + </div> |
| 105 | + |
| 106 | + <footer class="flex items-end justify-between"> |
| 107 | + <span |
| 108 | + class="inline-flex items-center justify-center h-6 px-2 text-sm font-semibold tracking-tight text-gray-700 dark:text-gray-300 rounded-full bg-gray-50 dark:bg-gray-600"> |
| 109 | + {{ $item->created_at->isoFormat('ll') }} |
| 110 | + </span> |
| 111 | + |
| 112 | + <div class="text-gray-500 text-sm"> |
| 113 | + {{ $item->total_votes }} {{ trans_choice('messages.votes', $item->total_votes) }} |
| 114 | + </div> |
| 115 | + </footer> |
| 116 | + </a> |
| 117 | + </li> |
| 118 | + @empty |
| 119 | + <li> |
| 120 | + <div |
| 121 | + class="p-3 font-medium text-center text-gray-500 dark:text-gray-400 border border-gray-300 dark:border-gray-400 border-dashed rounded-xl opacity-70"> |
| 122 | + <p>{{ trans('items.no-items') }}</p> |
| 123 | + </div> |
| 124 | + </li> |
| 125 | + @endforelse |
| 126 | + </ul> |
| 127 | + </div> |
| 128 | +</section> |
0 commit comments