From 7844695b1868b25520c40660994857919cff1d18 Mon Sep 17 00:00:00 2001 From: Charles Teh Date: Sun, 3 Dec 2023 10:15:08 +0800 Subject: [PATCH] Update (UI) --- .../Controllers/Front/FrontHomeController.php | 2 +- .../Controllers/Front/FrontListController.php | 2 + config/seotools.php | 6 +- .../views/front/partials/about.blade.php | 3 +- .../views/front/partials/news_bites.blade.php | 79 ++++++------------- resources/views/front/welcome.blade.php | 10 +-- 6 files changed, 33 insertions(+), 69 deletions(-) diff --git a/app/Http/Controllers/Front/FrontHomeController.php b/app/Http/Controllers/Front/FrontHomeController.php index 2327f17..8d5fe1e 100644 --- a/app/Http/Controllers/Front/FrontHomeController.php +++ b/app/Http/Controllers/Front/FrontHomeController.php @@ -28,7 +28,7 @@ public function home(Request $request) $top_rss_keywords = HybridTopRssPostKeywords::get(1, 16); - $rss_posts = RssPost::with('entities_keywords')->where('status', 'published')->orderBy('published_at', 'desc')->paginate(15); + $rss_posts = RssPost::with('entities_keywords')->whereNotNull('keywords')->where('status', 'published')->orderBy('published_at', 'desc')->paginate(15); return response(view('front.welcome', compact('rss_posts', 'top_rss_keywords')), 200); } diff --git a/app/Http/Controllers/Front/FrontListController.php b/app/Http/Controllers/Front/FrontListController.php index c5fb952..6618bba 100644 --- a/app/Http/Controllers/Front/FrontListController.php +++ b/app/Http/Controllers/Front/FrontListController.php @@ -64,6 +64,7 @@ public function searchResults(Request $request, $query) $rss_posts = RssPost::with('category', 'entities_keywords') ->where('status', 'published') + ->whereNotNull('keywords') ->whereRaw("to_tsvector('english', title || ' ' || bites || ' ' || keyword_list) @@ plainto_tsquery('english', ?)", [trim(preg_replace('/\s+/', ' ', $query))]) ->where('published_at', '<=', now()) ->orderBy('published_at', 'desc') @@ -106,6 +107,7 @@ public function index(Request $request) //SEOTools::setDescription($description); $rss_posts = RssPost::with('category', 'entities_keywords')->where('status', 'published') + ->whereNotNull('keywords') ->where('published_at', '<=', now()) ->orderBy('published_at', 'desc') ->cursorPaginate(60) ?? collect(); diff --git a/config/seotools.php b/config/seotools.php index b74a00c..79bb01b 100644 --- a/config/seotools.php +++ b/config/seotools.php @@ -12,7 +12,7 @@ * The default configurations to be used by the meta generator. */ 'defaults' => [ - 'title' => 'FutureWalker: Daily AI & tech news', // set false to total remove + 'title' => 'FutureWalker: Real-time AI & tech news', // set false to total remove 'titleBefore' => false, // Put defaults.title before page title, like 'It's Over 9000! - Dashboard' 'description' => 'Stay updated with critical AI & tech news to build your future.', // set false to total remove 'separator' => ' - ', @@ -39,7 +39,7 @@ * The default configurations to be used by the opengraph generator. */ 'defaults' => [ - 'title' => 'FutureWalker: Daily AI & tech news', // set false to total remove + 'title' => 'FutureWalker: Real-time AI & tech news', // set false to total remove 'description' => 'Stay updated with critical AI & tech news to build your future.', // set false to total remove 'url' => null, // Set null for using Url::current(), set false to total remove 'type' => 'website', @@ -61,7 +61,7 @@ * The default configurations to be used by the json-ld generator. */ 'defaults' => [ - 'title' => 'FutureWalker: Daily AI & tech news', // set false to total remove + 'title' => 'FutureWalker: Real-time AI & tech news', // set false to total remove 'description' => 'Stay updated with critical AI & tech news to build your future.', // set false to total remove 'url' => 'current', // Set to null or 'full' to use Url::full(), set to 'current' to use Url::current(), set false to total remove 'type' => 'WebPage', diff --git a/resources/views/front/partials/about.blade.php b/resources/views/front/partials/about.blade.php index 6df5258..09c6e48 100644 --- a/resources/views/front/partials/about.blade.php +++ b/resources/views/front/partials/about.blade.php @@ -1,7 +1,6 @@ diff --git a/resources/views/front/partials/news_bites.blade.php b/resources/views/front/partials/news_bites.blade.php index b434718..1b28f5f 100644 --- a/resources/views/front/partials/news_bites.blade.php +++ b/resources/views/front/partials/news_bites.blade.php @@ -1,34 +1,32 @@ -
- - @foreach ($rss_posts as $key => $post) -
-

- -

-
-
- @if (!is_empty($post->bites)) -
The Bite:
-
{{ $post->bites }}
- @endif - - @if (!is_empty($post->impact)) - - @if (in_array($post->impact_level, ['medium', 'high'])) -
-
-
Social Impact:
-
{{ $post->impact }}
-
-
- @endif - - @endif - @if ($post->entities) -
- More about: @foreach ($post->entities_keywords as $keyword) - #{{ $keyword->value_lowercased }} - @endforeach -
- @endif - -
+
+
+ +
-@endforeach - - +
+@endforeach diff --git a/resources/views/front/welcome.blade.php b/resources/views/front/welcome.blade.php index 7a0e11d..ba36a9e 100644 --- a/resources/views/front/welcome.blade.php +++ b/resources/views/front/welcome.blade.php @@ -8,7 +8,7 @@
Your Future Depends on Today's News

In the fast-evolving world of AI and tech, staying updated is not - optional—it's critical for your future success. Stay updated with daily news 🍪 bites from + optional—it's critical for your future success. Stay updated with hourly news FutureWalker.

@@ -77,7 +77,7 @@ class="text-secondary">{{ $post->published_at->diffForHumans() }}

- 🍪 Tech Bites

+ This Just In 🛰️
UPDATED HOURLY
-
- Tap on to read the 1 minute news bite worth every second -
-
@@ -97,7 +93,7 @@ class="bi bi-clock-history me-1"> UPDATED HOURLY
Read more News Bites + class="btn btn-primary px-4 rounded-pill text-decoration-none">Discover more news
@endif