Skip to content

🐛 Fix author relations on user dashboard #108

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 1 commit into from
May 5, 2023
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
20 changes: 13 additions & 7 deletions resources/views/components/discussions/summary.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
<div class="mt-2 lg:flex lg:items-center lg:justify-between">
<div class="flex-1">
<h2 class="text-xl font-semibold font-sans text-skin-inverted leading-7">
<a href="{{ route('discussions.show', $discussion) }}" class="hover:text-skin-primary">{{ $discussion->title }}</a>
<a href="{{ route('discussions.show', $discussion) }}" class="hover:text-skin-primary">
{{ $discussion->title }}
</a>
</h2>
</div>
<div class="mt-2 lg:mt-0 shrink-0 self-start">
Expand All @@ -22,12 +24,14 @@
</p>
<div class="mt-3 flex justify-between">
<div class="flex items-center text-sm font-sans text-skin-muted">
<a class="shrink-0" href="{{ route('profile', $discussion->author->username) }}">
<img class="h-6 w-6 object-cover rounded-full" src="{{ $discussion->author->profile_photo_url }}" alt="{{ $discussion->author->name }}">
<a class="shrink-0" href="{{ route('profile', $discussion->user->username) }}">
<img class="h-6 w-6 object-cover rounded-full" src="{{ $discussion->user->profile_photo_url }}" alt="{{ $discussion->user->name }}">
</a>
<span class="ml-2 pr-1">Posté par</span>
<div class="flex items-center space-x-1">
<a href="{{ route('profile', $discussion->author->username) }}" class="text-skin-inverted hover:underline">{{ $discussion->author->name }}</a>
<a href="{{ route('profile', $discussion->user->username) }}" class="text-skin-inverted hover:underline">
{{ $discussion->user->name }}
</a>
<span aria-hidden="true">&middot;</span>
<time-ago time="{{ $discussion->created_at->getTimestamp() }}"/>
</div>
Expand All @@ -37,14 +41,16 @@
<svg class="w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" d="M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 01.865-.501 48.172 48.172 0 003.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z" />
</svg>
<span class="font-normal text-skin-inverted-muted">{{ $discussion->count_all_replies_with_child }}</span>
<span class="sr-only">réponses</span>
<span class="font-normal text-skin-inverted-muted">
{{ $discussion->count_all_replies_with_child }}
</span>
<span class="sr-only">{{ __('réponses') }}</span>
</p>
<a href="{{ route('discussions.edit', $discussion->slug()) }}" class="inline-flex items-center font-normal text-skin-inverted-muted hover:text-skin-base hover:underline">
<svg class="h-4 w-4 mr-1.5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" d="M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487zm0 0L19.5 7.125" />
</svg>
Éditer
{{ __('Éditer') }}
</a>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions resources/views/components/forum/thread-summary.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<div class="lg:flex lg:space-x-3">
<div class="flex-1 flex items-center space-x-3">
<div class="shrink-0">
<img class="h-8 w-8 object-cover rounded-full" src="{{ $thread->author->profile_photo_url }}" alt="{{ $thread->author->name }}">
<img class="h-8 w-8 object-cover rounded-full" src="{{ $thread->user->profile_photo_url }}" alt="{{ $thread->user->name }}">
</div>
<div class="min-w-0 flex-1 flex items-center space-x-1 font-sans">
<p class="text-sm font-medium text-skin-inverted">
<a href="{{ route('profile', $thread->author->username) }}" class="block group">
<span class="group-hover:underline">{{ $thread->author->name }}</span>
<span class="text-skin-muted">{{ '@'. $thread->author->username }}</span>
<a href="{{ route('profile', $thread->user->username) }}" class="block group">
<span class="group-hover:underline">{{ $thread->user->name }}</span>
<span class="text-skin-muted">{{ '@'. $thread->user->username }}</span>
</a>
</p>
<span aria-hidden="true">&middot;</span>
Expand Down
6 changes: 3 additions & 3 deletions resources/views/user/discussions.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<x-user.breadcrumb section="Discussions" />

<h2 class="text-xl font-bold leading-7 text-skin-inverted sm:text-2xl sm:truncate font-heading">
Discussions
{{ __('Discussions') }}
</h2>
</div>

Expand All @@ -20,14 +20,14 @@
<x-user.sidebar :user="$user" />
</div>
<main class="lg:col-span-9">
<x-user.page-heading title="Vos discussions" :url="route('discussions.new')" button="Nouvelle discussion" />
<x-user.page-heading title="Vos discussions" :url="route('discussions.new')" :button="__('Nouvelle discussion')" />

<div class="mt-5">
@forelse($discussions as $discussion)
<x-discussions.summary :discussion="$discussion" />
@empty
<p class="text-skin-base text-base">
Vous n'avez pas encore créé de discussions.
{{ __('Vous n\'avez pas encore créé de discussions.') }}
</p>
@endforelse

Expand Down
6 changes: 3 additions & 3 deletions resources/views/user/threads.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<x-user.breadcrumb section="Sujets" />

<h2 class="text-xl font-bold leading-7 text-skin-inverted sm:text-2xl sm:truncate font-heading">
Sujets
{{ __('Sujets') }}
</h2>
</div>

Expand All @@ -20,14 +20,14 @@
<x-user.sidebar :user="$user" />
</div>
<main class="lg:col-span-9">
<x-user.page-heading title="Vos sujets" :url="route('forum.new')" button="Nouveau sujet" />
<x-user.page-heading title="Vos sujets" :url="route('forum.new')" :button="__('Nouveau sujet')" />

<div class="mt-5">
@forelse($threads as $thread)
<x-forum.thread-summary :thread="$thread" />
@empty
<p class="text-skin-base text-base">
Vous n'avez pas encore créé de sujets.
{{ __('Vous n\'avez pas encore créé de sujets.') }}
</p>
@endforelse

Expand Down