Snapshot of main at 9f39a6e1e (2026-11-02)
This commit is contained in:
commit
6ccf1792d7
2580 files changed
+1040202
No files matched your search
@@ -0,0 +1,103 @@
|
||||
<div class="space-y-6">
|
||||
@include('livewire.polls.partials.locked-warning')
|
||||
|
||||
<!-- Language of the texts being edited (also usable when read-only) -->
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<span class="text-sm text-gray-700">{{ __('Language') }}:</span>
|
||||
@foreach ($locales as $code)
|
||||
@php($hasTitle = trim((string) ($postFields[$code]['title'] ?? '')) !== '')
|
||||
<button type="button" wire:click="$set('editLocale', '{{ $code }}')"
|
||||
title="{{ $hasTitle ? __('Filled in') : '' }}"
|
||||
class="rounded-md border px-2 py-1 text-xs uppercase {{ $editLocale === $code ? 'border-theme-brand bg-theme-brand text-white' : 'border-theme-border text-theme-primary' }} {{ $hasTitle ? 'font-semibold' : 'opacity-70' }}">
|
||||
{{ $code }}
|
||||
</button>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<fieldset @disabled($contentLocked) @class(["space-y-6", "opacity-60" => $contentLocked])>
|
||||
<div wire:key="poll-post-title-{{ $editingPollId }}-{{ $editLocale }}">
|
||||
<label class="block text-sm text-gray-700 mb-2">{{ __('Title') }} ({{ strtoupper($editLocale) }})</label>
|
||||
<x-input errorless wire:model.blur="postFields.{{ $editLocale }}.title" type="text" maxlength="150" class="w-full" />
|
||||
@include('polls.types._error', ['field' => "postFields.$editLocale.title"])
|
||||
</div>
|
||||
|
||||
<div wire:key="poll-post-excerpt-{{ $editingPollId }}-{{ $editLocale }}">
|
||||
<label class="block text-sm text-gray-700 mb-2">{{ __('Introduction') }} ({{ strtoupper($editLocale) }})</label>
|
||||
<x-textarea errorless wire:model.blur="postFields.{{ $editLocale }}.excerpt" rows="3" maxlength="{{ timebank_config('posts.excerpt_max_input', 500) }}" class="w-full" />
|
||||
@include('polls.types._error', ['field' => "postFields.$editLocale.excerpt"])
|
||||
</div>
|
||||
|
||||
<!-- Content: WYSIWYG editor (Quill), as in Posts/Manage -->
|
||||
<div wire:ignore wire:key="poll-post-quill-{{ $editingPollId }}-{{ $editLocale }}"
|
||||
x-data="{
|
||||
quill: null,
|
||||
init() {
|
||||
this.$nextTick(() => {
|
||||
this.quill = new Quill(this.$refs.editor, {
|
||||
modules: {
|
||||
toolbar: [
|
||||
[{ header: [1, 2, false] }],
|
||||
['bold', 'italic', 'underline', 'strike'],
|
||||
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
|
||||
[{ 'align': [] }],
|
||||
['link', 'image', 'video'],
|
||||
['clean']
|
||||
]
|
||||
},
|
||||
theme: 'snow',
|
||||
readOnly: {{ $contentLocked ? 'true' : 'false' }},
|
||||
});
|
||||
this.quill.on('text-change', () => {
|
||||
@this.set('postFields.{{ $editLocale }}.content', this.quill.root.innerHTML, false);
|
||||
});
|
||||
});
|
||||
}
|
||||
}">
|
||||
<label class="block text-sm text-gray-700 mb-2">{{ __('Content') }} ({{ strtoupper($editLocale) }})</label>
|
||||
<div x-ref="editor">{!! \App\Helpers\StringHelper::sanitizeHtml($postFields[$editLocale]['content'] ?? '') !!}</div>
|
||||
</div>
|
||||
@include('polls.types._error', ['field' => "postFields.$editLocale.content"])
|
||||
|
||||
<!-- Image -->
|
||||
<div>
|
||||
<label class="block text-sm text-gray-700 mb-2">{{ __('Image') }}</label>
|
||||
@if ($image && !$errors->has('image'))
|
||||
<img class="mb-2 w-64 rounded-md border border-gray-300" src="{{ $image->temporaryUrl() }}" alt="">
|
||||
@elseif ($currentImage)
|
||||
<img class="mb-2 w-64 rounded-md border border-gray-300" src="{{ $currentImage }}" alt="">
|
||||
@else
|
||||
<div class="mb-2 flex h-36 w-64 items-center justify-center border border-gray-300">
|
||||
<span>{{ __('No image') }}</span>
|
||||
</div>
|
||||
@endif
|
||||
<div @class(['flex flex-wrap items-center gap-3', 'hidden' => $contentLocked])>
|
||||
<input accept="image/*" type="file" class="hidden" id="poll-image-upload" wire:model="image">
|
||||
<x-jetstream.secondary-button type="button" onclick="document.getElementById('poll-image-upload').click()">
|
||||
{{ __('Browse...') }}
|
||||
</x-jetstream.secondary-button>
|
||||
@if ($image || $currentImage)
|
||||
<x-jetstream.danger-button type="button" wire:click="markImageForRemoval">
|
||||
{{ __('Delete photo') }}
|
||||
</x-jetstream.danger-button>
|
||||
@endif
|
||||
<span wire:loading wire:target="image" class="text-sm text-theme-secondary">{{ __('Uploading...') }}</span>
|
||||
</div>
|
||||
@if ($removeImage)
|
||||
<p class="mt-1 text-sm text-theme-secondary">{{ __('The photo will be removed when you save the poll.') }}</p>
|
||||
@endif
|
||||
@include('polls.types._error', ['field' => 'image'])
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm text-gray-700 mb-2">{{ __('Image ownership') }} ({{ __('all languages') }})</label>
|
||||
<x-input errorless wire:model.blur="mediaOwner" type="text" maxlength="150" class="w-full" />
|
||||
@include('polls.types._error', ['field' => 'mediaOwner'])
|
||||
</div>
|
||||
|
||||
<div wire:key="poll-post-caption-{{ $editingPollId }}-{{ $editLocale }}">
|
||||
<label class="block text-sm text-gray-700 mb-2">{{ __('Caption') }} ({{ strtoupper($editLocale) }})</label>
|
||||
<x-textarea errorless wire:model.blur="mediaCaptions.{{ $editLocale }}" rows="2" maxlength="{{ timebank_config('posts.media_caption_max_input', 300) }}" class="w-full" />
|
||||
@include('polls.types._error', ['field' => "mediaCaptions.$editLocale"])
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
Reference in new issue
Block a user