service.blade.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. {{--
  2. Вьюха: детальная страница услуги
  3. Маршрут: GET /services/{slug}
  4. Контроллер: ServiceController::show()
  5. Переменные: $service — модель Service
  6. Теги — ID из dict_values (countries + service_tags).
  7. --}}
  8. @extends('layouts.app')
  9. @section('title', $service->title . ' — Ishiyama')
  10. @section('content')
  11. {{-- Заголовок --}}
  12. <section class="page-hdr">
  13. <div class="container">
  14. <div class="sh-label reveal-up">Наши услуги</div>
  15. <h1 class="reveal">
  16. @if($service->icon) {{ $service->icon }} @endif
  17. {{ mb_strtoupper($service->title) }}
  18. </h1>
  19. <nav class="breadcrumb">
  20. <a href="{{ route('home') }}">Главная</a>
  21. <span>/</span>
  22. <a href="{{ route('services') }}">Услуги</a>
  23. <span>/</span>
  24. <span>{{ $service->title }}</span>
  25. </nav>
  26. </div>
  27. </section>
  28. {{-- Основной контент --}}
  29. <section class="section sec-white">
  30. <div class="container">
  31. @if($service->excerpt)
  32. <p class="svc-detail-lead reveal">{{ $service->excerpt }}</p>
  33. @endif
  34. @php
  35. $tagIds = array_map('intval', $service->tags ?? []);
  36. $tags = !empty($tagIds)
  37. ? \App\Models\DictValue::whereIn('id', $tagIds)->get(['id','value','flag'])->keyBy('id')
  38. : collect();
  39. @endphp
  40. @if($tags->isNotEmpty())
  41. <div class="svc-tags reveal" style="margin-bottom:clamp(24px,4vw,40px)">
  42. @foreach($tagIds as $tid)
  43. @if($tags->has($tid))
  44. <span class="svc-tag">{{ $tags[$tid]->flag }} {{ $tags[$tid]->value }}</span>
  45. @endif
  46. @endforeach
  47. </div>
  48. @endif
  49. @if($service->description)
  50. <div class="svc-detail-body reveal">
  51. {!! $service->description !!}
  52. </div>
  53. @endif
  54. </div>
  55. </section>
  56. @endsection