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

Размер файла: 2.51Kb
  1. @extends('layout')
  2.  
  3. @section('title', __('blogs.articles_all') . ' (' . __('main.page_num', ['page' => $articles->currentPage()]) . ')')
  4.  
  5. @section('header')
  6.  
  7. @if (getUser())
  8. <div class="float-end">
  9. <a class="btn btn-success" href="/blogs/create">{{ __('blogs.add') }}</a>
  10. </div>
  11. @endif
  12.  
  13. <h1>{{ __('blogs.articles_all') }}</h1>
  14. @stop
  15.  
  16. @section('breadcrumb')
  17. <nav>
  18. <ol class="breadcrumb">
  19. <li class="breadcrumb-item"><a href="/"><i class="fas fa-home"></i></a></li>
  20. <li class="breadcrumb-item"><a href="/blogs">{{ __('index.blogs') }}</a></li>
  21. <li class="breadcrumb-item active">{{ __('blogs.articles_all') }}</li>
  22. </ol>
  23. </nav>
  24. @stop
  25.  
  26. @section('content')
  27. @if ($articles->isNotEmpty())
  28. @foreach ($articles as $article)
  29. <div class="card mb-3">
  30. <div class="card-body">
  31. <h5 class="card-title"><a href="/articles/{{ $article->id }}">{{ $article->title }}</a> <small>(Рейтинг: {{ formatNum($article->rating) }})</small></h5>
  32.  
  33. @if ($article->category->parent->id)
  34. <a href="/blogs/{{ $article->category->parent->id }}"><span class="badge bg-light text-dark">{{ $article->category->parent->name }}</span></a> /
  35. @endif
  36.  
  37. <a href="/blogs/{{ $article->category->id }}"><span class="badge bg-light text-dark">{{ $article->category->name }}</span></a>
  38.  
  39. <p class="card-text">
  40. {{ $article->shortText() }}
  41. </p>
  42. </div>
  43. <div class="card-footer text-muted">
  44. {{ __('main.author') }}: {{ $article->user->getProfile() }} ({{ dateFixed($article->created_at) }})
  45. {{ __('main.views') }}: {{ $article->visits }}
  46. <div class="float-end">
  47. <a href="/articles/comments/{{ $article->id }}">{{ __('main.comments') }}</a> ({{ $article->count_comments }})
  48. <a href="/articles/end/{{ $article->id }}">&raquo;</a>
  49. </div>
  50. </div>
  51. </div>
  52. @endforeach
  53.  
  54. {{ $articles->links() }}
  55. @else
  56. {{ showError(__('blogs.empty_articles')) }}
  57. @endif
  58.  
  59. <a href="/blogs/top">{{ __('blogs.top_articles') }}</a> /
  60. <a href="/blogs/tags">{{ __('blogs.tag_cloud') }}</a> /
  61. <a href="/blogs/search">{{ __('main.search') }}</a> /
  62. <a href="/blogs/authors">{{ __('blogs.authors') }}</a>
  63. @stop