Просмотр файла resources/views/admin/news/index.blade.php

Размер файла: 3.23Kb
  1. @extends('layout')
  2.  
  3. @section('title', __('index.news'))
  4.  
  5. @section('header')
  6. <div class="float-end">
  7. <a class="btn btn-success" href="/admin/news/create">{{ __('main.create') }}</a>
  8. <a class="btn btn-light" href="/news"><i class="fas fa-wrench"></i></a>
  9. </div>
  10.  
  11. <h1>{{ __('index.news') }}</h1>
  12. @stop
  13.  
  14. @section('breadcrumb')
  15. <nav>
  16. <ol class="breadcrumb">
  17. <li class="breadcrumb-item"><a href="/"><i class="fas fa-home"></i></a></li>
  18. <li class="breadcrumb-item"><a href="/admin">{{ __('index.panel') }}</a></li>
  19. <li class="breadcrumb-item active">{{ __('index.news') }}</li>
  20. </ol>
  21. </nav>
  22. @stop
  23.  
  24. @section('content')
  25. @if ($news->isNotEmpty())
  26. @foreach ($news as $data)
  27. <div class="section mb-3 shadow">
  28. <div class="section-header d-flex align-items-center">
  29. <div class="flex-grow-1">
  30. <i class="fa {{ $data->getIcon() }} text-muted"></i>
  31. <a class="section-title" href="/news/{{ $data->id }}">{{ $data->title }}</a>
  32. <small class="section-date text-muted fst-italic">{{ dateFixed($data->created_at) }})</small>
  33. </div>
  34.  
  35. <div class="text-end">
  36. @if ($data->top)
  37. <span class="text-danger">{{ __('news.on_homepage') }}</span><br>
  38. @endif
  39. <a href="/admin/news/edit/{{ $data->id }}?page={{ $news->currentPage() }}" data-bs-toggle="tooltip" title="{{ __('main.edit') }}"><i class="fas fa-pencil-alt text-muted"></i></a>
  40. <a href="/admin/news/delete/{{ $data->id }}?token={{ $_SESSION['token'] }}" data-bs-toggle="tooltip" title="{{ __('main.delete') }}" onclick="return confirm('{{ __('news.confirm_delete') }}')"><i class="fas fa-times text-muted"></i></a>
  41. </div>
  42. </div>
  43.  
  44. <div class="section-content">
  45. <div class="section-message row mb-3">
  46. @if ($data->image)
  47. <div class="col-sm-3">
  48. <a href="{{ $data->image }}" class="gallery">{{ resizeImage($data->image, ['class' => 'img-thumbnail img-fluid', 'alt' => $data->title]) }}</a>
  49. </div>
  50. @endif
  51.  
  52. <div class="col">
  53. {{ $data->shortText() }}
  54. </div>
  55. </div>
  56.  
  57. <div>
  58. {{ __('main.added') }}: {{ $data->user->getProfile() }}<br>
  59. <a href="/news/comments/{{ $data->id }}">{{ __('main.comments') }}</a> ({{ $data->count_comments }})
  60. <a href="/news/end/{{ $data->id }}">&raquo;</a>
  61. </div>
  62. </div>
  63. </div>
  64. @endforeach
  65.  
  66. {{ __('news.total_news') }}: <b>{{ $news->count() }}</b><br><br>
  67. @else
  68. {{ showError(__('news.empty_news')) }}
  69. @endif
  70.  
  71. {{ $news->links() }}
  72.  
  73. @if (isAdmin('boss'))
  74. <i class="fa fa-sync"></i> <a href="/admin/news/restatement?token={{ $_SESSION['token'] }}">{{ __('main.recount') }}</a><br>
  75. @endif
  76. @stop