show.blade.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. {{-- resources/views/wiki/show.blade.php --}}
  2. @extends('library.wiki.layouts.app')
  3. @section('title', $entry['meaning'] . '(' . $entry['word'] . ')· WikiPāli')
  4. @section('wiki-content')
  5. {{-- 搜索框组件 --}}
  6. <div class="wiki-search-wrapper">
  7. <x-ui.search-input
  8. :action="route('library.search')"
  9. :value="request('q')"
  10. placeholder="搜索佛法词条、经典、人物..."
  11. size="lg"
  12. :hidden-fields="['resource_type' => 'term']" />
  13. </div>
  14. <article class="wiki-card" style="position: relative;">
  15. <x-wiki.entry-actions
  16. :editUrl="$entry['edit_url']"
  17. :title="$entry['zh']" />
  18. {{-- 条目头部 --}}
  19. <x-wiki.entry-header :entry="$entry" />
  20. {{-- 语言版本切换 --}}
  21. <x-wiki.entry-langs :langs="$entry['langs']" :current="$entry['lang']" />
  22. {{-- 正文 --}}
  23. <div class="wiki-content-body">
  24. {!! $entry['content'] !!}
  25. </div>
  26. {{-- 标签 --}}
  27. <div class="wiki-tags">
  28. @foreach ($entry['tags'] as $tag)
  29. <a class="wiki-tag" href="{{ route('library.wiki.index',[$lang]) }}?tag={{ $tag }}">
  30. {{ $tag }}
  31. </a>
  32. @endforeach
  33. </div>
  34. {{-- 其他版本 --}}
  35. @if(isset($entry['other_versions']) && count($entry['other_versions']) > 0)
  36. <div class="wiki-other-versions">
  37. <div class="wiki-sidebar-title" style="margin-bottom: 0.75rem;">其他版本</div>
  38. @foreach ($entry['other_versions'] as $version)
  39. <x-wiki.search-result-card :result="$version" :lang="$lang" />
  40. @endforeach
  41. </div>
  42. @endif
  43. </article>
  44. @endsection
  45. @section('wiki-sidebar')
  46. {{-- 目录 --}}
  47. <div class="wiki-sidebar-section">
  48. <div class="wiki-sidebar-title">目录</div>
  49. <ul class="wiki-toc-list">
  50. @foreach ($entry['toc'] as $i => $item)
  51. <li class="toc-level-{{ $item['level'] }}">
  52. <a href="#{{ $item['id'] }}">
  53. {{ $item['text'] }}
  54. </a>
  55. </li>
  56. @endforeach
  57. </ul>
  58. </div>
  59. {{-- 相关条目 --}}
  60. <x-wiki.related-entries :entries="$entry['related']" />
  61. {{-- 条目元信息 --}}
  62. <div class="wiki-sidebar-section">
  63. <div class="wiki-sidebar-title">条目信息</div>
  64. <table class="wiki-meta-table">
  65. <tr>
  66. <td>分类</td>
  67. <td>{{ $entry['category'] }}</td>
  68. </tr>
  69. <tr>
  70. <td>质量</td>
  71. <td><x-wiki.quality-badge :quality="$entry['quality']" /></td>
  72. </tr>
  73. </table>
  74. </div>
  75. @endsection
  76. @push('scripts')
  77. @vite('resources/js/modules/term-tooltip.js')
  78. @endpush