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

Размер файла: 4.21Kb
  1. @extends('layout')
  2.  
  3. @section('title', __('index.forums'))
  4.  
  5. @section('header')
  6. <div class="float-end">
  7. @if (getUser())
  8. <a class="btn btn-success" href="/forums/create">{{ __('forums.create_topic') }}</a>
  9.  
  10. @if (isAdmin())
  11. <a class="btn btn-light" href="/admin/forums"><i class="fas fa-wrench"></i></a>
  12. @endif
  13. @endif
  14. </div>
  15.  
  16. <h1>{{ __('index.forums') }}</h1>
  17. @stop
  18.  
  19. @section('breadcrumb')
  20. <nav>
  21. <ol class="breadcrumb">
  22. <li class="breadcrumb-item"><a href="/"><i class="fas fa-home"></i></a></li>
  23. <li class="breadcrumb-item active">{{ __('index.forums') }}</li>
  24. </ol>
  25. </nav>
  26. @stop
  27.  
  28. @section('content')
  29. @include('ads/_forum')
  30.  
  31. <div class="my-3 py-2 border-bottom">
  32. @if (getUser())
  33. {{ __('main.my') }}: <a href="/forums/active/topics">{{ __('forums.topics') }}</a>, <a href="/forums/active/posts">{{ __('forums.posts') }}</a>, <a href="/forums/bookmarks">{{ __('forums.bookmarks') }}</a> /
  34. @endif
  35.  
  36. {{ __('main.new') }}: <a href="/topics">{{ __('forums.topics') }}</a>, <a href="/posts">{{ __('forums.posts') }}</a>
  37. </div>
  38.  
  39. @if ($forums->isNotEmpty())
  40. @foreach ($forums as $forum)
  41. <div class="section mb-3 shadow">
  42. <div class="section-header d-flex align-items-center position-relative">
  43. <div class="flex-grow-1">
  44. <i class="fa fa-file-alt fa-lg text-muted"></i>
  45. <a href="/forums/{{ $forum->id }}" class="section-title position-relative">{{ $forum->title }}</a>
  46. <span class="badge bg-light text-dark">{{ formatShortNum($forum->count_topics + $forum->children->sum('count_topics')) }}/{{ formatShortNum($forum->count_posts + $forum->children->sum('count_posts')) }}</span>
  47.  
  48. @if ($forum->description)
  49. <div class="section-description text-muted small">{{ $forum->description }}</div>
  50. @endif
  51. </div>
  52.  
  53. @if ($forum->children->isNotEmpty())
  54. <div>
  55. <a data-bs-toggle="collapse" class="stretched-link" href="#section_{{ $forum->id }}">
  56. <i class="treeview-indicator fas fa-angle-down"></i>
  57. </a>
  58. </div>
  59. @endif
  60. </div>
  61. <div>
  62. @if ($forum->children->isNotEmpty())
  63. <div class="collapse" id="section_{{ $forum->id }}">
  64. <div class="section-content border-top p-2">
  65. @foreach ($forum->children as $child)
  66. <div>
  67. <i class="fas fa-angle-right"></i> <a href="/forums/{{ $child->id }}">{{ $child->title }}</a>
  68. <span class="badge rounded-pill bg-light text-dark">{{ $child->count_topics }}/{{ $child->count_posts }}</span>
  69. </div>
  70. @endforeach
  71. </div>
  72. </div>
  73. @endif
  74. </div>
  75.  
  76. <div class="section-body border-top">
  77. @if ($forum->lastTopic->lastPost->id)
  78. {{ __('forums.topic') }}: <a href="/topics/end/{{ $forum->lastTopic->id }}">{{ $forum->lastTopic->title }}</a>
  79. <br>
  80. {{ __('forums.post') }}: {{ $forum->lastTopic->lastPost->user->getName() }} ({{ dateFixed($forum->lastTopic->lastPost->created_at) }})
  81. @else
  82. {{ __('forums.empty_topics') }}
  83. @endif
  84. </div>
  85. </div>
  86. @endforeach
  87. @else
  88. {{ showError(__('forums.empty_forums')) }}
  89. @endif
  90.  
  91. <a href="/rules">{{ __('main.rules') }}</a> /
  92. <a href="/forums/top/topics">{{ __('forums.top_topics') }}</a> /
  93. <a href="/forums/top/posts">{{ __('forums.top_posts') }}</a> /
  94. <a href="/forums/search">{{ __('main.search') }}</a> /
  95. <a href="/forums/rss">{{ __('main.rss') }}</a><br>
  96. @stop