]> BookStack Code Mirror - bookstack/commitdiff
Added the book view toggle option on the homepage.
authorAbijeet <redacted>
Sat, 12 May 2018 08:46:05 +0000 (14:16 +0530)
committerAbijeet <redacted>
Sat, 12 May 2018 08:46:05 +0000 (14:16 +0530)
Signed-off-by: Abijeet <redacted>
resources/views/books/index.blade.php
resources/views/home-book.blade.php
resources/views/partials/book-view-toggle.blade.php [new file with mode: 0644]

index f625ae6fbda116ee10c7ae5554ee82393aec492d..d3e0d1297fe9a22f6078b3eedeedd0662298a753 100644 (file)
@@ -3,16 +3,7 @@
 @section('toolbar')
     <div class="col-xs-6">
         <div class="action-buttons text-left">
-            <form action="{{ baseUrl("/settings/users/{$currentUser->id}/switch-book-view") }}" method="POST" class="inline">
-                {!! csrf_field() !!}
-                {!! method_field('PATCH') !!}
-                <input type="hidden" value="{{ $booksViewType === 'list'? 'grid' : 'list' }}" name="book_view_type">
-                @if ($booksViewType === 'list')
-                    <button type="submit" class="text-pos text-button">@icon('grid'){{ trans('common.grid_view') }}</button>
-                @else
-                    <button type="submit" class="text-pos text-button">@icon('list'){{ trans('common.list_view') }}</button>
-                @endif
-            </form>
+            @include('partials/book-view-toggle', ['booksViewType' => $booksViewType])
         </div>
     </div>
     <div class="col-xs-6 faded">
index ef94a78a107e2b12f03616d8332315433bca83ef..e3b52357076dddb12419ce2d750d52eb414f33b3 100644 (file)
@@ -4,6 +4,7 @@
     <div class="col-sm-6 faded">
         <div class="action-buttons text-left">
             <a expand-toggle=".entity-list.compact .entity-item-snippet" class="text-primary text-button">@icon('expand-text'){{ trans('common.toggle_details') }}</a>
+            @include('partials/book-view-toggle', ['booksViewType' => $booksViewType])
         </div>
     </div>
 @stop
diff --git a/resources/views/partials/book-view-toggle.blade.php b/resources/views/partials/book-view-toggle.blade.php
new file mode 100644 (file)
index 0000000..61df7ab
--- /dev/null
@@ -0,0 +1,10 @@
+<form action="{{ baseUrl("/settings/users/{$currentUser->id}/switch-book-view") }}" method="POST" class="inline">
+    {!! csrf_field() !!}
+    {!! method_field('PATCH') !!}
+    <input type="hidden" value="{{ $booksViewType === 'list'? 'grid' : 'list' }}" name="book_view_type">
+    @if ($booksViewType === 'list')
+        <button type="submit" class="text-pos text-button">@icon('grid'){{ trans('common.grid_view') }}</button>
+    @else
+        <button type="submit" class="text-pos text-button">@icon('list'){{ trans('common.list_view') }}</button>
+    @endif
+</form>
\ No newline at end of file
Morty Proxy This is a proxified and sanitized view of the page, visit original site.