Skip to content

Commit 3c34a61

Browse files
committed
some view fixes - and redirect to login if not logged in for setup
1 parent a657bb7 commit 3c34a61

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/Middleware/UserCanManageBlogPosts.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public function handle($request, Closure $next)
2121
{
2222
if (!\Auth::check()) {
2323
abort(401,"User not authorised to manage blog posts: You are not logged in");
24+
return redirect('/login');
2425
}
2526
if (!\Auth::user()->canManageHessamCMSPosts()) {
2627
abort(401,"User not authorised to manage blog posts: Your account is not authorised to edit blog posts");
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
@foreach($category_tree as $category)
2-
<li class="category-item-wrapper">
2+
@php $trans = $category->categoryTranslations->where('lang_id',$lang_id)->first();@endphp
3+
@if($trans != null)
4+
<li class="category-item-wrapper">
35
<span class="category-item" value='{{$category->category_id}}'>
4-
{{$category->categoryTranslations->where('lang_id',$lang_id)->first()->category_name}}
6+
{{$trans->category_name}}
57

68
@if( count($category->siblings) > 0)
79
<ul>
810
@include("hessamcms::partials._category_partial", ['category_tree' => $category->siblings])
911
</ul>
1012
@endif
1113
</span>
12-
</li>
14+
</li>
15+
@endif
1316
@endforeach

src/Views/hessamcms/partials/index_loop.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
@endif
2020

2121
<div class="post-details-bottom">
22-
<span class="light-text">Authored by: </span> {{$post->post->author->name}} <span class="light-text">Posted at: </span> {{date('d M Y ', strtotime($post->posted_at))}}
22+
<span class="light-text">Authored by: </span> {{$post->post->author->name}} <span class="light-text">Posted at: </span> {{date('d M Y ', strtotime($post->post->posted_at))}}
2323
</div>
2424
<div class='text-center'>
2525
<a href="{{$post->url($locale)}}" class="btn btn-primary">View Post</a>

0 commit comments

Comments
 (0)