Skip to content

Commit

Permalink
fix entity request without entity bug
Browse files Browse the repository at this point in the history
  • Loading branch information
temaotl committed Jul 23, 2024
1 parent f0dfe3a commit aa9bcb4
Showing 1 changed file with 28 additions and 25 deletions.
53 changes: 28 additions & 25 deletions resources/views/federations/requests.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,35 @@
@include('federations.navigation')

@forelse ($joins as $join)
<div class="sm:rounded-lg mb-4 overflow-hidden bg-white shadow">
<div>
<dl>
<div class="bg-gray-50 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 px-4 py-5">
<dt class="text-sm text-gray-500">{{ __('common.entity') }}</dt>
<dd><a class="hover:underline text-blue-500"
href="{{ route('entities.show', $join->entity) }}">{{ $join->entity->{"name_$locale"} ?? $join->entity->entityid }}</a>
</dd>
</div>
<div class="sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 px-4 py-5 bg-white">
<dt class="text-sm text-gray-500">{{ __('common.requester') }}</dt>
<dd><a class="hover:underline text-blue-500"
href="{{ route('users.show', $join->requested_by) }}">{{ $join->requester->name }}</a>
</dd>
</div>
<div class="bg-gray-50 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 px-4 py-5">
<dt class="text-sm text-gray-500">{{ __('common.explanation') }}</dt>
<dd>{{ $join->explanation }}</dd>
</div>
</dl>
@if($join->entity)
<div class="sm:rounded-lg mb-4 overflow-hidden bg-white shadow">
<div>
<dl>
<div class="bg-gray-50 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 px-4 py-5">
<dt class="text-sm text-gray-500">{{ __('common.entity') }}</dt>
<dd><a class="hover:underline text-blue-500"
href="{{ route('entities.show', $join->entity) }}">{{ $join->entity->{"name_$locale"} ?? $join->entity->entityid }}</a>
</dd>
</div>
<div class="sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 px-4 py-5 bg-white">
<dt class="text-sm text-gray-500">{{ __('common.requester') }}</dt>
<dd><a class="hover:underline text-blue-500"
href="{{ route('users.show', $join->requested_by) }}">{{ $join->requester->name }}</a>
</dd>
</div>
<div class="bg-gray-50 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 px-4 py-5">
<dt class="text-sm text-gray-500">{{ __('common.explanation') }}</dt>
<dd>{{ $join->explanation }}</dd>
</div>
</dl>
</div>
<div class="px-6 py-3 bg-gray-100">
<x-forms.membership-reject :membership="$join" />
<x-forms.membership-accept :membership="$join" />
</div>
</div>
<div class="px-6 py-3 bg-gray-100">
<x-forms.membership-reject :membership="$join" />
<x-forms.membership-accept :membership="$join" />
</div>
</div>
@endif

@empty
{{ __('common.no_requests') }}
@endforelse
Expand Down

0 comments on commit aa9bcb4

Please sign in to comment.