Skip to content

Commit

Permalink
Add top banner and read time estimate
Browse files Browse the repository at this point in the history
  • Loading branch information
IsharaEkanayaka committed Sep 17, 2024
1 parent 7e79ee7 commit a0fcf87
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 2 deletions.
2 changes: 1 addition & 1 deletion resources/views/backend/event/index-table-row.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<x-livewire-tables::table.cell>
<div class="d-flex px-0 mt-0 mb-0">
<div class="btn-group" role="group" aria-label="">
<a href="{{ route('dashboard.event.preview', $row) }}" class="btn btn-warning" target="_blank">
<a href="{{ route('dashboard.event.preview', $row) }}" class="btn btn-warning">
<i class="fa fa-eye" title="Preview"></i>
</a>
<a href="{{ route('dashboard.event.edit', $row) }}" class="btn btn-info"><i class="fa fa-pencil"
Expand Down
11 changes: 11 additions & 0 deletions resources/views/backend/event/preview.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
</head>

<body>
@include('includes.partials.event-preview')
<div class="container vh-75">
<div class="container col-sm-12 col-md-10 col-lg-10 mx-auto mt-3 py-2">

Expand All @@ -20,6 +21,16 @@
</span>
@endif

@if($event->description)
@php
$words = str_word_count(strip_tags($event->description));
$read_time = ceil($words / 200);
@endphp
<span class="text-muted">
{{ $read_time }} mins read
</span>
@endif

<hr>

@if($event->image)
Expand Down
2 changes: 1 addition & 1 deletion resources/views/backend/news/index-table-row.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<x-livewire-tables::table.cell>
<div class="d-flex px-0 mt-0 mb-0">
<div class="btn-group" role="group" aria-label="">
<a href="{{ route('dashboard.news.preview', $row) }}" class="btn btn-warning" target="_blank">
<a href="{{ route('dashboard.news.preview', $row) }}" class="btn btn-warning">
<i class="fa fa-eye" title="Preview"></i>
</a>
<a href="{{ route('dashboard.news.edit', $row) }}" class="btn btn-info"><i class="fa fa-pencil"
Expand Down
12 changes: 12 additions & 0 deletions resources/views/backend/news/preview.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
</head>

<body>
@include('includes.partials.news-preview')
<div class="container vh-75">
<div class="container col-sm-12 col-md-10 col-lg-10 mx-auto mt-3 py-2">
<span class="h3 pb-2">{{ $news->title }}</span><br>
Expand All @@ -18,6 +19,17 @@
{{ $news->user->name }} &middot;
</span>
@endif

@if($news->description)
@php
$words = str_word_count(strip_tags($news->description));
$read_time = ceil($words / 200);
@endphp
<span class="text-muted">
{{ $read_time }} mins read
</span>
@endif

<hr>

@if($news->image)
Expand Down
5 changes: 5 additions & 0 deletions resources/views/includes/partials/event-preview.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div class="alert alert-warning pt-1 pb-1 mb-0">
@lang('This is a preview of the event, :title.', ['title' => $event->title])
<a href="{{ route('dashboard.event.index') }}">@lang('Back')</a> |
<a href="{{ route('dashboard.event.edit', $event->id) }}">@lang('Edit')</a>
</div>
5 changes: 5 additions & 0 deletions resources/views/includes/partials/news-preview.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div class="alert alert-warning pt-1 pb-1 mb-0">
@lang('This is a preview of the news, :title.', ['title' => $news->title])
<a href="{{ route('dashboard.news.index') }}">@lang('Back')</a> |
<a href="{{ route('dashboard.news.edit', $news->id) }}">@lang('Edit')</a>
</div>

0 comments on commit a0fcf87

Please sign in to comment.