Skip to content

Commit f60a0c3

Browse files
committed
Improved 404 page and updated tests for empty search
1 parent 9a470b0 commit f60a0c3

4 files changed

Lines changed: 15 additions & 6 deletions

File tree

app/Services/ActivityService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function entityActivity($entity, $count = 20, $page = 0)
107107
}
108108

109109
/**
110-
* Filters out similar acitivity.
110+
* Filters out similar activity.
111111
* @param Activity[] $activity
112112
* @return array
113113
*/

resources/views/base.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@
4343
<div class="float right">
4444
<div class="links text-center">
4545
<a href="/books"><i class="zmdi zmdi-book"></i>Books</a>
46-
@if($currentUser->can('settings-update'))
46+
@if(isset($currentUser) && $currentUser->can('settings-update'))
4747
<a href="/settings"><i class="zmdi zmdi-settings"></i>Settings</a>
4848
@endif
49-
@if(!$signedIn)
49+
@if(!isset($signedIn) || !$signedIn)
5050
<a href="/login"><i class="zmdi zmdi-sign-in"></i>Sign In</a>
5151
@endif
5252
</div>
53-
@if($signedIn)
53+
@if(isset($signedIn) && $signedIn)
5454
<div class="dropdown-container" dropdown>
5555
<span class="user-name" dropdown-toggle>
5656
<img class="avatar" src="{{$currentUser->getAvatar(30)}}" alt="{{ $currentUser->name }}">

resources/views/errors/404.blade.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55

66
<div class="container">
7-
<h1>Page Not Found</h1>
8-
<p>The page you were looking for could not be found.</p>
7+
<h1 class="text-muted">Page Not Found</h1>
8+
<p>Sorry, The page you were looking for could not be found.</p>
9+
<a href="/" class="button">Return To Home</a>
910
</div>
1011

1112
@stop

tests/EntityTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,14 @@ public function testInvalidPageSearch()
180180
->seeStatusCode(200);
181181
}
182182

183+
public function testEmptySearchRedirectsBack()
184+
{
185+
$this->asAdmin()
186+
->visit('/')
187+
->visit('/search/all')
188+
->seePageIs('/');
189+
}
190+
183191

184192
public function testEntitiesViewableAfterCreatorDeletion()
185193
{

0 commit comments

Comments
 (0)