View file resources/views/boards/index.blade.php

File size: 4.06Kb
  1. @extends('layout')
  2.  
  3. @section('title', __('index.boards'))
  4.  
  5. @section('header')
  6. <div class="float-right">
  7. @if (getUser())
  8. <a class="btn btn-success" href="/items/create?bid={{ $board->id ?? 0 }}">{{ __('main.add') }}</a>
  9. @endif
  10.  
  11. @if (isAdmin())
  12. <a class="btn btn-light" href="/admin/boards?page={{ $items->currentPage() }}"><i class="fas fa-wrench"></i></a>
  13. @endif
  14. </div>
  15.  
  16. @if ($board)
  17. <h1>{{ $board->name }} <small>({{ __('index.boards') }}: {{ $board->count_items }})</small></h1>
  18. @else
  19. <h1>{{ __('index.boards') }}</h1>
  20. @endif
  21. @stop
  22.  
  23. @section('breadcrumb')
  24. <nav>
  25. <ol class="breadcrumb">
  26. <li class="breadcrumb-item"><a href="/"><i class="fas fa-home"></i></a></li>
  27.  
  28. @if ($board)
  29. <li class="breadcrumb-item"><a href="/boards">{{ __('index.boards') }}</a></li>
  30.  
  31. @if ($board->parent->id)
  32. <li class="breadcrumb-item"><a href="/boards/{{ $board->parent->id }}">{{ $board->parent->name }}</a></li>
  33. @endif
  34. <li class="breadcrumb-item active">{{ $board->name }}</li>
  35.  
  36. @if (isAdmin())
  37. <li class="breadcrumb-item"><a href="/admin/boards/{{ $board->id }}?page={{ $items->currentPage() }}">{{ __('main.management') }}</a></li>
  38. @endif
  39. @else
  40. <li class="breadcrumb-item active">{{ __('index.boards') }}</li>
  41. @endif
  42. </ol>
  43. </nav>
  44. @stop
  45.  
  46. @section('content')
  47. @if (getUser())
  48. <div class="mb-3">
  49. <i class="far fa-list-alt"></i> <a href="/boards/active">{{ __('boards.my_items') }}</a>
  50. </div>
  51. @endif
  52.  
  53. @if ($boards->isNotEmpty())
  54. <div class="row mb-3">
  55. @foreach ($boards->chunk(3) as $chunk)
  56. @foreach ($chunk as $board)
  57. <div class="col-md-3 col-6">
  58. <a href="/boards/{{ $board->id }}">{{ $board->name }}</a> {{ $board->count_items }}
  59. </div>
  60. @endforeach
  61. @endforeach
  62. </div>
  63. @endif
  64.  
  65. @if ($items->isNotEmpty())
  66. @foreach ($items as $item)
  67. <div class="row mb-3">
  68. <div class="col-md-12">
  69. <div class="card">
  70. <div class="card-body">
  71. <div class="row">
  72. <div class="col-md-3">
  73. <a href="/items/{{ $item->id }}">{{ $item->getFirstImage() }}</a>
  74. </div>
  75. <div class="col-md-7">
  76. <h5><a href="/items/{{ $item->id }}">{{ $item->title }}</a></h5>
  77. <small><i class="fas fa-angle-right"></i> <a href="/boards/{{ $item->category->id }}">{{ $item->category->name }}</a></small>
  78. <div class="section-message mb-3">
  79. {{ $item->shortText() }}
  80. </div>
  81. <div>
  82. <i class="fa fa-user-circle"></i> {{ $item->user->getProfile() }}
  83. <small class="section-date text-muted font-italic">
  84. {{ dateFixed($item->created_at) }}
  85. </small>
  86. </div>
  87. </div>
  88.  
  89. <div class="col-md-2">
  90. @if ($item->price)
  91. <button type="button" class="btn btn-info">{{ $item->price }} {{ setting('currency') }}</button>
  92. @endif
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. </div>
  99. @endforeach
  100. @else
  101. {{ showError(__('boards.empty_items')) }}
  102. @endif
  103.  
  104. {{ $items->links() }}
  105. @stop