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

Размер файла: 3.96Kb
  1. @extends('layout')
  2.  
  3. @section('title', __('index.forums'))
  4.  
  5. @section('breadcrumb')
  6. <nav>
  7. <ol class="breadcrumb">
  8. <li class="breadcrumb-item"><a href="/"><i class="fas fa-home"></i></a></li>
  9. <li class="breadcrumb-item"><a href="/admin">{{ __('index.panel') }}</a></li>
  10. <li class="breadcrumb-item active">{{ __('index.forums') }}</li>
  11. </ol>
  12. </nav>
  13. @stop
  14.  
  15. @section('header')
  16. <div class="float-right">
  17. <a class="btn btn-light" href="/forums"><i class="fas fa-wrench"></i></a>
  18. </div>
  19.  
  20. <h1>{{ __('index.forums') }}</h1>
  21. @stop
  22.  
  23. @section('content')
  24. @if ($forums->isNotEmpty())
  25. @foreach ($forums as $forum)
  26. <div class="section mb-3 shadow">
  27. <div class="section-title">
  28. <i class="fa fa-file-alt fa-lg text-muted"></i>
  29. <a href="/admin/forums/{{ $forum->id }}">{{ $forum->title }}</a>
  30. ({{ $forum->count_topics }}/{{ $forum->count_posts }})
  31.  
  32. @if (isAdmin('boss'))
  33. <div class="float-right">
  34. <a href="/admin/forums/edit/{{ $forum->id }}"><i class="fa fa-pencil-alt"></i></a>
  35. <a href="/admin/forums/delete/{{ $forum->id }}?token={{ $_SESSION['token'] }}" onclick="return confirm('{{ __('forums.confirm_delete_forum') }}')"><i class="fa fa-times"></i></a>
  36. </div>
  37. @endif
  38.  
  39. @if ($forum->description)
  40. <div class="small font-italic">{{ $forum->description }}</div>
  41. @endif
  42. </div>
  43.  
  44. <div class="section-content">
  45. @if ($forum->children->isNotEmpty())
  46. @foreach ($forum->children as $child)
  47. <i class="fa fa-copy text-muted"></i> <b><a href="/admin/forums/{{ $child->id }}">{{ $child->title }}</a></b>
  48. ({{ $child->count_topics }}/{{ $child->count_posts }})
  49.  
  50. @if (isAdmin('boss'))
  51. <a href="/admin/forums/edit/{{ $child->id }}"><i class="fa fa-pencil-alt"></i></a>
  52. <a href="/admin/forums/delete/{{ $child->id }}?token={{ $_SESSION['token'] }}" onclick="return confirm('{{ __('forums.confirm_delete_forum') }}')"><i class="fa fa-times"></i></a>
  53. @endif
  54. <br>
  55. @endforeach
  56. @endif
  57.  
  58. @if ($forum->lastTopic->lastPost->id)
  59. {{ __('forums.topic') }}: <a href="/admin/topics/end/{{ $forum->lastTopic->id }}">{{ $forum->lastTopic->title }}</a>
  60. <br>
  61. {{ __('forums.post') }}: {{ $forum->lastTopic->lastPost->user->getName() }} ({{ dateFixed($forum->lastTopic->lastPost->created_at) }})
  62. @else
  63. {{ __('forums.empty_posts') }}
  64. @endif
  65. </div>
  66. </div>
  67. @endforeach
  68. @else
  69. {{ showError(__('forums.empty_forums')) }}
  70. @endif
  71.  
  72. @if (isAdmin('boss'))
  73. <div class="section-form mb-3 shadow">
  74. <form action="/admin/forums/create" method="post">
  75. @csrf
  76. <div class="form-inline">
  77. <div class="form-group{{ hasError('title') }}">
  78. <input type="text" class="form-control" id="title" name="title" maxlength="50" value="{{ getInput('title') }}" placeholder="{{ __('forums.forum') }}" required>
  79. </div>
  80.  
  81. <button class="btn btn-primary">{{ __('forums.create_forum') }}</button>
  82. </div>
  83. <div class="invalid-feedback">{{ textError('title') }}</div>
  84. </form>
  85. </div>
  86.  
  87. <i class="fa fa-sync"></i> <a href="/admin/forums/restatement?token={{ $_SESSION['token'] }}">{{ __('main.recount') }}</a><br>
  88. @endif
  89. @stop