Skip to content

Display more threads #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function index()

$latestThreads = Cache::remember('latestThreads', now()->addHour(), function () {
return Thread::whereNull('solution_reply_id')
->whereBetween('threads.created_at', [now()->subMonth(), now()])
->whereBetween('threads.created_at', [now()->subMonths(3), now()])
->inRandomOrder()
->limit(4)
->get();
Expand Down
2 changes: 1 addition & 1 deletion app/View/Composers/ChannelsComposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function compose(View $view)
'channels',
Cache::remember(
'channels',
now()->addDay(),
now()->addWeek(),
fn () => Channel::with('items')->whereNull('parent_id')->get()
)
);
Expand Down
2 changes: 1 addition & 1 deletion public/css/app.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"/js/app.js": "/js/app.js?id=3bd7a17ae8879cea08888521628605ff",
"/css/app.css": "/css/app.css?id=7b8652dcf9744257f1400ac52d15a911"
"/css/app.css": "/css/app.css?id=ba2fad2529b5b940ef8cbaf0258160a4"
}
8 changes: 4 additions & 4 deletions resources/views/articles/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<article class="relative lg:grid lg:grid-cols-9 lg:gap-10" xmlns:livewire="http://www.w3.org/1999/html">
<div class="hidden relative lg:block lg:col-span-2">
<div class="divide-y divide-skin-base sticky space-y-6 top-4">
<x-sticky-content class="divide-y divide-skin-base space-y-6">
<div>
<h4 class="text-xs text-skin-base font-medium leading-4 tracking-wide uppercase font-heading">A propos de l’auteur</h4>
<div class="mt-6 space-y-4">
Expand Down Expand Up @@ -88,7 +88,7 @@
<div class="pt-6">
<livewire:reactions :model="$article" />
</div>
</div>
</x-sticky-content>
</div>
<div class="lg:col-span-5">
<header class="space-y-4">
Expand Down Expand Up @@ -264,7 +264,7 @@ class="inline-flex items-center py-2 px-4 border border-skin-base rounded-md sha
@endif
</div>
<div class="hidden relative lg:block lg:col-span-2">
<div class="sticky top-4 space-y-10">
<x-sticky-content class="space-y-10">
@if($article->showToc())
<div class="bg-skin-card px-4 py-6 rounded-lg shadow-lg">
<h4 class="text-sm text-skin-inverted font-semibold leading-tight tracking-widest uppercase">Table des matières</h4>
Expand All @@ -275,7 +275,7 @@ class="inline-flex items-center py-2 px-4 border border-skin-base rounded-md sha
<x-ads />

<x-discord />
</div>
</x-sticky-content>
</div>
</article>

Expand Down
3 changes: 3 additions & 0 deletions resources/views/components/sticky-content.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<aside {{ $attributes->merge(['class' => 'sticky top-16']) }}>
{{ $slot }}
</aside>
4 changes: 2 additions & 2 deletions resources/views/discussions/_contributions.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<aside class="sticky space-y-16 top-4">
<x-sticky-content class="space-y-12">
<div>
<h4 class="text-lg font-semibold text-skin-inverted font-sans leading-6">Top Contributeurs</h4>
<p class="mt-3 font-normal text-skin-base text-sm">Les personnes qui ont lancé le plus de discussions sur le site.</p>
Expand Down Expand Up @@ -56,4 +56,4 @@
</div>

</div>
</aside>
</x-sticky-content>
4 changes: 2 additions & 2 deletions resources/views/forum/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
</div>

<div class="hidden relative mt-10 lg:block lg:col-span-2 xl:col-span-3">
<aside class="sticky block top-4 space-y-10">
<x-sticky-content class="space-y-10">
<x-sponsors />

<x-ads />

@include('forum._moderators')
</aside>
</x-sticky-content>
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions resources/views/forum/thread.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<div class="relative lg:grid lg:grid-cols-9 lg:gap-10">
<div class="hidden relative lg:block lg:col-span-2">
<div class="sticky top-4 space-y-6">
<x-sticky-content class="space-y-6">
<x-button :link="route('forum.new')" class="w-full flex justify-center">
Nouveau Sujet
<x-heroicon-o-plus-circle class="h-4 w-4 ml-2.5" />
Expand All @@ -24,7 +24,7 @@
@endauth

