show.blade.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. {{-- resources/views/library/tipitaka/show.blade.php --}}
  2. @extends('layouts.library')
  3. @section('title', $book['title'] . ' · 巴利书库')
  4. @push('styles')
  5. @vite('resources/css/modules/_tipitaka.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.tipitaka.index') }}">三藏</a>
  13. </li>
  14. <li class="breadcrumb-item active">{{ $book['title'] }}</li>
  15. @endsection
  16. @section('content')
  17. <div class="page-body">
  18. <div class="container-xl wiki-layout">
  19. {{-- 左侧边栏:封面 + 操作按钮 --}}
  20. <aside class="wiki-sidebar-left">
  21. <div class="wiki-sidebar-section" style="padding: 1rem;">
  22. {{-- 封面 --}}
  23. <x-ui.book-cover
  24. :image="$book['cover'] ?? null"
  25. :gradient="$book['cover_gradient'] ?? 'linear-gradient(135deg, #2d2010 0%, #1a1208 100%)'"
  26. :title="$book['title']"
  27. size="md"
  28. :style3d="false"
  29. style="width: 100%; min-width: unset; height: 220px;" />
  30. {{-- 操作按钮 --}}
  31. <div style="margin-top: 1rem;">
  32. <a href="{{ route('library.tipitaka.read', $book['id']) }}"
  33. class="btn btn-primary w-100 mb-2">
  34. <i class="ti ti-book-2 me-1"></i>
  35. 在线阅读
  36. </a>
  37. <button class="btn btn-outline-secondary w-100">
  38. <i class="ti ti-download me-1"></i>
  39. 下载
  40. </button>
  41. </div>
  42. </div>
  43. </aside>
  44. {{-- 主内容区 --}}
  45. <main class="wiki-main">
  46. {{-- 书籍信息 --}}
  47. <div class="wiki-card">
  48. <div class="wiki-entry-header">
  49. <div class="wiki-entry-title">{{ $book['title'] }}</div>
  50. </div>
  51. <table class="wiki-meta-table" style="margin-bottom: 1.25rem;">
  52. <tr>
  53. <td>作者</td>
  54. <td>{{ $book['author'] }}</td>
  55. </tr>
  56. @if(isset($book['publisher']))
  57. <tr>
  58. <td>出版</td>
  59. <td>
  60. <a href="{{ route('blog.index', ['user' => $book['publisher']->username]) }}"
  61. style="color: var(--tblr-primary); text-decoration: none;">
  62. {{ $book['publisher']->nickname }}
  63. </a>
  64. </td>
  65. </tr>
  66. @endif
  67. <tr>
  68. <td>语言</td>
  69. <td>{{ $book['language'] ?? '巴利语' }}</td>
  70. </tr>
  71. </table>
  72. @if(!empty($book['description']))
  73. <div class="wiki-content-body">
  74. <p>{{ $book['description'] }}</p>
  75. </div>
  76. @endif
  77. </div>
  78. {{-- 目录 --}}
  79. @if(isset($book['contents']) && count($book['contents']) > 0)
  80. <div class="wiki-card">
  81. <div class="wiki-sidebar-title" style="margin-bottom: 1rem;">目录</div>
  82. <ul class="wiki-toc-list">
  83. @foreach($book['contents'] as $chapter)
  84. <li>
  85. <a href="{{ route('library.tipitaka.read', $chapter['id']) }}?channel={{ $chapter['channel'] }}">
  86. <div style="display: flex;">
  87. <div>{{ $chapter['title'] }}</div>
  88. <div>
  89. <span style="margin-left: auto; font-size: 0.75rem; color: var(--tblr-secondary);">
  90. {{ $chapter['progress'] }}%
  91. </span>
  92. </div>
  93. </div>
  94. @if(isset($chapter['summary']))
  95. <span style="font-size: 0.75rem; color: var(--tblr-secondary); margin-left: 0.5rem;" class="line2">
  96. {{ $chapter['summary'] }}
  97. </span>
  98. @endif
  99. @if(isset($chapter['progress']) && $chapter['progress'] > 0)
  100. @endif
  101. </a>
  102. </li>
  103. @endforeach
  104. </ul>
  105. </div>
  106. @endif
  107. </main>
  108. {{-- 右侧边栏 --}}
  109. <aside class="wiki-sidebar-right">
  110. {{-- 书籍元信息 --}}
  111. <div class="wiki-sidebar-section">
  112. <div class="wiki-sidebar-title">书籍信息</div>
  113. <table class="wiki-meta-table">
  114. <tr>
  115. <td>语言</td>
  116. <td>{{ $book['language'] ?? '巴利语' }}</td>
  117. </tr>
  118. @if(!empty($book['type']))
  119. <tr>
  120. <td>类型</td>
  121. <td>{{ $book['type'] }}</td>
  122. </tr>
  123. @endif
  124. </table>
  125. </div>
  126. {{-- 其他版本 --}}
  127. @if(!empty($otherVersions) && count($otherVersions) > 0)
  128. <div class="wiki-sidebar-section">
  129. <div class="wiki-sidebar-title">其他版本</div>
  130. <ul class="wiki-related-list">
  131. @foreach($otherVersions as $version)
  132. <li>
  133. <a href="{{ route('library.tipitaka.show', $version['id']) }}">
  134. {{ $version['title'] }}
  135. <span class="wiki-related-zh">{{ $version['language'] ?? '巴利语' }}</span>
  136. </a>
  137. </li>
  138. @endforeach
  139. </ul>
  140. </div>
  141. @endif
  142. </aside>
  143. </div>
  144. </div>
  145. @endsection