Просмотр файла WhiteBlack/views/offers/index.blade.php

Размер файла: 3.28Kb
  1. @extends('layout')
  2.  
  3. @section('title')
  4. Предложения / Проблемы
  5. @stop
  6.  
  7. @section('content')
  8.  
  9.  
  10. <h1>Предложения / Проблемы</h1>
  11. <div class="offers-wrapp">
  12. <nav>
  13. <ol class="breadcrumb">
  14. <li class="breadcrumb-item"><a href="/"><i class="fas fa-home"></i></a></li>
  15. <li class="breadcrumb-item active">Предложения / Проблемы</li>
  16.  
  17. @if (isAdmin('admin'))
  18. <li class="breadcrumb-item"><a href="/admin/offers/{{ $type }}?page={{ $page->current }}">Управление</a></li>
  19. @endif
  20. </ol>
  21. </nav>
  22.  
  23. <div class="main-new-link">
  24. <span>Сортировать:</span>
  25. <?php $active = ($order === 'rating') ? 'success' : 'light'; ?>
  26. <a href="/offers/{{ $type }}?sort=rating">Голоса</a>
  27.  
  28. <?php $active = ($order === 'created_at') ? 'success' : 'light'; ?>
  29. <a href="/offers/{{ $type }}?sort=time">Дата</a>
  30.  
  31. <?php $active = ($order === 'status') ? 'success' : 'light'; ?>
  32. <a href="/offers/{{ $type }}?sort=status">Статус</a>
  33.  
  34. <?php $active = ($order === 'count_comments') ? 'success' : 'light'; ?>
  35. <a href="/offers/{{ $type }}?sort=comments">Комментарии</a>
  36. </div>
  37. <div class="post-nav-link">
  38. @if ($type === 'offer')
  39. <a href="/offers/offer">Предложения <span class="badge badge-light">{{ $page->total }}</span></a>
  40. <a class="red" href="/offers/issue">Проблемы <span class="badge badge-light">{{ $page->otherTotal }}</span></a>
  41. @else
  42. <a href="/offers/offer">Предложения <span class="badge badge-light">{{ $page->otherTotal }}</span></a>
  43. <a class="red" href="/offers/issue">Проблемы <span class="badge badge-light">{{ $page->total }}</span></a>
  44. @endif
  45. </div>
  46. @if (getUser())
  47. <div class="btns">
  48. <a class="btn btn-success" href="/offers/create?type={{ $type }}">Добавить</a>
  49. </div>
  50. @endif
  51.  
  52. @if ($offers->isNotEmpty())
  53.  
  54. @foreach ($offers as $data)
  55. <div class="offers">
  56. <ul>
  57. <li><a href="/offers/{{ $data->id }}"><span class="icon"><i class="fa fa-file"></i></span>{{ $data->title }}</a></li>
  58. </ul>
  59. <div class="statuses">
  60. <span>{!! $data->getStatus() !!}</span>
  61. <span>(Голосов: {{ $data->rating }})</span>
  62. </div>
  63. <div class="offers-text">{!! bbCode($data->text) !!}</div>
  64. <div class="news-bottom">
  65. <span>Добавлено: {!! $data->user->getProfile() !!} <br> ({{ dateFixed($data->created_at) }})</span>
  66. <span class="comment"><a href="/offers/comments/{{ $data->id }}"><span class="icon"><i class="fa fa-comment"></i></span><span class="count">
  67. {{ $data->count_comments }}
  68. </span></a></span>
  69. <!--<a href="/offers/end/{{ $data['id'] }}">&raquo;</a>-->
  70. </div>
  71. </div>
  72. @endforeach
  73.  
  74. {!! pagination($page) !!}
  75.  
  76. <div class="text-center">Всего записей: <b>{{ $page->total }}</b>
  77. </div>
  78. @else
  79. {!! showError('Записей еще нет!') !!}
  80. @endif
  81. </div>
  82. @stop