Skip to content
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
9 changes: 4 additions & 5 deletions app/Http/Controllers/UserProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ public function show(string $username)
: false;

$appreciators = $user->appreciators()
->select(['users.id', 'users.name', 'users.username', 'users.image_path', 'users.institution', 'users.title'])
->select(['users.id', 'users.name', 'users.username', 'users.image_path', 'users.institution'])
->inRandomOrder()
->take(30)
->get();

$appreciating = $user->appreciatingUsers()
->select(['users.id', 'users.name', 'users.username', 'users.image_path', 'users.institution', 'users.title'])
->select(['users.id', 'users.name', 'users.username', 'users.image_path', 'users.institution'])
->inRandomOrder()
->take(30)
->get();
Expand Down Expand Up @@ -194,7 +194,7 @@ public function show(string $username)
$contributorUsers = User::where('id', '!=', $user->id)
->whereNotNull('username')
->whereHas('roles')
->select(['id', 'name', 'username', 'title', 'institution', 'image_path', 'about'])
->select(['id', 'name', 'username', 'institution', 'image_path', 'about'])
->inRandomOrder()
->take(2)
->get();
Expand All @@ -204,7 +204,7 @@ public function show(string $username)

$randomUsers = User::whereNotIn('id', $excludedIds)
->whereNotNull('username')
->select(['id', 'name', 'username', 'title', 'institution', 'image_path', 'about'])
->select(['id', 'name', 'username', 'institution', 'image_path', 'about'])
->inRandomOrder()
->take($remainingNeeded)
->get();
Expand All @@ -216,7 +216,6 @@ public function show(string $username)
'id' => $user->id,
'name' => $user->name,
'username' => $user->username,
'title' => $user->title,
'about' => $user->about,
'institution' => $user->institution,
'image_url' => $user->image_url,
Expand Down
26 changes: 8 additions & 18 deletions resources/js/pages/User/Show.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const props = defineProps<{
id: number;
name: string;
username: string;
title: string | null;
about: string | null;
institution: string | null;
image_url: string | null;
Expand Down Expand Up @@ -156,7 +155,6 @@ const props = defineProps<{
id: number;
name: string;
username: string;
title: string | null;
institution: string | null;
image_url: string | null;
image_path: string | null;
Expand Down Expand Up @@ -270,7 +268,7 @@ const handleAppreciate = () => {
<meta
name="description"
:content="
[profileUser.title, profileUser.institution, profileUser.about]
[profileUser.institution, profileUser.about]
.filter(Boolean)
.slice(0, 2)
.join(' · ') ||
Expand All @@ -284,7 +282,7 @@ const handleAppreciate = () => {
<meta
property="og:description"
:content="
[profileUser.title, profileUser.institution, profileUser.about]
[profileUser.institution, profileUser.about]
.filter(Boolean)
.slice(0, 2)
.join(' · ') ||
Expand All @@ -305,7 +303,7 @@ const handleAppreciate = () => {
<meta
name="twitter:description"
:content="
[profileUser.title, profileUser.institution, profileUser.about]
[profileUser.institution, profileUser.about]
.filter(Boolean)
.slice(0, 2)
.join(' · ') ||
Expand Down Expand Up @@ -393,14 +391,6 @@ const handleAppreciate = () => {
profileUser.institution
}}</span>
</div>

<!-- Tagline / Title -->
<p
v-if="profileUser.title"
class="truncate text-xs font-semibold text-indigo-600 dark:text-indigo-400"
>
{{ profileUser.title }}
</p>
</div>
</div>

Expand Down Expand Up @@ -489,8 +479,8 @@ const handleAppreciate = () => {
>{{ localAppreciationsCount }}
{{
localAppreciationsCount === 1
? 'Appreciation'
: 'Appreciations'
? 'Appreciator'
: 'Appreciators'
}}</span
>
</button>
Expand Down Expand Up @@ -1103,10 +1093,10 @@ const handleAppreciate = () => {
<VerifiedBadge v-if="person.is_verified" />
</div>
<p
v-if="person.title || person.institution"
v-if="person.institution"
class="truncate text-[10px] font-medium text-slate-400 dark:text-gray-500"
>
{{ person.title || person.institution }}
{{ person.institution }}
</p>
<p
v-else
Expand Down Expand Up @@ -1198,7 +1188,7 @@ const handleAppreciate = () => {
v-else
class="py-6 text-center text-xs text-slate-400 dark:text-gray-500"
>
No appreciations yet.
No appreciators yet.
</div>
</div>
</div>
Expand Down
3 changes: 1 addition & 2 deletions resources/views/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,13 @@
$profileUser = $props['profileUser'];
$userName = data_get($profileUser, 'name');
$userHandle = data_get($profileUser, 'username');
$userTitle = data_get($profileUser, 'title');
$userInstitution = data_get($profileUser, 'institution');
$userAbout = data_get($profileUser, 'about');

$metaTitle = "{$userName} (@{$userHandle}) - " . config('app.name', 'HSCStack');
$ogTitle = "{$userName} (@{$userHandle})";

$descParts = array_filter([$userTitle, $userInstitution, $userAbout]);
$descParts = array_filter([$userInstitution, $userAbout]);
$metaDescription = !empty($descParts)
? implode(' · ', array_slice($descParts, 0, 2))
: "View {$userName}'s profile, completed study topics, and contributions on HSCStack.";
Expand Down
Loading