Join us add vimeo video possibility
This commit is contained in:
parent
831979966a
commit
cd7f460a3d
4 changed files with 36 additions and 14 deletions
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace App\Http\Requests\Bo\Joinuspage;
|
||||
|
||||
use App\Rules\IsValidVimeoId;
|
||||
use App\Rules\IsValidYoutubeId;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateJoinuspageRequest extends FormRequest
|
||||
|
|
@ -24,7 +26,15 @@ class UpdateJoinuspageRequest extends FormRequest
|
|||
public function rules()
|
||||
{
|
||||
return [
|
||||
'video_id' => 'required|string|regex:%([^"&?\/\s]{11})%i',
|
||||
'video_id' => [
|
||||
'required', 'string',
|
||||
function (string $attribute, mixed $value, \Closure $fail) {
|
||||
if (!IsValidYoutubeId::validates($value) and !IsValidVimeoId::validates($value)) {
|
||||
(new IsValidYoutubeId())->validate($attribute, $value, $fail);
|
||||
(new IsValidVimeoId())->validate($attribute, $value, $fail);
|
||||
}
|
||||
}
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@
|
|||
</fieldset>
|
||||
</div>
|
||||
|
||||
{{-- YOUTUBE VIDEO ID --}}
|
||||
{{-- VIDEO ID --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="h-100 border p-3">
|
||||
<legend>{{ Str::ucfirst(__('validation.custom.video_id')) }}</legend>
|
||||
|
|
@ -188,16 +188,16 @@
|
|||
'required' => false,
|
||||
'model' => $homepageModel ?? null,
|
||||
'helper' =>
|
||||
__('validation.between.string', [
|
||||
__('validation.string', [
|
||||
'attribute' => __(':field :inter:model', [
|
||||
'field' =>
|
||||
__('validation.custom.youtube_video_id') . ' ou ' . __('validation.custom.vimeo_video_id'),
|
||||
'inter' => __('validation.custom.of_the.female'),
|
||||
'model' => __('models.classes.homepage'),
|
||||
]),
|
||||
'min' => 11,
|
||||
'max' => 12,
|
||||
]) . __("Doit être l'id de la vidéo Youtube eg:\u{00A0}(MH19CxWqluY) ou Vimeo eg:\u{00A0}(369521302)."),
|
||||
]) .
|
||||
' ' .
|
||||
__(" Youtube eg:\u{00A0}(MH19CxWqluY) ou Vimeo eg:\u{00A0}(369521302)."),
|
||||
'placeholder' => 'MH19CxWqluY',
|
||||
])
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
{{-- VIDEO ID --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="h-100 border p-3">
|
||||
<legend>{{ Str::ucfirst(__('validation.attributes.url')) }}</legend>
|
||||
<legend>{{ Str::ucfirst(__('validation.custom.video_id')) }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('bo.partials.inputs.varchar', [
|
||||
|
|
@ -17,16 +17,17 @@
|
|||
'required' => true,
|
||||
'model' => $joinuspageModel ?? null,
|
||||
'helper' =>
|
||||
__('validation.between.string', [
|
||||
__('validation.string', [
|
||||
'attribute' => __(':field :inter:model', [
|
||||
'field' => __('validation.custom.video_id'),
|
||||
'field' =>
|
||||
__('validation.custom.youtube_video_id') . ' ou ' . __('validation.custom.vimeo_video_id'),
|
||||
'inter' => __('validation.custom.of_the.female'),
|
||||
'model' => __('models.classes.joinuspage'),
|
||||
'model' => __('models.classes.homepage'),
|
||||
]),
|
||||
'min' => 3,
|
||||
'max' => 255,
|
||||
]) . __(' Doit être l\'id de la vidéo.'),
|
||||
'placeholder' => __('crud.placeholders.beautiful', ['field' => __('validation.attributes.url')]),
|
||||
]) .
|
||||
' ' .
|
||||
__(" Youtube eg:\u{00A0}(MH19CxWqluY) ou Vimeo eg:\u{00A0}(369521302)."),
|
||||
'placeholder' => 'MH19CxWqluY',
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -104,6 +104,7 @@
|
|||
<p class="m-0">{{ __('Nous sommes tous animés par la passion de nos métiers !') }}</p>
|
||||
<p>{{ __('Une équipe de talents à renforcer.') }}</p>
|
||||
<div class="ratio ratio-16x9">
|
||||
@if (\App\Rules\IsValidYoutubeId::validates($joinuspageModel->video_id))
|
||||
<div class="video-inlaid" type="youtube" href="https://www.youtube.com/embed/{{ $joinuspageModel->video_id }}">
|
||||
<a class="cn-cookie-link" id="youtube-warning" href="" rel="nofollow">
|
||||
<strong class="text-underline text-bold text-normal text-danger">
|
||||
|
|
@ -111,6 +112,16 @@
|
|||
</strong>
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
@if (\App\Rules\IsValidVimeoId::validates($joinuspageModel->video_id))
|
||||
<div class="video-inlaid" type="vimeo" href="https://player.vimeo.com/video/{{ $joinuspageModel->video_id }}">
|
||||
<a class="cn-cookie-link" id="vimeo-warning" href="" rel="nofollow">
|
||||
<strong class="text-underline text-bold text-normal text-danger">
|
||||
{{ __('cookie-notice.custom.vimeo.warning') }}
|
||||
</strong>
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<p>
|
||||
{{ __('Pour consulter l\'ensemble de nos vidéos métiers, rendez-vous sur notre chaîne') }}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue