Files
CRM/resources/views/people/relationship/_relationship.blade.php
Kroonk a213a1dba0
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
refactor: replace custom CRM with Monica fork
2026-05-22 16:19:55 +02:00

46 lines
1.8 KiB
PHP

@foreach($relationships->groupByItemsProperty('relationshipTypeLocalized') as $type => $relationshipType)
<div class="sidebar-box-title">
<h3>{{ $type }}</h3>
</div>
@foreach ($relationshipType as $relationship)
@if (! $relationship->ofContact)
@continue
@endif
<div class="sidebar-box-paragraph">
{{-- NAME --}}
@if ($relationship->ofContact->is_partial)
<span class="{{ htmldir() == 'ltr' ? '' : 'fr' }}">{{ $relationship->ofContact->name }}</span>
@else
<a class="{{ htmldir() == 'ltr' ? '' : 'fr' }}" href="{{ route('people.show', $relationship->ofContact) }}">{{ $relationship->ofContact->name }}</a>
@endif
{{-- AGE --}}
@if ($relationship->ofContact->is_dead)
@if ($relationship->ofContact->deceasedDate)
<span class="{{ htmldir() == 'ltr' ? '' : 'fr' }}">({{ $relationship->ofContact->getAgeAtDeath() }})</span>
@endif
@elseif ($relationship->ofContact->birthday_special_date_id)
@if ($relationship->ofContact->birthdate->getAge())
<span class="{{ htmldir() == 'ltr' ? '' : 'fr' }}">({{ $relationship->ofContact->birthdate->getAge() }})</span>
@endif
@endif
<div class="db mt1">
{{-- ACTIONS: EDIT/DELETE --}}
<a href="{{ route('people.relationships.edit', [$contact, $relationship]) }}" class="action-link {{ $contact->hashID() }}-edit-relationship">{{ trans('app.edit') }}</a>
<form method="POST" action="{{ route('people.relationships.destroy', [$contact, $relationship]) }}" class="di">
@method('DELETE')
@csrf
<confirm message="{{ trans('people.relationship_unlink_confirmation') }}" link-class="action-link">
{{ trans('app.delete') }}
</confirm>
</form>
</div>
</div>
<div class="cb"></div>
@endforeach
@endforeach