]> BookStack Code Mirror - bookstack/commitdiff
Improved 404 page and updated tests for empty search
authorDan Brown <redacted>
Fri, 1 Jan 2016 09:03:40 +0000 (09:03 +0000)
committerDan Brown <redacted>
Fri, 1 Jan 2016 09:03:40 +0000 (09:03 +0000)
app/Services/ActivityService.php
resources/views/base.blade.php
resources/views/errors/404.blade.php
tests/EntityTest.php

index 4da928fad9fd1e89a3fa8c67ebbddb0885067247..2ef5f9cfeb700bc287005769b48d722fb4557fa2 100644 (file)
@@ -107,7 +107,7 @@ class ActivityService
     }
 
     /**
-     * Filters out similar acitivity.
+     * Filters out similar activity.
      * @param Activity[] $activity
      * @return array
      */
index 25559bd40300045774d4dbdd02f44c8d31506f1d..a2979f858a188e62d9a0afda25e77f0028db7902 100644 (file)
                     <div class="float right">
                         <div class="links text-center">
                             <a href="/books"><i class="zmdi zmdi-book"></i>Books</a>
-                            @if($currentUser->can('settings-update'))
+                            @if(isset($currentUser) && $currentUser->can('settings-update'))
                                 <a href="/settings"><i class="zmdi zmdi-settings"></i>Settings</a>
                             @endif
-                            @if(!$signedIn)
+                            @if(!isset($signedIn) || !$signedIn)
                                 <a href="/login"><i class="zmdi zmdi-sign-in"></i>Sign In</a>
                             @endif
                         </div>
-                        @if($signedIn)
+                        @if(isset($signedIn) && $signedIn)
                             <div class="dropdown-container" dropdown>
                                 <span class="user-name" dropdown-toggle>
                                     <img class="avatar" src="{{$currentUser->getAvatar(30)}}" alt="{{ $currentUser->name }}">
index 0062bb25895ca9f276c3fd9ba89e4657d9a2917b..191cf758faeabe7f18d83a728d2e389304006614 100644 (file)
@@ -4,8 +4,9 @@
 
 
 <div class="container">
-    <h1>Page Not Found</h1>
-    <p>The page you were looking for could not be found.</p>
+    <h1 class="text-muted">Page Not Found</h1>
+    <p>Sorry, The page you were looking for could not be found.</p>
+    <a href="/" class="button">Return To Home</a>
 </div>
 
 @stop
\ No newline at end of file
index b883e854399cc3d155d2d2e4c41f7acb68a821ef..4c4195fd9fd0ecfcee09876a586af57fc7b8f18d 100644 (file)
@@ -180,6 +180,14 @@ class EntityTest extends TestCase
             ->seeStatusCode(200);
     }
 
+    public function testEmptySearchRedirectsBack()
+    {
+        $this->asAdmin()
+            ->visit('/')
+            ->visit('/search/all')
+            ->seePageIs('/');
+    }
+
 
     public function testEntitiesViewableAfterCreatorDeletion()
     {