Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions app/Livewire/AlternativeList.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ public function render()
$query->where('name', 'like', "%{$this->search}%");
});
});
})
->when($this->filter, function ($query): void {
$query->whereHas('tagsRelation', function ($query): void {
$query->where('tags.id', $this->filter);
});
})
->when($this->order, function ($query): void {
$query->orderBy('name', $this->order);
});
// ->when($this->filter, function ($query): void {
// $query->whereHas('tagsRelation', function ($query): void {
// $query->where('tags.id', $this->filter);
// });
// })
// ->when($this->order, function ($query): void {
// $query->orderBy('name', $this->order);
// })

$alternatives = $query->simplePaginate(20,
['alternatives.id', 'name', 'description', 'slug', 'image_path']);
Expand Down
22 changes: 12 additions & 10 deletions app/Livewire/CompanyList.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,20 @@ public function render()
$query->where('name', 'like', "%{$this->search}%");
});
});
})
->when($this->filter, function ($query): void {
$query->whereHas('tagsRelation', function ($query): void {
$query->where('tags.id', $this->filter);
});
})
->when($this->order, function ($query): void {
$query->orderBy('name', $this->order);
});
// ->when($this->filter, function ($query): void {
// $query->whereHas('tagsRelation', function ($query): void {
// $query->where('tags.id', $this->filter);
// });
// })
// ->when($this->order, function ($query): void {
// $query->orderBy('name', $this->order);
// })

$companies = $query->simplePaginate(20,
['companies.id', 'name', 'description', 'short_description', 'slug', 'image_path']);
$companies = $query->simplePaginate(
20,
['companies.id', 'name', 'description', 'short_description', 'slug', 'image_path']
);

