show.blade.php 10 KB

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