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

Размер файла: 4.05Kb
  1. @extends('layout')
  2.  
  3. @section('title', $forum->title, ' (' . __('main.page_num', ['page' => $topics->currentPage()]) . ')')
  4.  
  5. @section('header')
  6. <div class="float-end">
  7. @if (getUser())
  8. @if (! $forum->closed)
  9. <a class="btn btn-success" href="/forums/create?fid={{ $forum->id }}">{{ __('forums.create_topic') }}</a>
  10. @endif
  11.  
  12. @if (isAdmin())
  13. <a class="btn btn-light" href="/admin/forums/{{ $forum->id }}?page={{ $topics->currentPage() }}"><i class="fas fa-wrench"></i></a>
  14. @endif
  15. @endif
  16. </div>
  17.  
  18. <h1>{{ $forum->title }}</h1>
  19. @stop
  20.  
  21. @section('breadcrumb')
  22. <nav>
  23. <ol class="breadcrumb">
  24. <li class="breadcrumb-item"><a href="/"><i class="fas fa-home"></i></a></li>
  25. <li class="breadcrumb-item"><a href="/forums">{{ __('index.forums') }}</a></li>
  26.  
  27. @if ($forum->parent->id)
  28. <li class="breadcrumb-item"><a href="/forums/{{ $forum->parent->id }}">{{ $forum->parent->title }}</a></li>
  29. @endif
  30.  
  31. <li class="breadcrumb-item active">{{ $forum->title }}</li>
  32. </ol>
  33. </nav>
  34. @stop
  35.  
  36. @section('content')
  37. @if ($topics->onFirstPage() && $forum->children->isNotEmpty())
  38. @foreach ($forum->children as $child)
  39. <div class="section mb-3 shadow border-start border-info">
  40. <div class="section-header d-flex align-items-center">
  41. <div class="flex-grow-1">
  42. <div class="section-title">
  43. <i class="fa fa-file-alt fa-lg text-muted"></i>
  44. <a href="/forums/{{ $child->id }}">{{ $child->title }}</a>
  45. </div>
  46. </div>
  47.  
  48. <div class="text-end">
  49. <b>{{ $child->count_topics }}/{{ $child->count_posts }}</b>
  50. </div>
  51. </div>
  52.  
  53. @if ($child->lastTopic->id)
  54. <div class="section-content">
  55. {{ __('forums.topic') }}: <a href="/topics/end/{{ $child->lastTopic->id }}">{{ $child->lastTopic->title }}</a><br>
  56. @if ($child->lastTopic->lastPost->id)
  57. {{ __('forums.post') }}: {{ $child->lastTopic->lastPost->user->getName() }} ({{ dateFixed($child->lastTopic->lastPost->created_at) }})
  58. @endif
  59. </div>
  60. @else
  61. <div>{{ __('forums.empty_topics') }}</div>
  62. @endif
  63. </div>
  64. @endforeach
  65. <hr>
  66. @endif
  67.  
  68. @if ($topics->isNotEmpty())
  69. @foreach ($topics as $topic)
  70. <div class="section mb-3 shadow" id="topic_{{ $topic->id }}">
  71. <div class="section-header d-flex align-items-center">
  72. <div class="flex-grow-1">
  73. <div class="section-title">
  74. <i class="fa {{ $topic->getIcon() }} text-muted"></i>
  75. <a href="/topics/{{ $topic->id }}">{{ $topic->title }}</a>
  76. </div>
  77. </div>
  78. <div class="text-end">
  79. <b>{{ $topic->getCountPosts() }}</b>
  80. </div>
  81. </div>
  82.  
  83. @if ($topic->lastPost)
  84. <div class="section-content">
  85. {{ $topic->pagination() }}
  86. {{ __('forums.post') }}: {{ $topic->lastPost->user->getName() }} ({{ dateFixed($topic->lastPost->created_at) }})
  87. </div>
  88. @endif
  89. </div>
  90. @endforeach
  91. @elseif ($forum->closed)
  92. {{ showError(__('forums.closed_forum')) }}
  93. @else
  94. {{ showError(__('forums.empty_topics')) }}
  95. @endif
  96.  
  97. {{ $topics->links() }}
  98.  
  99. <a href="/rules">{{ __('main.rules') }}</a> /
  100. <a href="/forums/top/topics">{{ __('forums.top_topics') }}</a> /
  101. <a href="/forums/top/posts">{{ __('forums.top_posts') }}</a> /
  102. <a href="/forums/search?fid={{ $forum->id }}">{{ __('main.search') }}</a><br>
  103. @stop