show.blade.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. {{-- resources/views/library/anthology/show.blade.php --}}
  2. @extends('layouts.library')
  3. @section('title', $anthology['title'] . ' · 巴利书库')
  4. @push('styles')
  5. @vite('resources/css/modules/_anthology.css')
  6. @endpush
  7. @section('breadcrumb')
  8. <li class="breadcrumb-item">
  9. <a href="{{ route('library.home') }}">首页</a>
  10. </li>
  11. <li class="breadcrumb-item">
  12. <a href="{{ route('library.anthology.index') }}">文集</a>
  13. </li>
  14. <li class="breadcrumb-item active">{{ $anthology['title'] }}</li>
  15. @endsection
  16. @section('hero')
  17. <div class="anthology-hero">
  18. <div class="container-xl">
  19. <div class="hero-inner">
  20. {{-- 3D 书籍封面 --}}
  21. <x-ui.book-cover
  22. :image="$anthology['cover_image'] ?? null"
  23. :gradient="$anthology['cover_gradient']"
  24. :title="$anthology['title']"
  25. :subtitle="$anthology['subtitle'] ?? ''"
  26. size="lg"
  27. :style3d="true"
  28. />
  29. {{-- 文集信息 --}}
  30. <div class="hero-content">
  31. <div class="hero-title">{{ $anthology['title'] }}</div>
  32. @if(!empty($anthology['subtitle']))
  33. <div class="hero-subtitle">{{ $anthology['subtitle'] }}</div>
  34. @endif
  35. @if(!empty($anthology['tags']))
  36. <div class="hero-tags">
  37. @foreach($anthology['tags'] as $tag)
  38. <span class="hero-tag">{{ $tag }}</span>
  39. @endforeach
  40. </div>
  41. @endif
  42. <div class="hero-info-row">
  43. <div class="hi-item">
  44. <x-ui.author-avatar
  45. :avatar="$anthology['author']['avatar'] ?? null"
  46. :color="$anthology['author']['color']"
  47. :initials="$anthology['author']['initials']"
  48. :name="$anthology['author']['name']"
  49. size="sm"
  50. />
  51. <div>
  52. <span class="hi-label">作者</span>
  53. <span class="hi-value">{{ $anthology['author']['name'] }}</span>
  54. </div>
  55. </div>
  56. <div class="hi-item">
  57. <div>
  58. <span class="hi-label">最后更新</span>
  59. <span class="hi-value">{{ $anthology['updated_at'] }}</span>
  60. </div>
  61. </div>
  62. <div class="hi-item">
  63. <div>
  64. <span class="hi-label">章节数</span>
  65. <span class="hi-value">{{ $anthology['children_number'] }} 章节</span>
  66. </div>
  67. </div>
  68. <div class="hi-item">
  69. <div>
  70. <span class="hi-label">创建时间</span>
  71. <span class="hi-value">{{ $anthology['created_at'] }}</span>
  72. </div>
  73. </div>
  74. </div>
  75. @if(!empty($anthology['description']))
  76. <div class="hero-desc">{{ $anthology['description'] }}</div>
  77. @endif
  78. <div>
  79. @if(!empty($anthology['articles']))
  80. <a href="{{ route('library.anthology.read', [
  81. 'anthology' => $anthology['id'],
  82. 'article' => $anthology['articles'][0]['id']
  83. ]) }}"
  84. class="btn-read-primary">
  85. <i class="ti ti-book-2"></i>
  86. 在线阅读
  87. </a>
  88. @endif
  89. <a href="{{ config('mint.server.dashboard_base_path') }}/workspace/anthology/{{ $anthology['id'] }}"
  90. class="btn-outline-hero">
  91. <i class="ti ti-pencil"></i>
  92. 在编辑器中打开
  93. </a>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. </div>
  99. @endsection
  100. @section('content')
  101. <div class="page-body">
  102. <div class="container-xl">
  103. <div class="row mt-2">
  104. {{-- 主内容 --}}
  105. <div class="col-lg-8">
  106. {{-- 关于本文集 --}}
  107. @if(!empty($anthology['about']))
  108. <div class="sec-card">
  109. <div class="sec-header">
  110. <div class="sec-bar"></div>
  111. <div class="sec-title">关于本文集</div>
  112. </div>
  113. <div class="sec-body">
  114. @foreach(explode("\n", $anthology['about']) as $para)
  115. @if(trim($para))
  116. <p>{{ trim($para) }}</p>
  117. @endif
  118. @endforeach
  119. </div>
  120. </div>
  121. @endif
  122. {{-- 目录 --}}
  123. <div class="sec-card">
  124. <div class="sec-header">
  125. <div class="sec-bar"></div>
  126. <div class="sec-title">目录</div>
  127. <div class="sec-count">{{ $anthology['children_number'] }} 章节</div>
  128. </div>
  129. <ul class="toc-ul">
  130. @foreach($anthology['articles'] as $article)
  131. <li>
  132. <a href="{{ route('library.anthology.read', [
  133. 'anthology' => $anthology['id'],
  134. 'article' => $article['id']
  135. ]) }}">
  136. <span class="toc-num">{{ str_pad($article['order'], 2, '0', STR_PAD_LEFT) }}</span>
  137. <span class="toc-name">{{ $article['title'] }}</span>
  138. <span class="toc-arrow">›</span>
  139. </a>
  140. </li>
  141. @endforeach
  142. </ul>
  143. </div>
  144. </div>
  145. {{-- 侧边栏 --}}
  146. <div class="col-lg-4">
  147. {{-- 文集信息 --}}
  148. <div class="sb-card">
  149. <div class="sb-head">文集信息</div>
  150. <div class="smeta-row">
  151. <span class="smeta-label">作者</span>
  152. <span class="smeta-value">
  153. <a href="#">{{ $anthology['author']['name'] }}</a>
  154. </span>
  155. </div>
  156. @if(!empty($anthology['language']))
  157. <div class="smeta-row">
  158. <span class="smeta-label">语言</span>
  159. <span class="smeta-value">{{ $anthology['language'] }}</span>
  160. </div>
  161. @endif
  162. <div class="smeta-row">
  163. <span class="smeta-label">章节</span>
  164. <span class="smeta-value">{{ $anthology['children_number'] }} 章节</span>
  165. </div>
  166. <div class="smeta-row">
  167. <span class="smeta-label">创建</span>
  168. <span class="smeta-value">{{ $anthology['created_at'] }}</span>
  169. </div>
  170. <div class="smeta-row">
  171. <span class="smeta-label">更新</span>
  172. <span class="smeta-value">{{ $anthology['updated_at'] }}</span>
  173. </div>
  174. @if(!empty($anthology['category']))
  175. <div class="smeta-row">
  176. <span class="smeta-label">分类</span>
  177. <span class="smeta-value">{{ $anthology['category'] }}</span>
  178. </div>
  179. @endif
  180. </div>
  181. {{-- 作者 --}}
  182. <div class="sb-card">
  183. <div class="sb-head">作者</div>
  184. <div class="author-block">
  185. <x-ui.author-avatar
  186. :avatar="$anthology['author']['avatar'] ?? null"
  187. :color="$anthology['author']['color']"
  188. :initials="$anthology['author']['initials']"
  189. size="lg"
  190. />
  191. <div>
  192. <div class="author-block-name">{{ $anthology['author']['name'] }}</div>
  193. <div class="author-block-stats">
  194. @if($anthology['author']['article_count'])
  195. {{ $anthology['author']['article_count'] }} 篇文章
  196. @endif
  197. </div>
  198. </div>
  199. </div>
  200. @if(!empty($anthology['author']['bio']))
  201. <div class="author-bio">{{ $anthology['author']['bio'] }}</div>
  202. @endif
  203. </div>
  204. {{-- 相关文集 --}}
  205. @if($related->count())
  206. <div class="sb-card">
  207. <div class="sb-head">相关文集</div>
  208. <ul class="related-ul">
  209. @foreach($related as $rel)
  210. <li>
  211. <a href="{{ route('library.anthology.show', $rel['id']) }}">
  212. <x-ui.book-cover
  213. :image="null"
  214. :gradient="$rel['cover_gradient']"
  215. :title="mb_substr($rel['title'], 0, 4)"
  216. size="sm"
  217. :style3d="false"
  218. />
  219. <div>
  220. <div class="related-t">{{ $rel['title'] }}</div>
  221. <div class="related-a">{{ $rel['author_name'] }}</div>
  222. </div>
  223. </a>
  224. </li>
  225. @endforeach
  226. </ul>
  227. </div>
  228. @endif
  229. </div>
  230. </div>
  231. </div>
  232. </div>
  233. @endsection