show.blade.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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') }}?tag={{ $tag }}">
  30. {{ $tag }}
  31. </a>
  32. @endforeach
  33. </div>
  34. </article>
  35. @endsection
  36. @section('wiki-sidebar')
  37. {{-- 目录 --}}
  38. <div class="wiki-sidebar-section">
  39. <div class="wiki-sidebar-title">目录</div>
  40. <ul class="wiki-toc-list">
  41. @foreach ($entry['toc'] as $i => $item)
  42. <li class="toc-level-{{ $item['level'] }}">
  43. <a href="#{{ $item['id'] }}">
  44. <span class="wiki-toc-num">{{ $i + 1 }}</span>
  45. {{ $item['text'] }}
  46. </a>
  47. </li>
  48. @endforeach
  49. </ul>
  50. </div>
  51. {{-- 相关条目 --}}
  52. <x-wiki.related-entries :entries="$entry['related']" />
  53. {{-- 条目元信息 --}}
  54. <div class="wiki-sidebar-section">
  55. <div class="wiki-sidebar-title">条目信息</div>
  56. <table class="wiki-meta-table">
  57. <tr>
  58. <td>分类</td>
  59. <td>{{ $entry['category'] }}</td>
  60. </tr>
  61. <tr>
  62. <td>质量</td>
  63. <td><x-wiki.quality-badge :quality="$entry['quality']" /></td>
  64. </tr>
  65. </table>
  66. </div>
  67. @endsection
  68. @push('scripts')
  69. @vite('resources/js/modules/term-tooltip.js')
  70. @endpush