2
0

home.blade.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. {{-- resources/views/wiki/home.blade.php
  2. Wiki 门户首页。
  3. 布局:单栏居中,法轮图标 + 标题 + 搜索框 + 热门标签 + 语言选择。
  4. 所有样式来自 modules/wiki.css,无内联 <style>。
  5. --}}
  6. @extends('library.wiki.layouts.app')
  7. @section('title', 'WikiPāli · ' . __('library.wiki_encyclopedia'))
  8. @section('wiki-content')
  9. <div class="wiki-home-container">
  10. {{-- 法轮图标 --}}
  11. <div class="wiki-home-wheel">
  12. <img src="{{ asset('assets/images/dhamma-wheel.svg') }}"
  13. alt="Dharma Wheel"
  14. class="wiki-home-wheel-img">
  15. </div>
  16. {{-- 欢迎标题 --}}
  17. <div class="wiki-home-title">
  18. <h1>{{ __('library.wiki_encyclopedia') }}</h1>
  19. <p class="text-muted">{{ __('library.wiki_subtitle') }}</p>
  20. </div>
  21. {{-- 搜索框 --}}
  22. <div class="wiki-home-search">
  23. <x-ui.search-input
  24. :value="request('q')"
  25. :placeholder="__('library.wiki_search_placeholder')"
  26. size="lg"
  27. :hidden-fields="['resource_type' => 'term']" />
  28. </div>
  29. {{-- 热门搜索标签 --}}
  30. @isset($hotTags)
  31. <div class="wiki-home-hot-tags">
  32. <span class="text-muted me-2">{{ __('library.hot') }}</span>
  33. @foreach($hotTags as $tag)
  34. <a href="{{ route('library.search', ['q' => $tag, 'type' => 'wiki']) }}"
  35. class="wiki-hot-tag">
  36. {{ $tag }}
  37. </a>
  38. @endforeach
  39. </div>
  40. @endisset
  41. {{-- 语言选择器 --}}
  42. <div class="wiki-home-languages">
  43. <div class="wiki-home-divider">
  44. <span>{{ __('library.wiki_language_divider') }}</span>
  45. </div>
  46. <div class="wiki-language-tags">
  47. @foreach($languages as $lang)
  48. <a href="{{ route('library.wiki.index', ['lang' => $lang['code']]) }}"
  49. class="wiki-language-tag {{ ($currentLang ?? 'zh-Hans') === $lang['code'] ? 'active' : '' }}">
  50. {{ $lang['name'] }}
  51. </a>
  52. @endforeach
  53. </div>
  54. </div>
  55. {{-- 统计信息 --}}
  56. @isset($stats)
  57. <div class="wiki-home-stats">
  58. <span class="text-muted">
  59. 📚 {{ number_format($stats['total_articles'] ?? 0) }} {{ __('library.articles') }}
  60. @if(isset($stats['today_updates']))
  61. · 🆕 {{ __('library.today_updates') }} {{ $stats['today_updates'] }}
  62. @endif
  63. @if(isset($stats['contributors']))
  64. · 👥 {{ number_format($stats['contributors']) }} {{ __('library.contributors_suffix') }}
  65. @endif
  66. </span>
  67. </div>
  68. @endisset
  69. </div>
  70. @endsection