Browse Source

_toc.blade.php => toc.blade.php

visuddhinanda 3 days ago
parent
commit
424259884c

+ 0 - 28
api-v13/resources/views/library/book/_toc.blade.php

@@ -1,28 +0,0 @@
-{{-- resources/views/library/book/_toc.blade.php
-     TOC 列表局部视图,在 offcanvas 和侧边栏中复用。
-     变量:$toc array,$anthologyId(可选)
---}}
-@if(!empty($toc))
-<ul>
-    @foreach ($toc as $item)
-    <li class="toc_item toc-level-{{ $item['level'] }}
-               {{ ($item['active'] ?? false) ? 'toc-active' : ($item['disabled'] ? 'toc-disabled' : '') }}">
-        @if($item['active'] ?? false)
-            <span title="{{ $item['title'] }}">{{ $item['title'] }}</span>
-        @elseif(!$item['disabled'])
-            @if(isset($anthologyId))
-                <a href="{{ route('library.anthology.read', ['anthology' => $anthologyId, 'article' => $item['id'], 'channel' => request('channel')]) }}"
-                   title="{{ $item['title'] }}">{{ $item['title'] }}</a>
-            @else
-                <a href="{{ route('library.tipitaka.read', ['id' => $item['id'], 'channel' => request('channel')]) }}"
-                   title="{{ $item['title'] }}">{{ $item['title'] }}</a>
-            @endif
-        @else
-            <span title="{{ $item['title'] }}">{{ $item['title'] }}</span>
-        @endif
-    </li>
-    @endforeach
-</ul>
-@else
-<div class="alert alert-warning">此书没有目录</div>
-@endif

+ 28 - 0
api-v13/resources/views/library/book/toc.blade.php

@@ -0,0 +1,28 @@
+{{-- resources/views/library/book/toc.blade.php
+     TOC 列表局部视图,在 offcanvas 和侧边栏中复用。
+     变量:$toc array,$anthologyId(可选)
+--}}
+@if(!empty($toc))
+<ul>
+    @foreach ($toc as $item)
+    <li class="toc_item toc-level-{{ $item['level'] }}
+               {{ ($item['active'] ?? false) ? 'toc-active' : ($item['disabled'] ? 'toc-disabled' : '') }}">
+        @if($item['active'] ?? false)
+        <span title="{{ $item['title'] }}">{{ $item['title'] }}</span>
+        @elseif(!$item['disabled'])
+        @if(isset($anthologyId))
+        <a href="{{ route('library.anthology.read', ['anthology' => $anthologyId, 'article' => $item['id'], 'channel' => request('channel')]) }}"
+            title="{{ $item['title'] }}">{{ $item['title'] }}</a>
+        @else
+        <a href="{{ route('library.tipitaka.read', ['id' => $item['id'], 'channel' => request('channel')]) }}"
+            title="{{ $item['title'] }}">{{ $item['title'] }}</a>
+        @endif
+        @else
+        <span title="{{ $item['title'] }}">{{ $item['title'] }}</span>
+        @endif
+    </li>
+    @endforeach
+</ul>
+@else
+<div class="alert alert-warning">此书没有目录</div>
+@endif