@extends('admin.layouts.app') @section('content')

{{ __('admin/push.show.title') }}

@if($push->image)
{{ __('admin/push.sections.image') }}
{{ __('admin/push.alt.image') }}
@endif
@foreach(config('translatable.locales') as $index => $locale) @php $translation = $push->translations->where('locale', $locale)->first(); @endphp
@php $hasTitle = $translation && !empty($translation->title); $hasContent = $translation && !empty($translation->content); $hasButtonText = $translation && !empty($translation->button_text); @endphp @if(!$hasTitle && !$hasContent && !$hasButtonText)
{{ __('admin/push.messages.no_translation_available', ['locale' => strtoupper($locale)]) }}
@else
@if($hasTitle)
{{ __('admin/push.fields.title') }}

{{ $translation->title }}

@endif @if($hasContent)
{{ __('admin/push.fields.content') }}
{!! nl2br(e($translation->content)) !!}
@endif @if($push->display_button && $hasButtonText)
{{ __('admin/push.fields.button') }}
{{ $translation->button_text }}
@if($push->button_link_type === 'external') {{ __('admin/push.fields.button_link_external') }}: {{ $push->button_link }} @elseif($push->button_link_type === 'internal') {{ __('admin/push.fields.button_link_internal') }}: @if($push->internal_link_type === 'training' && $push->training) {{ __('admin/push.fields.internal_link_training') }} - {{ $push->training->title }} @elseif($push->internal_link_type === 'page' && $push->page) {{ __('admin/push.fields.internal_link_page') }} - {{ $push->page->title }} @elseif($push->internal_link_type === 'route') {{ __('admin/push.fields.internal_link_route') }} - {{ $push->route_name }} @endif @endif
@endif
@endif
@endforeach
{{ __('admin/push.sections.information') }}

{{ __('admin/push.fields.status') }}: @if($push->is_active) {{ __('admin/push.status.active') }} @else {{ __('admin/push.status.inactive') }} @endif

{{ __('admin/push.fields.display_text') }}: @if($push->display_text) {{ __('admin/push.status.displayed') }} @else {{ __('admin/push.status.hidden') }} @endif

{{ __('admin/push.fields.display_button') }}: @if($push->display_button) {{ __('admin/push.status.displayed') }} @else {{ __('admin/push.status.hidden') }} @endif

{{ __('admin/push.fields.order') }}: {{ $push->order }}

{{ $push->created_at->format('d/m/Y à H:i') }}
{{ $push->updated_at->format('d/m/Y à H:i') }}
@canany(['pushes.edit', 'pushes.delete'])
{{ __('admin/push.sections.actions') }}
@can('pushes.edit') {{ __('admin/push.buttons.edit_push') }} @endcan @can('pushes.delete') @endcan
@endcanany
{{ __('admin/push.sections.translations') }}
@foreach(config('translatable.locales') as $locale) @php $trans = $push->translations->where('locale', $locale)->first(); $isTranslated = $trans && (!empty($trans->title) || !empty($trans->content) || !empty($trans->button_text)); @endphp
@if($isTranslated) {{ strtoupper($locale) }} - {{ __('admin/push.status.translated') }} @else {{ strtoupper($locale) }} - {{ __('admin/push.status.not_translated') }} @endif
@endforeach
@endsection