Skip to content

Commit d3671e3

Browse files
authored
🐛 Fix author relations on user dashboard (#108)
1 parent 72a7b64 commit d3671e3

File tree

4 files changed

+23
-17
lines changed

4 files changed

+23
-17
lines changed

resources/views/components/discussions/summary.blade.php

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
<div class="mt-2 lg:flex lg:items-center lg:justify-between">
55
<div class="flex-1">
66
<h2 class="text-xl font-semibold font-sans text-skin-inverted leading-7">
7-
<a href="{{ route('discussions.show', $discussion) }}" class="hover:text-skin-primary">{{ $discussion->title }}</a>
7+
<a href="{{ route('discussions.show', $discussion) }}" class="hover:text-skin-primary">
8+
{{ $discussion->title }}
9+
</a>
810
</h2>
911
</div>
1012
<div class="mt-2 lg:mt-0 shrink-0 self-start">
@@ -22,12 +24,14 @@
2224
</p>
2325
<div class="mt-3 flex justify-between">
2426
<div class="flex items-center text-sm font-sans text-skin-muted">
25-
<a class="shrink-0" href="{{ route('profile', $discussion->author->username) }}">
26-
<img class="h-6 w-6 object-cover rounded-full" src="{{ $discussion->author->profile_photo_url }}" alt="{{ $discussion->author->name }}">
27+
<a class="shrink-0" href="{{ route('profile', $discussion->user->username) }}">
28+
<img class="h-6 w-6 object-cover rounded-full" src="{{ $discussion->user->profile_photo_url }}" alt="{{ $discussion->user->name }}">
2729
</a>
2830
<span class="ml-2 pr-1">Posté par</span>
2931
<div class="flex items-center space-x-1">
30-
<a href="{{ route('profile', $discussion->author->username) }}" class="text-skin-inverted hover:underline">{{ $discussion->author->name }}</a>
32+
<a href="{{ route('profile', $discussion->user->username) }}" class="text-skin-inverted hover:underline">
33+
{{ $discussion->user->name }}
34+
</a>
3135
<span aria-hidden="true">&middot;</span>
3236
<time-ago time="{{ $discussion->created_at->getTimestamp() }}"/>
3337
</div>
@@ -37,14 +41,16 @@
3741
<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">
3842
<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" />
3943
</svg>
40-
<span class="font-normal text-skin-inverted-muted">{{ $discussion->count_all_replies_with_child }}</span>
41-
<span class="sr-only">réponses</span>
44+
<span class="font-normal text-skin-inverted-muted">
45+
{{ $discussion->count_all_replies_with_child }}
46+
</span>
47+
<span class="sr-only">{{ __('réponses') }}</span>
4248
</p>
4349
<a href="{{ route('discussions.edit', $discussion->slug()) }}" class="inline-flex items-center font-normal text-skin-inverted-muted hover:text-skin-base hover:underline">
4450
<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">
4551
<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" />
4652
</svg>
47-
Éditer
53+
{{ __('Éditer') }}
4854
</a>
4955
</div>
5056
</div>

resources/views/components/forum/thread-summary.blade.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
<div class="lg:flex lg:space-x-3">
77
<div class="flex-1 flex items-center space-x-3">
88
<div class="shrink-0">
9-
<img class="h-8 w-8 object-cover rounded-full" src="{{ $thread->author->profile_photo_url }}" alt="{{ $thread->author->name }}">
9+
<img class="h-8 w-8 object-cover rounded-full" src="{{ $thread->user->profile_photo_url }}" alt="{{ $thread->user->name }}">
1010
</div>
1111
<div class="min-w-0 flex-1 flex items-center space-x-1 font-sans">
1212
<p class="text-sm font-medium text-skin-inverted">
13-
<a href="{{ route('profile', $thread->author->username) }}" class="block group">
14-
<span class="group-hover:underline">{{ $thread->author->name }}</span>
15-
<span class="text-skin-muted">{{ '@'. $thread->author->username }}</span>
13+
<a href="{{ route('profile', $thread->user->username) }}" class="block group">
14+
<span class="group-hover:underline">{{ $thread->user->name }}</span>
15+
<span class="text-skin-muted">{{ '@'. $thread->user->username }}</span>
1616
</a>
1717
</p>
1818
<span aria-hidden="true">&middot;</span>

resources/views/user/discussions.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<x-user.breadcrumb section="Discussions" />
1212

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

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

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

resources/views/user/threads.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<x-user.breadcrumb section="Sujets" />
1212

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

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

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

0 commit comments

Comments
 (0)