show.blade.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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. {{-- 操作按钮 --}}
  32. <div style="margin-top: 1rem;">
  33. <a href="{{ route('library.tipitaka.read', $book['id']) }}"
  34. class="btn btn-primary w-100 mb-2">
  35. <i class="ti ti-book-2 me-1"></i>
  36. 在线阅读
  37. </a>
  38. <button class="btn btn-outline-secondary w-100">
  39. <i class="ti ti-download me-1"></i>
  40. 下载
  41. </button>
  42. </div>
  43. </div>
  44. </aside>
  45. {{-- 主内容区 --}}
  46. <main class="wiki-main">
  47. {{-- 书籍信息 --}}
  48. <div class="wiki-card">
  49. <div class="wiki-entry-header">
  50. <div class="wiki-entry-title">{{ $book['title'] }}</div>
  51. </div>
  52. <table class="wiki-meta-table" style="margin-bottom: 1.25rem;">
  53. <tr>
  54. <td>作者</td>
  55. <td>{{ $book['author'] }}</td>
  56. </tr>
  57. @if(isset($book['publisher']))
  58. <tr>
  59. <td>出版</td>
  60. <td>
  61. <a href="{{ route('blog.index', ['user' => $book['publisher']->username]) }}"
  62. style="color: var(--tblr-primary); text-decoration: none;">
  63. {{ $book['publisher']->nickname }}
  64. </a>
  65. </td>
  66. </tr>
  67. @endif
  68. <tr>
  69. <td>语言</td>
  70. <td>{{ $book['language'] ?? '巴利语' }}</td>
  71. </tr>
  72. </table>
  73. @if(!empty($book['description']))
  74. <div class="wiki-content-body">
  75. <p>{{ $book['description'] }}</p>
  76. </div>
  77. @endif
  78. </div>
  79. {{-- 目录 --}}
  80. @if(isset($book['contents']) && count($book['contents']) > 0)
  81. <div class="wiki-card">
  82. <div class="wiki-sidebar-title" style="margin-bottom: 1rem;">目录</div>
  83. <ul class="wiki-toc-list">
  84. @foreach($book['contents'] as $chapter)
  85. <li>
  86. <a href="{{ route('library.tipitaka.read', $chapter['id']) }}?channel={{ $chapter['channel'] }}">
  87. <span class="wiki-toc-num">{{ $loop->index + 1 }}</span>
  88. {{ $chapter['title'] }}
  89. @if(isset($chapter['summary']))
  90. <span style="font-size: 0.75rem; color: var(--tblr-secondary); margin-left: 0.5rem;" class="line2">
  91. {{ $chapter['summary'] }}
  92. </span>
  93. @endif
  94. @if(isset($chapter['progress']) && $chapter['progress'] > 0)
  95. <span style="margin-left: auto; font-size: 0.75rem; color: var(--tblr-secondary);">
  96. {{ $chapter['progress'] }}%
  97. </span>
  98. @endif
  99. </a>
  100. </li>
  101. @endforeach
  102. </ul>
  103. </div>
  104. @endif
  105. </main>
  106. {{-- 右侧边栏 --}}
  107. <aside class="wiki-sidebar-right">
  108. {{-- 书籍元信息 --}}
  109. <div class="wiki-sidebar-section">
  110. <div class="wiki-sidebar-title">书籍信息</div>
  111. <table class="wiki-meta-table">
  112. <tr>
  113. <td>语言</td>
  114. <td>{{ $book['language'] ?? '巴利语' }}</td>
  115. </tr>
  116. @if(!empty($book['type']))
  117. <tr>
  118. <td>类型</td>
  119. <td>{{ $book['type'] }}</td>
  120. </tr>
  121. @endif
  122. </table>
  123. </div>
  124. {{-- 其他版本 --}}
  125. @if(!empty($otherVersions) && count($otherVersions) > 0)
  126. <div class="wiki-sidebar-section">
  127. <div class="wiki-sidebar-title">其他版本</div>
  128. <ul class="wiki-related-list">
  129. @foreach($otherVersions as $version)
  130. <li>
  131. <a href="{{ route('library.tipitaka.show', $version['id']) }}">
  132. {{ $version['title'] }}
  133. <span class="wiki-related-zh">{{ $version['language'] ?? '巴利语' }}</span>
  134. </a>
  135. </li>
  136. @endforeach
  137. </ul>
  138. </div>
  139. @endif
  140. </aside>
  141. </div>
  142. </div>
  143. @endsection