Snapshot of main at 9f39a6e1e (2026-11-02)

This commit is contained in:
Ronald Huynen committed 2026-11-02 10:41:47 +01:00
commit 6ccf1792d7
2580 files changed
+1040202

No files matched your search

@@ -0,0 +1,66 @@
<div class="space-y-6">
<p class="text-sm text-theme-secondary">{{ __('Leave everything empty to show the poll to all profiles. Each filter you set narrows the audience.') }}</p>
<div>
<label class="block text-sm text-gray-700 mb-2">{{ __('Profile types') }}</label>
<div class="flex flex-wrap gap-x-6 gap-y-2">
@foreach (['App\Models\User' => __('Users'), 'App\Models\Organization' => __('Organizations'), 'App\Models\Bank' => __('Banks'), 'App\Models\Admin' => __('Admins')] as $class => $label)
<label class="flex items-center space-x-3">
<input type="checkbox" wire:model.live="targeting.target_profile_types" value="{{ $class }}"
class="rounded border-gray-300 text-theme-brand shadow-sm focus:border-theme-brand focus:ring focus:ring-theme-brand focus:ring-opacity-50">
<span class="text-sm text-gray-700">{{ $label }}</span>
</label>
@endforeach
</div>
</div>
<div>
@include('polls.types._checkbox', ['model' => 'targeting.filter_by_location', 'label' => __('Only profiles in a location')])
{{-- x-show on $wire: the checkbox is deferred, so a server-side class would not follow it --}}
<div class="mt-3" x-data x-show="$wire.targeting.filter_by_location" @style(['display: none' => empty($targeting['filter_by_location'])])>
<div wire:ignore>
<livewire:mailings.location-filter wire:key="poll-location-filter-{{ $editingPollId }}"
:selectedCountries="$targeting['location_country_ids'] ?? []"
:selectedDivisions="$targeting['location_division_ids'] ?? []"
:selectedCities="$targeting['location_city_ids'] ?? []"
:selectedDistricts="$targeting['location_district_ids'] ?? []" />
</div>
<p class="mt-1 text-xs text-theme-secondary">{{ __('Only the most specific level you select counts: a city inside a selected country narrows to that city.') }}</p>
</div>
</div>
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2">
<div>
<label class="block text-sm text-gray-700 mb-2">{{ __('Last login from') }}</label>
@include('polls.types._date', ['model' => 'targeting.last_login_from', 'key' => 'poll-' . $editingPollId . '-last_login_from', 'withTime' => false])
@include('polls.types._error', ['field' => 'targeting.last_login_from'])
</div>
<div>
<label class="block text-sm text-gray-700 mb-2">{{ __('Last login until') }}</label>
@include('polls.types._date', ['model' => 'targeting.last_login_until', 'key' => 'poll-' . $editingPollId . '-last_login_until', 'withTime' => false])
@include('polls.types._error', ['field' => 'targeting.last_login_until'])
</div>
<div>
<label class="block text-sm text-gray-700 mb-2">{{ __('Registered from') }}</label>
@include('polls.types._date', ['model' => 'targeting.registered_from', 'key' => 'poll-' . $editingPollId . '-registered_from', 'withTime' => false])
@include('polls.types._error', ['field' => 'targeting.registered_from'])
</div>
<div>
<label class="block text-sm text-gray-700 mb-2">{{ __('Registered until') }}</label>
@include('polls.types._date', ['model' => 'targeting.registered_until', 'key' => 'poll-' . $editingPollId . '-registered_until', 'withTime' => false])
@include('polls.types._error', ['field' => 'targeting.registered_until'])
</div>
</div>
<div class="p-3 bg-theme-surface rounded-md border border-theme-border flex flex-wrap items-center gap-3">
<x-jetstream.secondary-button wire:click="countMatchingProfiles" wire:loading.attr="disabled" wire:target="countMatchingProfiles">
{{ __('Count matching profiles') }}
</x-jetstream.secondary-button>
@if ($matchingCounts !== null)
<p class="text-sm text-theme-primary">
<strong>{{ trans_choice(':count profile|:count profiles', array_sum($matchingCounts), ['count' => number_format(array_sum($matchingCounts))]) }}</strong>
({{ collect($matchingCounts)->map(fn ($count, $type) => __($type . 's') . ': ' . number_format($count))->implode(', ') }})
</p>
@endif
</div>
</div>