|
1 | | -<main class="py-4" style="min-height: 88vh"> |
2 | | - <div class="container"> |
3 | | - <section class="news-section news mb-2 row"> |
4 | | - <h2 class="news__header order-2 order-sm-0 col-12">News</h2> |
| 1 | +<section class="news-section mb-2 flex-column flex-sm-row col-12 col-sm-8 col-lg-10 order-2 order-sm-0"> |
| 2 | + <h2 class="news-section__header col-12 text-center">News</h2> |
5 | 3 |
|
6 | | - <div class="news-section__news new col-sm-8 col-lg-10 order-2 order-sm-0"> |
7 | | - @forelse($news as $new) |
8 | | - <div class="new__item d-flex"> |
9 | | - <div class="new__heading d-flex flex-column p-3 w-100 border rounded mb-4 shadow-sm"> |
10 | | - <strong class="mb-2 text-primary">new #{{ $new->id }}</strong> |
| 4 | + <div class="news-section__news new"> |
| 5 | + @forelse($news as $new) |
| 6 | + <div class="new__item d-flex"> |
| 7 | + <div class="new__heading d-flex flex-column p-3 w-100 border rounded mb-4 shadow-sm"> |
| 8 | + <strong class="mb-2 text-primary">new #{{ $new->id }}</strong> |
11 | 9 |
|
12 | | - <h3 class="new__name mb-0">{{ $new->name }}</h3> |
| 10 | + <h3 class="new__name mb-0">{{ $new->name }}</h3> |
13 | 11 |
|
14 | | - <div class="new__created-at mb-1 text-muted">{{ $new->created_at->toFormattedDateString() }}</div> |
| 12 | + <div class="new__created-at mb-1 text-muted">{{ $new->created_at->toFormattedDateString() }}</div> |
15 | 13 |
|
16 | | - <p class="new__preview card-text flex-grow-1 text-justify"> {{ str_limit($new->text, $limit = 200, $end = '...') }} </p> |
| 14 | + <p class="new__preview card-text flex-grow-1 text-justify"> {{ str_limit($new->text, $limit = 200, $end = '...') }} </p> |
17 | 15 |
|
18 | | - @if($new->tags->isNotEmpty()) |
19 | | - <div class="post__tags mb-2"> |
20 | | - @foreach($new->tags as $tag) |
21 | | - <span class="badge badge-info text-white">{{ $tag->name }}</span> |
22 | | - @endforeach |
23 | | - </div> |
24 | | - @endif |
| 16 | + @if($new->tags->isNotEmpty()) |
| 17 | + <div class="post__tags mb-2"> |
| 18 | + @foreach($new->tags as $tag) |
| 19 | + <a href="{{ route('tags.show', $tag) }}" class="badge badge-info text-white">{{ $tag->name }}</a> |
| 20 | + @endforeach |
| 21 | + </div> |
| 22 | + @endif |
25 | 23 |
|
26 | | - <div class="d-flex justify-content-end"> |
27 | | - <a href="{{ route('news.show', $new) }}" class="btn btn-outline-secondary" style="width: 80px; font-size: 0.7rem">Read</a> |
| 24 | + <div class="d-flex justify-content-end"> |
| 25 | + <a href="{{ route('news.show', $new) }}" class="btn btn-outline-secondary" style="width: 80px; font-size: 0.7rem">Read</a> |
28 | 26 |
|
29 | | - @if(auth()->user()->hasRole('admin')) |
30 | | - <a href="{{ route('news.edit', $new) }}" class="btn btn-outline-secondary mx-1" style="width: 80px; font-size: 0.7rem">Edit</a> |
| 27 | + @if(auth()->user()->hasRole('admin')) |
| 28 | + <a href="{{ route('news.edit', $new) }}" class="btn btn-outline-secondary mx-1" style="width: 80px; font-size: 0.7rem">Edit</a> |
31 | 29 |
|
32 | | - <form method="post" action="{{ route('news.destroy', $new) }}"> |
33 | | - @csrf |
34 | | - @method('DELETE') |
| 30 | + <form method="post" action="{{ route('news.destroy', $new) }}"> |
| 31 | + @csrf |
| 32 | + @method('DELETE') |
35 | 33 |
|
36 | | - <button type="submit" class="btn btn-outline-secondary" style="width: 80px; font-size: 0.7rem">Delete</button> |
37 | | - </form> |
38 | | - @endif |
39 | | - </div> |
40 | | - </div> |
| 34 | + <button type="submit" class="btn btn-outline-secondary" style="width: 80px; font-size: 0.7rem">Delete</button> |
| 35 | + </form> |
| 36 | + @endif |
41 | 37 | </div> |
42 | | - @empty |
43 | | - <p class="no-news">No available news yet</p> |
44 | | - @endforelse |
| 38 | + </div> |
45 | 39 | </div> |
46 | | - |
47 | | - @include('layouts.aside-tags') |
48 | | - </section> |
| 40 | + @empty |
| 41 | + <p class="no-news">No available news yet</p> |
| 42 | + @endforelse |
49 | 43 | </div> |
50 | | -</main> |
| 44 | +</section> |
| 45 | + |
0 commit comments