blog.blade.php 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. @extends('theme::layout.public')
  2. @section('seo_title')
  3. @if($currentCategory){{ $currentCategory->name }} - @else 全部 - @endif
  4. @if($filter === 'hottest')热门的@elseif($filter === 'recommended')推荐的@endif 文章 @if( $articles->currentPage()>1 ) - 第{{ $articles->currentPage() }}页 @endif - {{ Setting()->get('website_name') }}
  5. @endsection
  6. @section('content')
  7. <div class="row mt-10">
  8. <div class="col-xs-12 col-md-9 main">
  9. <ul class="nav nav-tabs mt-20">
  10. <li role="presentation" @if($categorySlug == 'all') class="active" @endif ><a href="{{ route('website.blog') }}">全部</a></li>
  11. @foreach( $tabData['out_tabs'] as $category )
  12. <li role="presentation" @if( $category->id == $currentCategoryId ) class="active" @endif ><a href="{{ route('website.blog',['category_slug'=>$category->slug,'filter'=>$filter]) }}">{{ $category->name }}</a></li>
  13. @endforeach
  14. @if($tabData['in_tabs'])
  15. <li role="presentation" class="dropdown">
  16. <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
  17. 更多 <span class="caret"></span>
  18. </a>
  19. <ul class="dropdown-menu">
  20. @foreach( $tabData['in_tabs'] as $category )
  21. <li role="presentation" @if( $category->id == $currentCategoryId ) class="active" @endif ><a href="{{ route('website.blog',['category_slug'=>$category->slug,'filter'=>$filter]) }}">{{ $category->name }}</a></li>
  22. @endforeach
  23. </ul>
  24. </li>
  25. @endif
  26. </ul>
  27. <div class="nav-child">
  28. <span>筛选:&nbsp;</span>
  29. <a href="{{ route('website.blog',['category_slug'=>$categorySlug,'filter'=>'newest']) }}" class="tag tag-sm @if( $filter == 'newest' ) active @endif mr-5">最新的</a>
  30. <a href="{{ route('website.blog',['category_slug'=>$categorySlug,'filter'=>'recommended']) }}" class="tag tag-sm @if( $filter== 'recommended' ) active @endif mr-5">推荐的</a>
  31. <a href="{{ route('website.blog',['category_slug'=>$categorySlug,'filter'=>'hottest']) }}" class="tag tag-sm @if( $filter == 'hottest' ) active @endif mr-5">热门的</a>
  32. </div>
  33. <div class="stream-list blog-stream">
  34. @foreach($articles as $article)
  35. <section class="stream-list-item clearfix">
  36. @if( $article->logo )
  37. <div class="blog-rank hidden-xs">
  38. <a href="{{ route('blog.article.detail',['id'=>$article->id]) }}" target="_blank"><img style="width: 200px;height:120px;" src="{{ $article->logo }}"></a>
  39. </div>
  40. @endif
  41. <div class="summary">
  42. <h2 class="title"><a href="{{ route('blog.article.detail',['id'=>$article->id]) }}" target="_blank" >{{ $article->title }}</a></h2>
  43. <p class="excerpt wordbreak">{{ $article->summary }}</p>
  44. <ul class="author list-inline mt-20">
  45. <li class="pull-right" title="{{ $article->collections }} 收藏">
  46. <span class="glyphicon glyphicon-bookmark"></span> {{ $article->collections }}
  47. </li>
  48. <li class="pull-right" title="{{ $article->collections }} 推荐">
  49. <span class="glyphicon glyphicon-thumbs-up"></span> {{ $article->supports }}
  50. </li>
  51. <li>
  52. <a href="{{ route('auth.space.index',['user_id'=>$article->user_id]) }}" target="_blank">
  53. <img class="avatar-20 mr-10 hidden-xs" src="{{ $article->user->qrcode }}" alt="{{ $article->user->name }}"> {{ $article->user->name }}
  54. </a>
  55. </li>
  56. <li>发布于 {{ timestamp_format($article->created_at) }}</li>
  57. <li>阅读 ( {{$article->views}} )</li>
  58. </ul>
  59. </div>
  60. </section>
  61. @endforeach
  62. </div>
  63. <div class="text-center">
  64. {!! str_replace('/?', '?', $articles->render()) !!}
  65. </div>
  66. </div><!-- /.main -->
  67. <div class="col-md-3 hidden-xs side">
  68. <div class="side-alert alert alert-warning">
  69. <p>今天,有什么文章需要发布呢?</p>
  70. <a href="{{ route('blog.article.create') }}" class="btn btn-primary btn-block mt-10">立即撰写</a>
  71. </div>
  72. @include('theme::layout.auth_menu')
  73. <div class="widget-box">
  74. <h2 class="h4 widget-box__title">推荐文章</h2>
  75. <ul class="widget-links list-unstyled list-text">
  76. @foreach($hotArticles as $hotArticle)
  77. <li class="widget-links-item">
  78. <a title="{{ $hotArticle->title }}" href="{{ route('blog.article.detail',['id'=>$hotArticle->id]) }}">{{ $hotArticle->title }}</a>
  79. <small class="text-muted">{{ $hotArticle->supports }} 推荐</small>
  80. </li>
  81. @endforeach
  82. </ul>
  83. </div>
  84. <div class="widget-box">
  85. <h2 class="h4 widget-box-title">热门作者 <a href="{{ route('auth.top.articles') }}">»</a></h2>
  86. <ul class="list-unstyled">
  87. @foreach($hotUsers as $hotUser)
  88. <li class="media widget-user-item ">
  89. <a href="{{ route('auth.space.index',['user_id'=>$hotUser['id']]) }}" class="user-card pull-left" target="_blank">
  90. <img class="avatar-50" src="{{ $hotUser->qrcode }}" alt="{{ $hotUser->name }}"></a>
  91. </a>
  92. <div class="media-object">
  93. <strong><a href="{{ route('auth.space.index',['user_id'=>$hotUser['id']]) }}">{{ $hotUser['name'] }}</a></strong>
  94. <p class="text-muted"> {{ $hotUser['articles'] }} 篇文章,{{ $hotUser['supports'] }} 赞同</p>
  95. </div>
  96. </li>
  97. @endforeach
  98. </ul>
  99. </div>
  100. <div class="widget-box">
  101. <h2 class="h4 widget-box-title">热议话题 <a href="{{ route('website.topic') }}" title="更多">»</a></h2>
  102. <ul class="taglist-inline multi">
  103. @foreach($hotTags as $hotTag)
  104. <li class="tagPopup"><a class="tag" data-toggle="popover" href="{{ route('ask.tag.index',['id'=>$hotTag->tag_id,'source_type'=>'articles']) }}">{{ $hotTag->name }}</a></li>
  105. @endforeach
  106. </ul>
  107. </div>
  108. </div>
  109. </div>
  110. @endsection