Skip to content

Commit

Permalink
fix links
Browse files Browse the repository at this point in the history
  • Loading branch information
daniieljc committed Apr 6, 2022
1 parent 0c4de2f commit 0e35de2
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 257 deletions.
8 changes: 3 additions & 5 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Controllers;

use App\Library\News;
use App\Models\NewsLetter;
use App\Models\NewsTopic;
use Carbon\Carbon;
Expand All @@ -13,7 +14,7 @@ public function _invoke()
{
$topics = NewsTopic::all();
$now = Carbon::now();
$news = NewsLetter::whereDay('created_at', $now->format('d'))->whereYear('created_at', $now->format('Y'))->whereMonth('created_at', $now->format('m'))->get();
$news = NewsLetter::whereDay('created_at', $now->format('d'))->whereYear('created_at', $now->format('Y'))->whereMonth('created_at', $now->format('m'))->orderBy('created_at', 'DESC')->get();
return view('home')->with('news', $news)->with('topics', $topics);
}

Expand All @@ -27,9 +28,6 @@ public function topic($id)

public function news($id)
{
$topics = NewsTopic::all();
$now = Carbon::now();
$news = NewsLetter::where('news_topic_id', $id)->whereDay('created_at', $now->format('d'))->whereYear('created_at', $now->format('Y'))->whereMonth('created_at', $now->format('m'))->get();
return view('show')->with('news', $news)->with('topics', $topics)->with('topicid', $id);
return view('show')->with('news', NewsLetter::find($id));
}
}
2 changes: 1 addition & 1 deletion app/Library/News.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function importNews()
'author' => $article->author,
'link' => $article->link,
'excerpt' => $article->excerpt,
'summary' => $article->summary,
'summary' => nl2br(htmlentities($article->summary)),
'rank' => $article->rank,
'news_topic_id' => $topic->id,
'country' => $article->country,
Expand Down
2 changes: 1 addition & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
|
*/

'locale' => 'en',
'locale' => 'es',

