show.blade.php 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. {{-- resources/views/library/tipitaka/show.blade.php
  2. 作品详情:某 channel 的某部作品。
  3. 变量:$book(TipitakaCatalogService::bookCard() + channel / pali_title / contents / categories / read_url)、
  4. $otherVersions(同作品的其他公开 channel)、$relatedWorks(同分类、本 channel 收录的其他作品)
  5. --}}
  6. @extends('layouts.library')
  7. @section('title', $book['title'] . ' · ' . __('library.site_name'))
  8. @push('styles')
  9. @vite('resources/css/modules/tipitaka.css')
  10. @endpush
  11. @section('breadcrumb')
  12. <li class="breadcrumb-item">
  13. <a href="{{ route('library.home') }}">{{ __('library.home') }}</a>
  14. </li>
  15. <li class="breadcrumb-item">
  16. <a href="{{ route('library.tipitaka.index') }}">{{ __('library.tipitaka') }}</a>
  17. </li>
  18. <li class="breadcrumb-item">
  19. <a href="{{ route('library.tipitaka.channels.index') }}">{{ __('library.channels') }}</a>
  20. </li>
  21. <li class="breadcrumb-item">
  22. <a href="{{ route('library.tipitaka.channels.show', ['channel' => $book['channel']['uid']]) }}">{{ $book['channel']['name'] }}</a>
  23. </li>
  24. <li class="breadcrumb-item active">{{ $book['title'] }}</li>
  25. @endsection
  26. @section('content')
  27. <div class="page-body">
  28. <div class="container-xl wiki-layout">
  29. {{-- 左侧边栏:封面 + 操作按钮 --}}
  30. <aside class="wiki-sidebar-left">
  31. <div class="wiki-sidebar-section" style="padding: 1rem;">
  32. <x-ui.book-cover
  33. :image="$book['cover']"
  34. :gradient="$book['cover_gradient']"
  35. :title="$book['pali_title']"
  36. :subtitle="$book['subTitle'] ?? ''"
  37. size="md"
  38. :style3d="false"
  39. style="width: 100%; min-width: unset; height: 220px;" />
  40. <div style="margin-top: 1rem;">
  41. <a href="{{ $book['read_url'] }}" class="btn btn-primary w-100 mb-2">
  42. <i class="ti ti-book-2 me-1"></i>
  43. {{ __('library.read_online') }}
  44. </a>
  45. <a href="{{ route('library.tipitaka.channels.work.download', ['channel' => $book['channel']['uid'], 'sn' => $book['id']]) }}" class="btn btn-outline-secondary w-100">
  46. <i class="ti ti-download me-1"></i>
  47. {{ __('library.download') }}
  48. </a>
  49. </div>
  50. </div>
  51. </aside>
  52. {{-- 主内容区 --}}
  53. <main class="wiki-main">
  54. <div class="wiki-card">
  55. <div class="wiki-entry-header">
  56. <div class="wiki-entry-title">{{ $book['title'] }}</div>
  57. @if($book['pali_title'] !== $book['title'])
  58. <div class="tipitaka-work-pali">{{ $book['pali_title'] }}</div>
  59. @endif
  60. </div>
  61. <table class="wiki-meta-table" style="margin-bottom: 1.25rem;">
  62. <tr>
  63. <td>{{ __('library.channel') }}</td>
  64. <td>
  65. <a href="{{ route('library.tipitaka.channels.show', ['channel' => $book['channel']['uid']]) }}">{{ $book['channel']['name'] }}</a>
  66. <span class="card-book__badge">{{ $book['type'] }}</span>
  67. </td>
  68. </tr>
  69. @if(!empty($book['publisher']))
  70. <tr>
  71. <td>{{ __('library.publisher') }}</td>
  72. <td>
  73. <a href="{{ route('blog.index', ['user' => $book['publisher']->username]) }}">
  74. {{ $book['publisher']->nickname }}
  75. </a>
  76. </td>
  77. </tr>
  78. @endif
  79. <tr>
  80. <td>{{ __('library.language') }}</td>
  81. <td>{{ $book['language'] }}</td>
  82. </tr>
  83. @if(!empty($book['categories']))
  84. <tr>
  85. <td>{{ __('library.category') }}</td>
  86. <td>
  87. @foreach($book['categories'] as $category)
  88. <a href="{{ $category['url'] }}">{{ $category['name'] }}</a>@if(!$loop->last) › @endif
  89. @endforeach
  90. </td>
  91. </tr>
  92. @endif
  93. <tr>
  94. <td>{{ __('library.progress') }}</td>
  95. <td><x-ui.progress-bar :value="$book['progress']" style="max-width: 240px" /></td>
  96. </tr>
  97. @if(!empty($book['updated_at']))
  98. <tr>
  99. <td>{{ __('library.updated') }}</td>
  100. <td>{{ $book['updated_at'] }}</td>
  101. </tr>
  102. @endif
  103. </table>
  104. @if(!empty($book['description']))
  105. <div class="wiki-content-body">
  106. <p>{{ $book['description'] }}</p>
  107. </div>
  108. @endif
  109. </div>
  110. {{-- 目录:无译文的章节置灰不可点 --}}
  111. @if(!empty($book['contents']))
  112. <div class="wiki-card">
  113. <div class="wiki-sidebar-title" style="margin-bottom: 1rem;">{{ __('library.toc') }}</div>
  114. <ul class="wiki-toc-list">
  115. @foreach($book['contents'] as $chapter)
  116. <li class="{{ $chapter['disabled'] ? 'toc-disabled' : '' }}">
  117. @if($chapter['disabled'])
  118. <div class="toc-item">
  119. <div class="toc-title">{{ $chapter['title'] }}</div>
  120. </div>
  121. @else
  122. <a href="{{ route('library.tipitaka.channels.chapter', ['channel' => $chapter['channel'], 'chapter' => $chapter['id']]) }}">
  123. <div class="toc-item">
  124. <div class="toc-title">{{ $chapter['title'] }}</div>
  125. <x-ui.progress-bar :value="$chapter['progress']" class="toc-progress" />
  126. </div>
  127. @if(!empty($chapter['summary']))
  128. <span class="line2 tipitaka-toc-summary">{{ $chapter['summary'] }}</span>
  129. @endif
  130. </a>
  131. @endif
  132. </li>
  133. @endforeach
  134. </ul>
  135. </div>
  136. @endif
  137. </main>
  138. {{-- 右侧边栏 --}}
  139. <aside class="wiki-sidebar-right">
  140. @if(!empty($otherVersions))
  141. <div class="wiki-sidebar-section">
  142. <div class="wiki-sidebar-title">{{ __('library.other_versions') }}</div>
  143. <ul class="wiki-related-list">
  144. @foreach($otherVersions as $version)
  145. <li>
  146. <a href="{{ $version['url'] }}">
  147. {{ $version['name'] }}
  148. <span class="wiki-related-zh">{{ __('language.'.$version['lang']) }}</span>
  149. </a>
  150. </li>
  151. @endforeach
  152. </ul>
  153. </div>
  154. @endif
  155. @if(!empty($relatedWorks))
  156. <div class="wiki-sidebar-section">
  157. <div class="wiki-sidebar-title">{{ __('library.related_works') }}</div>
  158. <ul class="wiki-related-list">
  159. @foreach($relatedWorks as $related)
  160. <li><a href="{{ $related['url'] }}">{{ $related['title'] }}</a></li>
  161. @endforeach
  162. </ul>
  163. </div>
  164. @endif
  165. </aside>
  166. </div>
  167. </div>
  168. @endsection