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

Размер файла: 5.14Kb
  1. @extends('layout')
  2.  
  3. @section('title', $article->title . ' - ' . __('main.comments') . ' (' . __('main.page_num', ['page' => $comments->currentPage()]) . ')')
  4.  
  5. @section('header')
  6. <h1>{{ $article->title }} - {{ __('main.comments') }}</h1>
  7. @stop
  8.  
  9. @section('breadcrumb')
  10. <nav>
  11. <ol class="breadcrumb">
  12. <li class="breadcrumb-item"><a href="/"><i class="fas fa-home"></i></a></li>
  13. <li class="breadcrumb-item"><a href="/blogs">{{ __('index.blogs') }}</a></li>
  14.  
  15. @if ($article->category->parent->id)
  16. <li class="breadcrumb-item"><a href="/blogs/{{ $article->category->parent->id }}">{{ $article->category->parent->name }}</a></li>
  17. @endif
  18.  
  19. <li class="breadcrumb-item"><a href="/blogs/{{ $article->category->id }}">{{ $article->category->name }}</a></li>
  20. <li class="breadcrumb-item"><a href="/articles/{{ $article->id }}">{{ $article->title }}</a></li>
  21. <li class="breadcrumb-item active">{{ __('main.comments') }}</li>
  22. </ol>
  23. </nav>
  24. @stop
  25.  
  26. @section('content')
  27. <i class="fas fa-rss"></i> <a href="/articles/rss/{{ $article->id }}">{{ __('main.rss') }}</a>
  28. <hr>
  29.  
  30. @if ($comments->isNotEmpty())
  31. @foreach ($comments as $comment)
  32. <div class="section mb-3 shadow" id="comment_{{ $comment->id }}">
  33. <div class="user-avatar">
  34. {{ $comment->user->getAvatar() }}
  35. {{ $comment->user->getOnline() }}
  36. </div>
  37.  
  38. <div class="section-user d-flex align-items-center">
  39. <div class="flex-grow-1">
  40. {{ $comment->user->getProfile() }}
  41. <small class="section-date text-muted fst-italic">{{ dateFixed($comment->created_at) }}</small><br>
  42. <small class="fst-italic">{{ $comment->user->getStatus() }}</small>
  43. </div>
  44.  
  45. @if (getUser())
  46. <div class="text-end">
  47. @if (getUser('id') !== $comment->user_id)
  48. <a href="#" onclick="return postReply(this)" data-bs-toggle="tooltip" title="{{ __('main.reply') }}"><i class="fa fa-reply text-muted"></i></a>
  49.  
  50. <a href="#" onclick="return postQuote(this)" data-bs-toggle="tooltip" title="{{ __('main.quote') }}"><i class="fa fa-quote-right text-muted"></i></a>
  51.  
  52. <a href="#" onclick="return sendComplaint(this)" data-type="{{ $comment->relate->getMorphClass() }}" data-id="{{ $comment->id }}" data-token="{{ $_SESSION['token'] }}" data-page="{{ $comments->currentPage() }}" rel="nofollow" data-bs-toggle="tooltip" title="{{ __('main.complain') }}"><i class="fa fa-bell text-muted"></i></a>
  53.  
  54. @endif
  55.  
  56. @if ($comment->created_at + 600 > SITETIME && getUser('id') === $comment->user_id)
  57. <a href="/articles/edit/{{ $article->id }}/{{ $comment->id }}?page={{ $comments->currentPage() }}" data-bs-toggle="tooltip" title="{{ __('main.edit') }}"><i class="fa fa-pencil-alt text-muted"></i></a>
  58. @endif
  59.  
  60. @if (isAdmin())
  61. <a href="#" onclick="return deleteComment(this)" data-rid="{{ $comment->relate_id }}" data-id="{{ $comment->id }}" data-type="{{ $comment->relate->getMorphClass() }}" data-token="{{ $_SESSION['token'] }}" data-bs-toggle="tooltip" title="{{ __('main.delete') }}"><i class="fa fa-times text-muted"></i></a>
  62. @endif
  63. </div>
  64. @endif
  65. </div>
  66.  
  67. <div class="section-body border-top">
  68. <div class="section-message">
  69. {{ bbCode($comment->text) }}
  70. </div>
  71.  
  72. @if (isAdmin())
  73. <div class="small text-muted fst-italic mt-2">{{ $comment->brow }}, {{ $comment->ip }}</div>
  74. @endif
  75. </div>
  76. </div>
  77. @endforeach
  78. @else
  79. {{ showError(__('main.empty_comments')) }}
  80. @endif
  81.  
  82. {{ $comments->links() }}
  83.  
  84. @if (getUser())
  85. <div class="section-form mb-3 shadow">
  86. <form action="/articles/comments/{{ $article->id }}" method="post">
  87. @csrf
  88. <div class="mb-3{{ hasError('msg') }}">
  89. <label for="msg" class="form-label">{{ __('main.message') }}:</label>
  90. <textarea class="form-control markItUp" maxlength="{{ setting('comment_length') }}" id="msg" rows="5" name="msg" required>{{ getInput('msg') }}</textarea>
  91. <div class="invalid-feedback">{{ textError('msg') }}</div>
  92. <span class="js-textarea-counter"></span>
  93. </div>
  94.  
  95. <button class="btn btn-success">{{ __('main.write') }}</button>
  96. </form>
  97. </div>
  98.  
  99. <a href="/rules">{{ __('main.rules') }}</a> /
  100. <a href="/stickers">{{ __('main.stickers') }}</a> /
  101. <a href="/tags">{{ __('main.tags') }}</a><br><br>
  102.  
  103. @else
  104. {{ showError(__('main.not_authorized')) }}
  105. @endif
  106. @stop