<x-forum.thread-author :author="$thread->author" />
</div>
</x-sticky-content>
</div>
<div class="lg:col-span-7 lg:pl-8 lg:border-l lg:border-skin-base">
<h1 class="text-xl text-skin-inverted font-medium tracking-tight sm:text-3xl font-heading">{{ $thread->subject() }}</h1>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/layouts/footer.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<x-footer-link title="Jobs" url="#" soon />

<x-footer-link title="Sponsors" url="#" />
<x-footer-link title="Sponsors" url="#" soon />

<x-footer-link title="Branding" url="https://github.com/caneco/laravel-country-logomarks/blob/main/src/cm/README.md" />

Expand Down
8 changes: 3 additions & 5 deletions resources/views/layouts/master.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" class="scroll-smooth {{ get_current_theme() }}">
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" class="h-full scroll-smooth {{ get_current_theme() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Expand Down Expand Up @@ -44,11 +44,9 @@

@include('layouts._fathom')
</head>
<body class="font-sans antialiased bg-skin-body text-skin-base">
<body class="h-full font-sans antialiased bg-skin-body text-skin-base">

<div class="relative min-h-full overflow-hidden">
@yield('content')
</div>
@yield('content')

<x-notifications z-index="z-50" />

Expand Down
24 changes: 12 additions & 12 deletions resources/views/livewire/articles/browse.blade.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<div class="relative lg:grid lg:grid-cols-9 lg:gap-10">
<div class="hidden relative lg:block lg:col-span-2">
<div class="sticky top-4 divide-y divide-skin-base">
<div class="lg:grid lg:grid-cols-9 lg:gap-10">
<div class="hidden lg:block lg:col-span-2">
<x-sticky-content class="divide-y divide-skin-base">
<x-articles.filter :selectedSortBy="$selectedSortBy" />

<div class="pt-8">
<span class="inline-flex items-center px-2 py-1 rounded-md text-sm font-medium bg-skin-link text-skin-base font-sans">
<svg class="mr-1.5 h-2 w-2 text-skin-base" fill="currentColor" viewBox="0 0 8 8">
<circle cx="4" cy="4" r="3" />
</svg>
Tous les tags
</span>
<span class="inline-flex items-center px-2 py-1 rounded-md text-sm font-medium bg-skin-link text-skin-base font-sans">
<svg class="mr-1.5 h-2 w-2 text-skin-base" fill="currentColor" viewBox="0 0 8 8">
<circle cx="4" cy="4" r="3" />
</svg>
Tous les tags
</span>

<x-tags :tags="$tags" :selected-tag="$selectedTag" isLowercase showHashTag />
</div>
</div>
</x-sticky-content>
</div>
<div
x-data
Expand Down Expand Up @@ -51,13 +51,13 @@ class="mt-5 flex justify-center"
</div>

<div class="hidden lg:block lg:col-span-2">
<div class="sticky top-4 space-y-12">
<x-sticky-content class="space-y-12">
<x-sponsors />

<x-ads />

<x-discord />
</div>
</x-sticky-content>
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions resources/views/livewire/discussions/browse.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="relative lg:grid lg:grid-cols-12 lg:gap-8">
<div class="hidden relative lg:block lg:col-span-2">
<aside class="sticky top-4 divide-y divide-skin-base">
<x-sticky-content class="divide-y divide-skin-base">
<div class="pb-6">
<span class="inline-flex items-center px-2 py-1 rounded-md text-sm font-medium bg-skin-link text-skin-base font-sans">
<svg class="mr-1.5 h-2 w-2 text-skin-base" fill="currentColor" viewBox="0 0 8 8">
Expand All @@ -17,7 +17,7 @@
<x-button :link="route('discussions.new')">Nouvelle discussion</x-button>
</div>
@endauth
</aside>
</x-sticky-content>
</div>
<div
x-data
Expand Down