status-details.blade.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. @extends('views.layouts.master')
  2. @section('content')
  3. <!-- start of :: wrap -->
  4. <div id="wrap" class="sub community event view">
  5. <div class="blog-details-part">
  6. <div class="container">
  7. <div class="row justify-content-center">
  8. <div class="col-lg-12 col-xl-10">
  9. <div class="blog-details">
  10. <div class="blog-details-thumb">
  11. <img src="{{ msset($event['TurboMiddles']) }}" alt="blog">
  12. </div>
  13. <div class="blog-details-content">
  14. <ul class="blog-details-meta">
  15. <li class="date">
  16. <i class="fa-regular fa-calendar-days"></i>{{ $event['Pc4'] }} ~ {{ $event['Pc5'] }}
  17. </li>
  18. <li class="agency_name">{{ $event['Pc1'] }}</li>
  19. <li>
  20. @foreach($event['AttachedFiles'] ?? [] as $file)
  21. <a href="{{ msset($file) }}" download
  22. class="file">
  23. {{ $file }}
  24. </a>
  25. @endforeach
  26. </li>
  27. </ul>
  28. <h2 class="blog-details-title">{{ $event['PostTitle'] }}</h2>
  29. <div class="blog_cont_wrap fr-view">
  30. {!! $event['PostContents'] !!}
  31. </div>
  32. </div>
  33. <div class="blog_bottom">
  34. <div class="blog-details-navigate">
  35. @foreach ($event['PostPrenexts'] ?? [] as $prenext)
  36. @if ($prenext['Prenext'] === 'prev')
  37. <div class="blog-details-prev">
  38. <a class="nav-arrow" href="{{ route('status-details', $prenext['Slug']) }}"><i class="fas fa-arrow-left"></i>이전</a>
  39. </div>
  40. @else
  41. <div class="blog-details-next">
  42. <a class="nav-arrow" href="{{ route('status-details', $prenext['Slug']) }}">다음<i class="fas fa-arrow-right"></i></a>
  43. </div>
  44. @endif
  45. @endforeach
  46. </div>
  47. <div class="btn_wrap">
  48. <button type="button" class="btn btn_primary" onclick="location.href='/event'">목록</button>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. @endsection
  58. @push('js')
  59. <script>
  60. $(document).on('click', '.agency_top button,.agency_bttom button', function() {
  61. let agencyId = $(this).data("agency");
  62. localStorage.setItem("agencyID", agencyId);
  63. window.location = "/agency-detail";
  64. });
  65. $(window).on('pageshow', function(event) {
  66. $.getJSON("/themes/point2u/pro/resources/assets/data/agency-data.json", function (data) {
  67. var html = '';
  68. $('.agency_top,.agency_bttom').empty();
  69. var startIndex = 0; // 시작 인덱스
  70. var endIndex = 30;
  71. var paginatedData = data.slice(startIndex, endIndex);
  72. $.each(paginatedData, function(i, entry) {
  73. html += `<button data-agency="${entry.id}">
  74. <img src="${entry.로고이미지}" alt="" />
  75. </button>`;
  76. });
  77. $('.agency_top').append(html);
  78. startIndex = 31; // 시작 인덱스
  79. endIndex = data.length;
  80. paginatedData = data.slice(startIndex, endIndex);
  81. html = '';
  82. $.each(paginatedData, function(i, entry) {
  83. html += `<button data-agency="${entry.id}">
  84. <img src="${entry.로고이미지}" alt="" />
  85. </button>`;
  86. });
  87. $('.agency_bttom').append(html);
  88. });
  89. });
  90. function agency_list(e) {
  91. const searchKey = $('#selopt :selected').val();
  92. const key = $('#txtagency').val(); // 검색어
  93. const id = e.id;
  94. $.getJSON("/themes/point2u/pro/resources/assets/data/agency-data.json", function (data) {
  95. var html = ''; // HTML을 저장할 변수 초기화
  96. var shouldInclude = function(text, key) {
  97. return text.includes(key);
  98. };
  99. $('.agency_top,.agency_bttom').empty(); // .agency_top 내의 요소를 모두 비움
  100. var filteredData = [];
  101. if(key.length > 0){
  102. filteredData = data.filter(function(entry) {
  103. return (
  104. (searchKey === 'n' && shouldInclude(entry.id, key)) ||
  105. (searchKey === 'm' && entry.main.some(function(tag) { return shouldInclude(tag, key); })) ||
  106. (searchKey === 'c' && entry.charge.some(function(tag) { return shouldInclude(tag, key); }))
  107. );
  108. });
  109. }else{
  110. filteredData = data;
  111. }
  112. var startIndex = 0; // 시작 인덱스
  113. var endIndex = 30;
  114. var paginatedData = filteredData.slice(startIndex, endIndex);
  115. $.each(paginatedData, function(i, entry) {
  116. html += `<button data-agency="${entry.id}">
  117. <img src="${entry.로고이미지}" alt="" />
  118. </button>`;
  119. });
  120. $('.agency_top').html(html); // 생성된 HTML을 .agency_top에 추가
  121. startIndex = 31; // 시작 인덱스
  122. endIndex = data.length;
  123. paginatedData = filteredData.slice(startIndex, endIndex);
  124. html = '';
  125. $.each(paginatedData, function(i, entry) {
  126. html += `<button data-agency="${entry.id}">
  127. <img src="${entry.로고이미지}" alt="" />
  128. </button>`;
  129. });
  130. $('.agency_bttom').append(html);
  131. });
  132. }
  133. $(document).on('click', '.show_write', function() {
  134. $(this).parent().next().toggle();
  135. });
  136. </script>
  137. @endpush