Skip to content

Commit 03a1e37

Browse files
feature: display scope profile in scopes view (#709)
* feature: display scope profile in scopes view * styleci
1 parent e701e79 commit 03a1e37

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

src/Http/Controllers/Profile/ProfileController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ public function getCharacterScopes(int $user_id, int $character_id)
8484
->where('user_id', $user_id)
8585
->first();
8686

87-
return view('web::profile.modals.scopes.content', ['scopes' => $token->scopes]);
87+
$profile_name = collect(setting('sso_scopes'))->where('id', $token->scopes_profile)->first()->name ?? null;
88+
89+
return view('web::profile.modals.scopes.content', ['scopes' => $token->scopes, 'profile_name' => $profile_name]);
8890
}
8991

9092
/**

src/resources/lang/de/seat.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@
704704
'user_sharelink' => 'User Sharing',
705705
'user_sharelink_description' => 'You can generate a sharing link that can be shared with other SeAT users to allow them to view your linked characters information.',
706706
'user_sharelink_generate' => 'Generate Link',
707+
'unknown_scopes_profile' => 'Unbekannt (SSO-Scope-Profil nicht gefunden)',
708+
'scopes_profile' => 'SSO-Scope-Profil',
707709

708710
// Queue
709711
'queue_manage' => 'Warteschlange Verwaltung',

src/resources/lang/en/seat.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,8 @@
717717
'user_sharelink' => 'User Sharing',
718718
'user_sharelink_description' => 'You can generate a sharing link that can be shared with other SeAT users to allow them to view your linked characters information.',
719719
'user_sharelink_generate' => 'Generate Link',
720+
'unknown_scopes_profile' => 'Unknown (Profile not found)',
721+
'scopes_profile' => 'Scopes Profile',
720722

721723
// Queue
722724
'queue_manage' => 'Queue Management',

src/resources/views/profile/modals/scopes/content.blade.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,15 @@
77
@endforeach
88
</tbody>
99
</table>
10+
<p>
11+
<b>{{ trans("web::seat.scopes_profile") }}</b>:
12+
@if($profile_name !== null)
13+
<span class="text-success">
14+
{{ $profile_name }}
15+
</span>
16+
@else
17+
<span class="text-danger">
18+
{{ trans("web::seat.unknown_scopes_profile") }}
19+
</span>
20+
@endif
21+
</p>

0 commit comments

Comments
 (0)