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

Размер файла: 3.9Kb
  1. @extends('layout')
  2.  
  3. @section('title', $article->title)
  4.  
  5. @section('description', truncateDescription(bbCode($article->text, false)))
  6.  
  7. @section('header')
  8. @if (getUser())
  9. <div class="float-end">
  10. @if (getUser('id') === $article->user->id)
  11. <a class="btn btn-success" href="/articles/edit/{{ $article->id }}">{{ __('main.change') }}</a>
  12. @endif
  13.  
  14. @if (isAdmin())
  15. <div class="btn-group">
  16. <button type="button" class="btn btn-light dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  17. <i class="fas fa-wrench"></i>
  18. </button>
  19. <div class="dropdown-menu dropdown-menu-end">
  20. <a class="dropdown-item" href="/admin/articles/edit/{{ $article->id }}">{{ __('main.edit') }}</a>
  21. <a class="dropdown-item" href="/admin/articles/move/{{ $article->id }}">{{ __('main.move') }}</a>
  22. <a class="dropdown-item" href="/admin/articles/delete/{{ $article->id }}?token={{ $_SESSION['token'] }}" onclick="return confirm('{{ __('blogs.confirm_delete_article') }}')">{{ __('main.delete') }}</a>
  23. </div>
  24. </div>
  25. @endif
  26. </div>
  27. @endif
  28.  
  29. <h1>{{ $article->title }} <small>({{ __('main.rating') }}: {{ formatNum($article->rating) }})</small></h1>
  30. @stop
  31.  
  32. @section('breadcrumb')
  33. <nav>
  34. <ol class="breadcrumb">
  35. <li class="breadcrumb-item"><a href="/"><i class="fas fa-home"></i></a></li>
  36. <li class="breadcrumb-item"><a href="/blogs">{{ __('index.blogs') }}</a></li>
  37.  
  38. @if ($article->category->parent->id)
  39. <li class="breadcrumb-item"><a href="/blogs/{{ $article->category->parent->id }}">{{ $article->category->parent->name }}</a></li>
  40. @endif
  41. <li class="breadcrumb-item"><a href="/blogs/{{ $article->category_id }}">{{ $article->category->name }}</a></li>
  42. <li class="breadcrumb-item active">{{ $article->title }}</li>
  43. </ol>
  44. </nav>
  45. @stop
  46.  
  47. @section('content')
  48. <i class="fas fa-print"></i> <a class="me-3" href="/articles/print/{{ $article->id }}">{{ __('main.print') }}</a>
  49. <i class="fas fa-rss"></i> <a href="/articles/rss/{{ $article->id }}">{{ __('main.rss') }}</a>
  50. <hr>
  51.  
  52. <div class="mb-3">
  53. <div class="section-message mb-3">
  54. {{ bbCode($article->text) }}
  55. </div>
  56.  
  57. {{ __('main.added') }}: {{ $article->user->getProfile() }}
  58. <small class="section-date text-muted fst-italic">{{ dateFixed($article->created_at) }}</small><br>
  59.  
  60. <div class="my-3 fst-italic">
  61. <i class="fa fa-tag"></i> {!! $tags !!}
  62. </div>
  63.  
  64. <div class="js-rating">{{ __('main.rating') }}:
  65. @if (getUser() && getUser('id') !== $article->user_id)
  66. <a class="post-rating-down<?= $article->vote === '-' ? ' active' : '' ?>" href="#" onclick="return changeRating(this);" data-id="{{ $article->id }}" data-type="{{ $article->getMorphClass() }}" data-vote="-" data-token="{{ $_SESSION['token'] }}"><i class="fa fa-thumbs-down"></i></a>
  67. @endif
  68. <b>{{ formatNum($article->rating) }}</b>
  69. @if (getUser() && getUser('id') !== $article->user_id)
  70. <a class="post-rating-up<?= $article->vote === '+' ? ' active' : '' ?>" href="#" onclick="return changeRating(this);" data-id="{{ $article->id }}" data-type="{{ $article->getMorphClass() }}" data-vote="+" data-token="{{ $_SESSION['token'] }}"><i class="fa fa-thumbs-up"></i></a>
  71. @endif
  72. </div>
  73.  
  74. <i class="fa fa-eye"></i> {{ __('main.views') }}: {{ $article->visits }}<br>
  75. <i class="fa fa-comment"></i> <a href="/articles/comments/{{ $article->id }}">{{ __('main.comments') }}</a> ({{ $article->count_comments }})
  76. <a href="/articles/end/{{ $article->id }}">&raquo;</a>
  77. </div>
  78. @stop