/*
|--------------------------------------------------------------------------
Expand Down
37 changes: 8 additions & 29 deletions public/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -959,10 +959,6 @@ input[type=range]::-moz-focus-outer {
margin-left: auto;
margin-right: auto;
}
.mx-1{
margin-left: 0.25rem;
margin-right: 0.25rem;
}
.my-2{
margin-top: 0.5rem;
margin-bottom: 0.5rem;
Expand All @@ -988,12 +984,6 @@ input[type=range]::-moz-focus-outer {
.mt-3{
margin-top: 0.75rem;
}
.mt-12{
margin-top: 3rem;
}
.mr-2{
margin-right: 0.5rem;
}
.mb-8{
margin-bottom: 2rem;
}
Expand Down Expand Up @@ -1381,10 +1371,6 @@ input[type=range]::-moz-focus-outer {
padding-top: 1.25rem;
padding-bottom: 1.25rem;
}
.px-1{
padding-left: 0.25rem;
padding-right: 0.25rem;
}
.py-8{
padding-top: 2rem;
padding-bottom: 2rem;
Expand All @@ -1405,6 +1391,10 @@ input[type=range]::-moz-focus-outer {
padding-top: 0.25rem;
padding-bottom: 0.25rem;
}
.px-1{
padding-left: 0.25rem;
padding-right: 0.25rem;
}
.py-6{
padding-top: 1.5rem;
padding-bottom: 1.5rem;
Expand Down Expand Up @@ -1536,10 +1526,6 @@ input[type=range]::-moz-focus-outer {
--tw-text-opacity: 1;
color: rgb(110 110 118 / var(--tw-text-opacity));
}
.text-gray-400{
--tw-text-opacity: 1;
color: rgb(162 162 168 / var(--tw-text-opacity));
}
.text-gray-900{
--tw-text-opacity: 1;
color: rgb(29 29 32 / var(--tw-text-opacity));
Expand All @@ -1552,6 +1538,10 @@ input[type=range]::-moz-focus-outer {
--tw-text-opacity: 1;
color: rgb(255 255 255 / var(--tw-text-opacity));
}
.text-gray-400{
--tw-text-opacity: 1;
color: rgb(162 162 168 / var(--tw-text-opacity));
}
.text-indigo-600{
--tw-text-opacity: 1;
color: rgb(90 103 216 / var(--tw-text-opacity));
Expand Down Expand Up @@ -2625,11 +2615,6 @@ body[data-aos-easing=ease-in-out-quart] [data-aos], [data-aos][data-aos][data-ao
color: rgb(162 162 168 / var(--tw-text-opacity));
}

.dark .dark\:text-gray-500{
--tw-text-opacity: 1;
color: rgb(110 110 118 / var(--tw-text-opacity));
}

.dark .dark\:text-gray-300{
--tw-text-opacity: 1;
color: rgb(212 212 216 / var(--tw-text-opacity));
Expand Down Expand Up @@ -2691,9 +2676,6 @@ body[data-aos-easing=ease-in-out-quart] [data-aos], [data-aos][data-aos][data-ao
.sm\:flex{
display: flex;
}
.sm\:inline-flex{
display: inline-flex;
}
.sm\:hidden{
display: none;
}
Expand All @@ -2712,9 +2694,6 @@ body[data-aos-easing=ease-in-out-quart] [data-aos], [data-aos][data-aos][data-ao
.sm\:justify-center{
justify-content: center;
}
.sm\:justify-between{
justify-content: space-between;
}
.sm\:rounded-lg{
border-radius: 0.5rem;
}
Expand Down
56 changes: 4 additions & 52 deletions resources/views/home.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ class="flex pr-6 py-5 bg-white dark:bg-gray-800 divide-x divide-gray-200 dark:di
<div class="pl-6">
<header>
<h3 class="font-red-hat-display text-xl tracking-tighter mb-1">
<a href="#0">{{$new->title}}</a>
<a href="{{route('news', $new->id)}}">{{$new->title}}</a>
</h3>
</header>
<p class="text-gray-600 dark:text-gray-400">
{{$new->excerpt}}
</p>
<a class="inline-flex items-center font-medium text-teal-500 hover:underline mt-2"
href="#0">
href="{{route('news', $new->id)}}">
<span>Leer Más</span>
<svg class="w-3 h-3 flex-shrink-0 mt-px ml-2" viewBox="0 0 12 12"
xmlns="http://www.w3.org/2000/svg">
Expand All @@ -61,62 +61,14 @@ class="flex pr-6 py-5 bg-white dark:bg-gray-800 divide-x divide-gray-200 dark:di
<a class="font-medium text-gray-800 dark:text-gray-400 hover:underline"
target="_blank"
href="{{$new->link}}">{{$new->author}}</a>
<span
class="text-gray-600 dark:text-gray-400"> · {{ucfirst(\Carbon\Carbon::parse($new->created_at)->diffForHumans())}}</span>
</div>
</footer>
</div>
</div>
</article>
@endforeach

<nav class="flex justify-center sm:justify-between mt-12">
<span class="hidden sm:inline-flex items-center font-medium text-gray-400 dark:text-gray-500"
href="#0">
<svg class="w-3 h-3 flex-shrink-0 mt-px mr-2" viewBox="0 0 12 12"
xmlns="http://www.w3.org/2000/svg">
<path class="fill-current"
d="M5.091 11L0 5.909 5.091.818l.875.875-3.602 3.591h9.329v1.25H2.364l3.602 3.602z"/>
</svg>
<span>Previous</span>
</span>
<ul class="flex">
<li class="mx-1">
<a class="inline-flex text-teal-500 px-1 border-b border-teal-500 transition duration-150 ease-in-out"
href="#0">1</a>
</li>
<li class="mx-1">
<a class="inline-flex text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 px-1 transition duration-150 ease-in-out"
href="#0">2</a>
</li>
<li class="mx-1">
<a class="inline-flex text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 px-1 transition duration-150 ease-in-out"
href="#0">3</a>
</li>
<li class="mx-1">
<span class="inline-flex text-gray-600 dark:text-gray-400" href="#0">…</span>
</li>
<li class="mx-1">
<a class="inline-flex text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 px-1 transition duration-150 ease-in-out"
href="#0">7</a>
</li>
<li class="mx-1">
<a class="inline-flex text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 px-1 transition duration-150 ease-in-out"
href="#0">8</a>
</li>
<li class="mx-1">
<a class="inline-flex text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 px-1 transition duration-150 ease-in-out"
href="#0">9</a>
</li>
</ul>
<a class="hidden sm:inline-flex items-center font-medium text-teal-500 hover:underline"
href="#0">
<span>Next</span>
<svg class="w-3 h-3 flex-shrink-0 mt-px ml-2" viewBox="0 0 12 12"
xmlns="http://www.w3.org/2000/svg">
<path class="fill-current"
d="M6.602 11l-.875-.864L9.33 6.534H0v-1.25h9.33L5.727 1.693l.875-.875 5.091 5.091z"/>
</svg>
</a>
</nav>
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit 0e35de2

Please sign in to comment.