topic.blade.php 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. @extends('theme::layout.public')
  2. @section('seo_title')话题 @if($topics->currentPage()>1)- 第{{ $topics->currentPage() }}页 @endif - {{ Setting()->get('website_name') }}@endsection
  3. @section('content')
  4. <p class="mt-10">话题不仅能组织和归类你的内容,还能关联相似的内容。正确的使用话题将让你的问题被更多人发现和解决。</p>
  5. @if($parentCategories)
  6. <ol class="breadcrumb text-muted">
  7. <li><a href="{{ route('website.topic') }}">全部</a></li>
  8. @foreach($parentCategories as $parentCategory)
  9. @if($parentId == $parentCategory->id)
  10. <li>{{ $parentCategory->name }}</li>
  11. @else
  12. <li><a href="{{ route('website.topic',['category_slug'=>$parentCategory->slug]) }}">{{ $parentCategory->name }}</a></li>
  13. @endif
  14. @endforeach
  15. </ol>
  16. @endif
  17. @if( $categories )
  18. <div class="widget-category clearfix">
  19. <div class="col-sm-12">
  20. <ul class="list">
  21. @foreach( $categories as $category )
  22. @if($category->parent_id == $parentId)
  23. <li @if( $category->id == $currentCategoryId ) class="active" @endif ><a href="{{ route('website.topic',['category_slug'=>$category->slug]) }}">{{ $category->name }}</a></li>
  24. @endif
  25. @endforeach
  26. </ul>
  27. </div>
  28. </div>
  29. @endif
  30. <div class="row">
  31. <div class="col-md-12 widget-topic-box main">
  32. @foreach($topics as $topic)
  33. <section class="topic-list-item col-md-3">
  34. <div class="widget-topic">
  35. <h2 class="h4">
  36. <a href="{{ route('ask.tag.index',['id'=>$topic->id]) }}" @if($topic->logo) class="tag-logo" style="background-image: url({{$topic->logo}});" @endif>{{ $topic->name }}</a>
  37. </h2>
  38. <p>
  39. @if($topic->description)
  40. {{ str_limit($topic->summary,200) }}
  41. @else
  42. 暂无介绍
  43. @endif
  44. </p>
  45. <div class="widget-topic-action">
  46. @if(Auth()->check() && Auth()->user()->isFollowed(get_class($topic),$topic->id))
  47. <button type="button" class="btn btn-default btn-xs active followTopic mr-5" data-source_type = "tag" data-source_id = "{{ $topic->id }}" data-show_num="false" data-toggle="tooltip" data-placement="right" title="" data-original-title="关注后将获得更新提醒">已关注</button>
  48. @else
  49. <button type="button" class="btn btn-default btn-xs followTopic mr-5" data-source_type = "tag" data-source_id = "{{ $topic->id }}" data-show_num="false" data-toggle="tooltip" data-placement="right" title="" data-original-title="关注后将获得更新提醒">关注</button>
  50. @endif
  51. <strong class="follows">{{ $topic->followers }}</strong> <span class="text-muted">关注</span>
  52. </div>
  53. </div>
  54. </section>
  55. @endforeach
  56. <div class="text-center">
  57. {!! str_replace('/?', '?', $topics->render()) !!}
  58. </div>
  59. </div>
  60. </div>
  61. @endsection