]> BookStack Code Mirror - bookstack/commitdiff
Tightened and cleaned some list styles
authorDan Brown <redacted>
Sun, 3 Jul 2016 08:58:45 +0000 (09:58 +0100)
committerDan Brown <redacted>
Sun, 3 Jul 2016 08:58:45 +0000 (09:58 +0100)
app/Http/Controllers/SearchController.php
resources/assets/js/global.js
resources/assets/sass/_lists.scss
resources/assets/sass/_pages.scss
resources/assets/sass/_text.scss
resources/assets/sass/styles.scss
resources/views/chapters/list-item.blade.php
resources/views/chapters/move.blade.php
resources/views/search/entity-ajax-list.blade.php [new file with mode: 0644]

index 7c7d7b2545dfaafe64c585eff684dad8f25482fc..58ad737c4b431afa7cc5f982d4ec5fc9ffc6211c 100644 (file)
@@ -163,7 +163,7 @@ class SearchController extends Controller
             $entities = $this->viewService->getPopular(20, 0, $entityNames);
         }
 
-        return view('partials/entity-list', ['entities' => $entities]);
+        return view('search/entity-ajax-list', ['entities' => $entities]);
     }
 
 }
index d4fe7020bcac72e697a1bb7970225afbf08e3cbf..57d62728b88c837a21cfeb470be92094cac3c83a 100644 (file)
@@ -118,10 +118,5 @@ $(function () {
 
 });
 
-
-function elemExists(selector) {
-    return document.querySelector(selector) !== null;
-}
-
 // Page specific items
 require('./pages/page-show');
index 388d5753da1fd0e186117228ca417a7c7faf5527..e97cc647aa53090b6dc59228452ad995d90bea30 100644 (file)
@@ -1,6 +1,7 @@
 .page-list {
   h3 {
-    margin: $-l 0 $-m 0;
+    margin: $-l 0 $-xs 0;
+    font-size: 1.666em;
   }
   a.chapter {
     color: $color-chapter;
@@ -8,7 +9,6 @@
   .inset-list {
     display: none;
     overflow: hidden;
-    // padding-left: $-m;
     margin-bottom: $-l;
   }
   h4 {
index e61e0c8232ad3664a90ddcd77086b2cfe41fcc0e..49b701dda9468e1b9a67c3322d1eda09fc60f365 100644 (file)
@@ -48,7 +48,7 @@
     max-width: 100%;
     height:auto;
   }
-  h1, h2, h3, h4, h5, h6 {
+  h1, h2, h3, h4, h5, h6, pre {
     clear: left;
   }
   hr {
index 493933135d911290f271cf0ba9e07916e2c9cbb1..cd81bb4e21326d24e2589751438b0a8e510e217b 100644 (file)
@@ -225,6 +225,15 @@ p.secondary, p .secondary, span.secondary, .text-secondary {
     color: $color-chapter;
   }
 }
+.faded .text-book:hover {
+  color: $color-book !important;
+}
+.faded .text-chapter:hover {
+  color: $color-chapter !important;
+}
+.faded .text-page:hover {
+  color: $color-page !important;
+}
 
 span.highlight {
   //background-color: rgba($primary, 0.2);
index 770d5eeb45fc4eb07f02c6057968249674434db5..a6c364018584b050d11d91b702d88dbed123f054 100644 (file)
@@ -246,7 +246,7 @@ $btt-size: 40px;
 }
 
 .entity-list-item.selected {
-  h3, i, p ,a {
+  h3, i, p ,a, span {
     color: #EEE;
   }
 }
index f66c3781f9aaa7a350d6e702bc80bf890c7e18c8..1567557d2cef48f6bdf8d77ce3047ba3f993d415 100644 (file)
@@ -1,5 +1,11 @@
 <div class="chapter entity-list-item" data-entity-type="chapter" data-entity-id="{{$chapter->id}}">
     <h3>
+        @if (isset($showPath) && $showPath)
+            <a href="{{ $chapter->book->getUrl() }}" class="text-book">
+                <i class="zmdi zmdi-book"></i>{{ $chapter->book->name }}
+            </a>
+            <span class="text-muted">&nbsp;&nbsp;&raquo;&nbsp;&nbsp;</span>
+        @endif
         <a href="{{ $chapter->getUrl() }}" class="text-chapter">
             <i class="zmdi zmdi-collection-bookmark"></i>{{ $chapter->name }}
         </a>
index 024fc6684bf681afcaf1e80a8ac23807d399c1c9..c14dd692324549e6eac2650b34b35daf69fc1272 100644 (file)
@@ -9,7 +9,7 @@
                     <div class="breadcrumbs">
                         <a href="{{$book->getUrl()}}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $book->getShortName() }}</a>
                         <span class="sep">&raquo;</span>
-                        <a href="{{$chapter->getUrl()}}" class="text-page text-button"><i class="zmdi zmdi-file-text"></i>{{ $chapter->getShortName() }}</a>
+                        <a href="{{$chapter->getUrl()}}" class="text-chapter text-button"><i class="zmdi zmdi-collection-bookmark"></i>{{ $chapter->getShortName() }}</a>
                     </div>
                 </div>
             </div>
diff --git a/resources/views/search/entity-ajax-list.blade.php b/resources/views/search/entity-ajax-list.blade.php
new file mode 100644 (file)
index 0000000..97d5e4d
--- /dev/null
@@ -0,0 +1,22 @@
+<div class="entity-list @if(isset($style)){{ $style }}@endif" ng-non-bindable>
+    @if(count($entities) > 0)
+        @foreach($entities as $index => $entity)
+            @if($entity->isA('page'))
+                @include('pages/list-item', ['page' => $entity])
+            @elseif($entity->isA('book'))
+                @include('books/list-item', ['book' => $entity])
+            @elseif($entity->isA('chapter'))
+                @include('chapters/list-item', ['chapter' => $entity, 'hidePages' => true, 'showPath' => true])
+            @endif
+
+            @if($index !== count($entities) - 1)
+                <hr>
+            @endif
+
+        @endforeach
+    @else
+        <p class="text-muted">
+            No items available
+        </p>
+    @endif
+</div>
\ No newline at end of file
Morty Proxy This is a proxified and sanitized view of the page, visit original site.