return view('livewire.company-list', [
'companies' => $companies,
Expand Down
2 changes: 1 addition & 1 deletion resources/views/companies/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class="size-4"
d="M18.364 18.364A9 9 0 0 0 5.636 5.636m12.728 12.728A9 9 0 0 1 5.636 5.636m12.728 12.728L5.636 5.636"
/>
</svg>
BOYCOTT
Israeli Company
</span>
</h1>

Expand Down
76 changes: 63 additions & 13 deletions resources/views/investors/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,73 @@ class="h-40 w-40 rounded-lg object-cover"
class="relative overflow-hidden rounded-xl border border-gray-200 shadow-sm transition-all hover:shadow-md"
>
<div class="">
<!-- Boycott Badge -->
<!-- Boycott Badge with tooltip -->
<div
class="absolute right-2 top-2 z-10 flex items-center rounded-full bg-red-600 px-2 py-1 text-xs font-bold text-white"
x-data="{
tooltipVisible: false,
tooltipText: 'Israeli Company',
tooltipArrow: true,
tooltipPosition: 'left',
}"
x-init="
$refs.content.addEventListener('mouseenter', () => {
tooltipVisible = true
})
$refs.content.addEventListener('mouseleave', () => {
tooltipVisible = false
})
"
class="absolute right-2 top-2 z-20"
>
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-3 w-3"
viewBox="0 0 20 20"
fill="currentColor"
<div
x-ref="tooltip"
x-show="tooltipVisible"
:class="{ 'top-0 left-1/2 -translate-x-1/2 -mt-0.5 -translate-y-full' : tooltipPosition == 'top', 'top-1/2 -translate-y-1/2 -ml-0.5 left-0 -translate-x-full' : tooltipPosition == 'left', 'bottom-0 left-1/2 -translate-x-1/2 -mb-0.5 translate-y-full' : tooltipPosition == 'bottom', 'top-1/2 -translate-y-1/2 -mr-0.5 right-0 translate-x-full' : tooltipPosition == 'right' }"
class="absolute w-auto text-sm"
x-cloak
>
<path
fill-rule="evenodd"
d="M13.477 14.89A6 6 0 015.11 6.524l8.367 8.368zm1.414-1.414L6.524 5.11a6 6 0 018.367 8.367z"
clip-rule="evenodd"
/>
</svg>
<div
x-show="tooltipVisible"
x-transition
class="relative rounded bg-black bg-opacity-90 px-2 py-1 text-white shadow-lg"
>
<p
x-text="tooltipText"
class="block flex-shrink-0 whitespace-nowrap text-xs"
></p>
<div
x-ref="tooltipArrow"
x-show="tooltipArrow"
:class="{ 'bottom-0 -translate-x-1/2 left-1/2 w-2.5 translate-y-full' : tooltipPosition == 'top', 'right-0 -translate-y-1/2 top-1/2 h-2.5 -mt-px translate-x-full' : tooltipPosition == 'left', 'top-0 -translate-x-1/2 left-1/2 w-2.5 -translate-y-full' : tooltipPosition == 'bottom', 'left-0 -translate-y-1/2 top-1/2 h-2.5 -mt-px -translate-x-full' : tooltipPosition == 'right' }"
class="absolute inline-flex items-center justify-center overflow-hidden"
>
<div
:class="{ 'origin-top-left -rotate-45' : tooltipPosition == 'top', 'origin-top-left rotate-45' : tooltipPosition == 'left', 'origin-bottom-left rotate-45' : tooltipPosition == 'bottom', 'origin-top-right -rotate-45' : tooltipPosition == 'right' }"
class="h-1.5 w-1.5 transform bg-black bg-opacity-90"
></div>
</div>
</div>
</div>

<div
x-ref="content"
class="relative flex cursor-pointer items-center rounded-full bg-red-600 px-2 py-1 text-xs font-bold text-white"
>
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-3 w-3"
viewBox="0 0 20 20"
fill="currentColor"
>
<path
fill-rule="evenodd"
d="M13.477 14.89A6 6 0 015.11 6.524l8.367 8.368zm1.414-1.414L6.524 5.11a6 6 0 018.367 8.367z"
clip-rule="evenodd"
/>
</svg>
</div>
</div>
<!-- ./Boycott Badge with tooltip -->
<div class="flex h-full flex-col p-5">
<div class="mb-4 flex justify-center">
<img
Expand Down
101 changes: 77 additions & 24 deletions resources/views/livewire/alternative-list.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,37 @@ class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md text-sm fon
wire:model.live="search"
type="text"
placeholder="Search..."
class="w-full rounded-md border px-4 py-2 focus:border-blue-300 focus:outline-none focus:ring sm:w-2/3"
class="w-full rounded-md border px-4 py-2 focus:border-blue-300 focus:outline-none focus:ring"
/>

<!-- Filter select -->
<label for="filter-select" class="sr-only">Filter by</label>
<select
{{--
<label for="filter-select" class="sr-only">Filter by</label>
<select
id="filter-select"
wire:model.live="filter"
class="w-full rounded-md border px-4 py-2 focus:border-blue-300 focus:outline-none focus:ring sm:w-1/6"
>
>
<option value="">Filter by</option>
@foreach ($this->alternativesTags as $tag)
<option value="{{ $tag->id }}">{{ $tag->name }} ({{ $tag->alternatives_count }})</option>
<option value="{{ $tag->id }}">{{ $tag->name }} ({{ $tag->alternatives_count }})</option>
@endforeach
</select>
</select>
--}}

<label for="order-select" class="sr-only">Order by</label>
<!-- Order select -->
<select
{{--
<label for="order-select" class="sr-only">Order by</label>
<select
id="order-select"
wire:model.live="order"
class="w-full rounded-md border px-4 py-2 focus:border-blue-300 focus:outline-none focus:ring sm:w-1/6"
>
>
<option value="">Order by</option>
<option value="asc">Ascending</option>
<option value="desc">Descending</option>
</select>
</select>
--}}
</div>
</div>
</section>
Expand All @@ -59,23 +63,72 @@ class="w-full rounded-md border px-4 py-2 focus:border-blue-300 focus:outline-no
<div
class="relative flex h-full cursor-pointer flex-col overflow-hidden rounded-lg bg-white shadow-sm transition-all duration-300 hover:shadow-md"
>
<!-- Alternative Badge (Top Right) -->
<!-- Alternative Badge (Top Right) with Tooltip -->
<div
class="absolute right-2 top-2 z-10 flex items-center rounded-full bg-green-600 px-2 py-1 text-xs font-bold text-white"
x-data="{
tooltipVisible: false,
tooltipText: 'NonIsraeli Alternate',
tooltipArrow: true,
tooltipPosition: 'left',
}"
x-init="
$refs.content.addEventListener('mouseenter', () => {
tooltipVisible = true
})
$refs.content.addEventListener('mouseleave', () => {
tooltipVisible = false
})
"
class="absolute right-2 top-2 z-20"
>
<svg
xmlns="http://www.w3.org/2000/svg"
class="size-4"
x-description="Heroicon name: solid/check-circle"
viewBox="0 0 24 24"
fill="currentColor"
<div
x-ref="tooltip"
x-show="tooltipVisible"
:class="{ 'top-0 left-1/2 -translate-x-1/2 -mt-0.5 -translate-y-full' : tooltipPosition == 'top', 'top-1/2 -translate-y-1/2 -ml-0.5 left-0 -translate-x-full' : tooltipPosition == 'left', 'bottom-0 left-1/2 -translate-x-1/2 -mb-0.5 translate-y-full' : tooltipPosition == 'bottom', 'top-1/2 -translate-y-1/2 -mr-0.5 right-0 translate-x-full' : tooltipPosition == 'right' }"
class="absolute w-auto text-sm"
x-cloak
>
<path
fill-rule="evenodd"
d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z"
clip-rule="evenodd"
/>
</svg>
<div
x-show="tooltipVisible"
x-transition
class="relative rounded bg-black bg-opacity-90 px-2 py-1 text-white shadow-lg"
>
<p
x-text="tooltipText"
class="block flex-shrink-0 whitespace-nowrap text-xs"
></p>
<div
x-ref="tooltipArrow"
x-show="tooltipArrow"
:class="{ 'bottom-0 -translate-x-1/2 left-1/2 w-2.5 translate-y-full' : tooltipPosition == 'top', 'right-0 -translate-y-1/2 top-1/2 h-2.5 -mt-px translate-x-full' : tooltipPosition == 'left', 'top-0 -translate-x-1/2 left-1/2 w-2.5 -translate-y-full' : tooltipPosition == 'bottom', 'left-0 -translate-y-1/2 top-1/2 h-2.5 -mt-px -translate-x-full' : tooltipPosition == 'right' }"
class="absolute inline-flex items-center justify-center overflow-hidden"
>
<div
:class="{ 'origin-top-left -rotate-45' : tooltipPosition == 'top', 'origin-top-left rotate-45' : tooltipPosition == 'left', 'origin-bottom-left rotate-45' : tooltipPosition == 'bottom', 'origin-top-right -rotate-45' : tooltipPosition == 'right' }"
class="h-1.5 w-1.5 transform bg-black bg-opacity-90"
></div>
</div>
</div>
</div>

<div
x-ref="content"
class="relative flex cursor-pointer items-center rounded-full bg-green-600 px-2 py-1 text-xs font-bold text-white"
>
<svg
xmlns="http://www.w3.org/2000/svg"
class="size-4"
x-description="Heroicon name: solid/check-circle"
viewBox="0 0 24 24"
fill="currentColor"
>
<path
fill-rule="evenodd"
d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z"
clip-rule="evenodd"
/>
</svg>
</div>
</div>

<!-- Country Badge (Top Left) - Different shape and color -->
Expand Down
Loading