index.blade.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. @extends('theme::layout.public')
  2. @section('seo_title'){{ parse_seo_template('seo_index_title','default') }}@endsection
  3. @section('jumbotron')
  4. @if(Auth()->guest())
  5. <div class="jumbotron text-center hidden-xs">
  6. <h4>{{ Setting()->get('website_welcome','现在加入矿山问答系统,一起记录矿山的世界') }} {{--<a class="btn btn-primary ml-10" href="{{ route('auth.user.register') }}" role="button">立即注册</a>--}} <a class="btn btn-primary ml-10" href="{{ route('auth.user.login') }}" role="button">用户登录</a></h4>
  7. </div>
  8. @endif
  9. @endsection
  10. @section('content')
  11. <div class="row mt-10">
  12. <div class="col-xs-12 col-md-9 main">
  13. <div class="widget-box mb-10">
  14. <h4 class="widget-box-title">最新推荐</h4>
  15. <div class="job-list-item row">
  16. <div class="col-md-6">
  17. <div id="carousel-recommendation" class="carousel slide" data-ride="carousel">
  18. <!-- Indicators -->
  19. <ol class="carousel-indicators">
  20. <li data-target="#carousel-recommendation" data-slide-to="0" class="active"></li>
  21. <li data-target="#carousel-recommendation" data-slide-to="1"></li>
  22. <li data-target="#carousel-recommendation" data-slide-to="2"></li>
  23. </ol>
  24. <!-- Wrapper for slides -->
  25. <div class="carousel-inner" role="leftmodbox">
  26. @foreach($recommendItems as $key=> $recommendItem)
  27. @if($key<3)
  28. <div @if($key===0) class="item active" @else class="item" @endif>
  29. <a href="{{ $recommendItem->url }}" target="_blank"><img src="{{ route('website.image.show',['image_name'=>$recommendItem->logo]) }}" alt="{{ $recommendItem->subject }}"></a>
  30. <div class="carousel-caption">
  31. <h4>{{ $recommendItem->subject }}</h4>
  32. </div>
  33. </div>
  34. @endif
  35. @endforeach
  36. </div>
  37. </div>
  38. </div>
  39. <div class="col-md-6">
  40. <ul class="widget-links list-unstyled">
  41. @foreach($recommendItems as $key=> $recommendItem)
  42. @if($key>2)
  43. <li class="widget-links-item">
  44. <a href="{{ $recommendItem->url }}" target="_blank" >{{ $recommendItem->subject }}</a>
  45. </li>
  46. @endif
  47. @endforeach
  48. </ul>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="widget-box border-top">
  53. <div class="job-list-item row">
  54. <div class="col-md-6">
  55. <h4 class="widget-box-title">最新问题 <a href="{{ route('website.ask',['category_slug'=>'all','filter'=>'newest']) }}" target="_blank" title="更多">»</a> </h4>
  56. <ul class="widget-links list-unstyled">
  57. @foreach($newestQuestions as $newQuestion)
  58. <li class="widget-links-item">
  59. <a title="{{ $newQuestion->title }}" target="_blank" href="{{ route('ask.question.detail',['id'=>$newQuestion->id]) }}">{{ str_limit($newQuestion->title,42) }}</a>
  60. <small class="text-muted">{{ $newQuestion->answers }} 回答</small>
  61. </li>
  62. @endforeach
  63. </ul>
  64. </div>
  65. <div class="col-md-6">
  66. <h4 class="widget-box-title">悬赏问题 <a href="{{ route('website.ask',['category_slug'=>'all','filter'=>'reward']) }}" target="_blank" title="更多">»</a></h4>
  67. <ul class="widget-links list-unstyled">
  68. @foreach($rewardQuestions as $rewardQuestion)
  69. <li class="widget-links-item">
  70. <span class="text-gold"><i class="fa fa-database"></i> {{ $rewardQuestion->price }}</span>
  71. <a target="_blank" title="{{ $rewardQuestion->title }}" href="{{ route('ask.question.detail',['id'=>$rewardQuestion->id]) }}">{{ str_limit($rewardQuestion->title,42) }}</a>
  72. </li>
  73. @endforeach
  74. </ul>
  75. </div>
  76. </div>
  77. </div>
  78. @if($hotExperts)
  79. <div class="widget-box clearfix border-top">
  80. <h4 class="widget-box-title">推荐专家 <a href="{{ route('website.experts') }}" title="更多">»</a></h4>
  81. <div class="row row-horizon">
  82. @foreach($hotExperts as $expert)
  83. <section class="col-sm-6 col-md-3">
  84. <div class="thumbnail">
  85. <a href="{{ route('auth.space.index',['user_id'=>$expert->user_id]) }}" target="_blank"><img class="avatar-128" src="{{ $expert->qrcode }}" alt="{{ $expert->real_name }}"></a>
  86. <div class="caption">
  87. <h4 class="text-center"><a href="{{ route('auth.space.index',['user_id'=>$expert->user_id]) }}" title="{{ $expert->real_name }}">{{ str_limit($expert->real_name,10,'') }}</a></h4>
  88. <p class="text-muted text-center" title="{{ $expert->title }}">{{ str_limit($expert->title,16,'') }}&nbsp;</p>
  89. <p class="text-center"><a class="btn btn-primary btn-sm" href="{{ route('ask.question.create') }}?to_user_id={{ $expert->user_id }}">向TA提问</a></p>
  90. </div>
  91. </div>
  92. </section>
  93. @endforeach
  94. </div>
  95. </div>
  96. @endif
  97. <div class="widget-box border-top">
  98. <div class="job-list-item row">
  99. <div class="col-md-6">
  100. <h4 class="widget-box-title">热门文章 <a href="{{ route('website.blog',['category_slug'=>'all','filter'=>'hottest']) }}" title="更多">»</a></h4>
  101. <ul class="widget-links list-unstyled">
  102. @foreach($hotArticles as $hotArticle)
  103. <li class="widget-links-item">
  104. <a title="{{ $hotArticle->title }}" target="_blank" href="{{ route('blog.article.detail',['id'=>$hotArticle->id]) }}">{{ str_limit($hotArticle->title,42) }}</a>
  105. <small class="text-muted">{{ $hotArticle->views }} 浏览</small>
  106. </li>
  107. @endforeach
  108. </ul>
  109. </div>
  110. <div class="col-md-6">
  111. <h4 class="widget-box-title">最新文章 <a href="{{ route('website.blog',['category_slug'=>'all','filter'=>'newest']) }}" title="更多">»</a></h4>
  112. <ul class="widget-links list-unstyled">
  113. @foreach($newestArticles as $newestArticle)
  114. <li class="widget-links-item">
  115. <a title="{{ $newestArticle->title }}" target="_blank" href="{{ route('blog.article.detail',['id'=>$newestArticle->id]) }}">{{ str_limit($newestArticle->title,42) }}</a>
  116. <small class="text-muted">{{ $newestArticle->views }} 浏览</small>
  117. </li>
  118. @endforeach
  119. </ul>
  120. </div>
  121. </div>
  122. </div>
  123. @if($hotUsers)
  124. <div class="widget-box clearfix border-top widget-user-box">
  125. <h4 class="widget-box-title">活跃用户 <a href="{{ route('website.user') }}" title="更多">»</a></h4>
  126. <ul class="user-list">
  127. @foreach($hotUsers as $hotUser)
  128. <li>
  129. <a href="{{ route('auth.space.index',['id'=>$hotUser->user_id]) }}" target="_blank" title="{{ $hotUser->user->name }}"><img class="avatar-50" src="{{ $hotUser->user->qrcode }}" alt="{{ $hotUser->user->name }}"></a>
  130. <span class="username"><a href="{{ route('auth.space.index',['id'=>$hotUser->user_id]) }}" title="{{$hotUser->user->name}}">{{ str_limit($hotUser->user->name,6,'')}}</a></span>
  131. </li>
  132. @endforeach
  133. </ul>
  134. </div>
  135. @endif
  136. </div>
  137. <div class="col-md-3 hidden-xs side">
  138. <div class="side-alert alert alert-link">
  139. <a href="{{ route('ask.question.create') }}" class="btn btn-warning btn-block">我要提问</a>
  140. <a href="{{ route('blog.article.create') }}" class="btn btn-primary btn-block">发布文章</a>
  141. </div>
  142. @if(Setting()->get('open_user_sign'))
  143. <div class="side-sign alert alert-link">
  144. <ul class="sign-box">
  145. @if(Auth()->check() && Auth()->user()->isSigned())
  146. <dt><button class="btn btn-primary btn-large" disabled>已签到</button></dt>
  147. @else
  148. <dt><a href="{{ route('auth.user.sign') }}" class="btn btn-primary btn-large">签&nbsp;&nbsp;到</a></dt>
  149. @endif
  150. <dd>
  151. <p>{{ $signDate->toDateString() }}</p>
  152. <p>{{ trans_day_of_week($signDate->dayOfWeek) }}</p>
  153. </dd>
  154. </ul>
  155. </div>
  156. @endif
  157. @include('theme::layout.auth_menu')
  158. <div class="widget-box">
  159. <h4 class="widget-box-title">最新公告</h4>
  160. <ul class="widget-links list-unstyled">
  161. @foreach($newestNotices as $newestNotice)
  162. <li class="widget-links-item">
  163. <a title="{{ $newestNotice->subject }}" href="{{ $newestNotice->url }}" @if($newestNotice->style) {!! $newestNotice->style !!} @endif >{{ $newestNotice->subject }}</a>
  164. </li>
  165. @endforeach
  166. </ul>
  167. </div>
  168. <div class="widget-box">
  169. <h2 class="h4 widget-box-title">热议话题 <a href="{{ route('website.topic') }}" title="更多">»</a></h2>
  170. <ul class="taglist-inline multi">
  171. @foreach($hotTags as $hotTag)
  172. <li class="tagPopup"><a class="tag" data-toggle="popover" href="{{ route('ask.tag.index',['id'=>$hotTag->tag_id]) }}" target="_blank">{{ $hotTag->name }}</a></li>
  173. @endforeach
  174. </ul>
  175. </div>
  176. <div class="widget-box mt30">
  177. <h2 class="widget-box-title">
  178. 财富榜
  179. <a href="{{ route('auth.top.coins') }}" title="更多">»</a>
  180. </h2>
  181. <ol class="widget-top10">
  182. @foreach($topCoinUsers as $index => $topCoinUser)
  183. <li class="text-muted">
  184. <img class="avatar-32" src="{{ $topCoinUser['qrcode'] }}">
  185. <a href="{{ route('auth.space.index',['user_id'=>$topCoinUser['id']]) }}" class="ellipsis" target="_blank">{{ $topCoinUser['name'] }}</a>
  186. <span class="text-muted pull-right">{{ $topCoinUser['coins'] }} 金币</span>
  187. </li>
  188. @endforeach
  189. </ol>
  190. </div>
  191. </div>
  192. </div>
  193. @endsection