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

Размер файла: 2.17Kb
  1. @extends('layout')
  2.  
  3. @section('title', __('blogs.top_articles') . ' (' . __('main.page_num', ['page' => $articles->currentPage()]) . ')')
  4.  
  5. @section('header')
  6. <h1>{{ __('blogs.top_articles') }}</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. <li class="breadcrumb-item active">{{ __('blogs.top_articles') }}</li>
  15. </ol>
  16. </nav>
  17. @stop
  18.  
  19. @section('content')
  20. {{ __('main.sort') }}:
  21.  
  22. <?php $active = ($order === 'visits') ? 'success' : 'light text-dark'; ?>
  23. <a href="/blogs/top?sort=visits" class="badge bg-{{ $active }}">{{ __('main.views') }}</a>
  24.  
  25. <?php $active = ($order === 'rating') ? 'success' : 'light text-dark'; ?>
  26. <a href="/blogs/top?sort=rated" class="badge bg-{{ $active }}">{{ __('main.rating') }}</a>
  27.  
  28. <?php $active = ($order === 'count_comments') ? 'success' : 'light text-dark'; ?>
  29. <a href="/blogs/top?sort=comments" class="badge bg-{{ $active }}">{{ __('main.comments') }}</a>
  30. <hr>
  31.  
  32. @if ($articles->isNotEmpty())
  33. @foreach ($articles as $article)
  34. <div class="section mb-3 shadow">
  35. <div class="section-title">
  36. <i class="fa fa-pencil-alt"></i>
  37. <a href="/articles/{{ $article->id }}">{{ $article->title }}</a> ({{ formatNum($article->rating) }})
  38. </div>
  39.  
  40. <div class="section-content">
  41. {{ __('blogs.blog') }}: <a href="/blogs/{{ $article->category_id }}">{{ $article->name }}</a><br>
  42. {{ __('main.author') }}: {{ $article->user->getProfile() }}<br>
  43. {{ __('main.views') }}: {{ $article->visits }}<br>
  44. <a href="/articles/comments/{{ $article->id }}">{{ __('main.comments') }}</a> ({{ $article->count_comments }})
  45. <a href="/articles/end/{{ $article->id }}">&raquo;</a>
  46. </div>
  47. </div>
  48. @endforeach
  49. @else
  50. {{ showError(__('blogs.empty_articles')) }}
  51. @endif
  52.  
  53. {{ $articles->links() }}
  54. @stop