refactor: replace custom CRM with Monica fork
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
This commit is contained in:
45
resources/views/people/relationship/_relationship.blade.php
Normal file
45
resources/views/people/relationship/_relationship.blade.php
Normal file
@@ -0,0 +1,45 @@
|
||||
@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
|
||||
158
resources/views/people/relationship/edit.blade.php
Normal file
158
resources/views/people/relationship/edit.blade.php
Normal file
@@ -0,0 +1,158 @@
|
||||
@extends('layouts.skeleton')
|
||||
|
||||
@section('content')
|
||||
|
||||
<section class="ph3 ph0-ns">
|
||||
|
||||
{{-- Breadcrumb --}}
|
||||
<div class="mt4 mw7 center mb3">
|
||||
<p><a href="{{ route('people.show', $contact) }}">< {{ $contact->name }}</a></p>
|
||||
<div class="mt4 mw7 center mb3">
|
||||
<h3 class="f3 fw5">{{ trans('people.relationship_form_edit') }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mw7 center br3 ba b--gray-monica bg-white mb6">
|
||||
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@include('partials.errors')
|
||||
|
||||
<form action="{{ route('people.relationships.update', [$contact, $relationshipId]) }}" method="POST">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
<input type="hidden" name="type" value="{{ $type }}">
|
||||
|
||||
@if ($partner->is_partial)
|
||||
{{-- Name --}}
|
||||
<div class="pa4-ns ph3 pv2 bb b--gray-monica">
|
||||
{{-- This check is for the cultures that are used to say the last name first --}}
|
||||
<div class="mb3 mb0-ns">
|
||||
@if ($formNameOrder == 'firstname')
|
||||
|
||||
<div class="dt dt--fixed">
|
||||
<div class="dtc pr2">
|
||||
<form-input
|
||||
value="{{ $partner->first_name }}"
|
||||
:input-type="'text'"
|
||||
:id="'first_name'"
|
||||
:required="true"
|
||||
:title="'{{ trans('people.people_add_firstname') }}'">
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="dtc">
|
||||
<form-input
|
||||
value="{{ $partner->last_name }}"
|
||||
:input-type="'text'"
|
||||
:id="'last_name'"
|
||||
:required="false"
|
||||
:title="'{{ trans('people.people_add_lastname') }}'">
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@else
|
||||
|
||||
<div class="dt dt--fixed">
|
||||
<div class="dtc pr2">
|
||||
<form-input
|
||||
value="{{ $partner->last_name }}"
|
||||
:input-type="'text'"
|
||||
:id="'last_name'"
|
||||
:required="false"
|
||||
:title="'{{ trans('people.people_add_lastname') }}'">
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="dtc">
|
||||
<form-input
|
||||
value="{{ $partner->first_name }}"
|
||||
:input-type="'text'"
|
||||
:id="'first_name'"
|
||||
:required="true"
|
||||
:title="'{{ trans('people.people_add_firstname') }}'">
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Gender --}}
|
||||
<div class="pa4-ns ph3 pv2 mb3 mb0-ns bb b--gray-monica">
|
||||
<form-select
|
||||
:options="{{ $genders }}"
|
||||
:required="false"
|
||||
value="{{ $partner->gender_id }}"
|
||||
:title="'{{ trans('people.people_add_gender') }}'"
|
||||
:id="'gender_id'">
|
||||
</form-select>
|
||||
</div>
|
||||
|
||||
{{-- Birthdate --}}
|
||||
<form-specialdate
|
||||
:months="{{ $months }}"
|
||||
:days="{{ $days }}"
|
||||
:month="{{ $month }}"
|
||||
:day="{{ $day }}"
|
||||
:age="{{ $age ?: 0 }}"
|
||||
:birthdate="'{{ $birthdate }}'"
|
||||
:reminder="{{ \Safe\json_encode($hasBirthdayReminder) }}"
|
||||
:value="'{{ $birthdayState }}'"
|
||||
></form-specialdate>
|
||||
|
||||
<div class="pa4-ns ph3 pv2 bb b--gray-monica">
|
||||
{{-- Real or partial contact (false in this case) --}}
|
||||
<form-checkbox
|
||||
:name="'realContact'"
|
||||
:iclass="'pa0 ma0 lh-copy'"
|
||||
:dclass="'mb3 mb0-ns flex'"
|
||||
value="1"
|
||||
:model-value="false"
|
||||
>
|
||||
<template slot="label">
|
||||
{{ trans('people.relationship_form_also_create_contact') }}
|
||||
</template>
|
||||
<span slot="extra" class="silver">
|
||||
{{ trans('people.relationship_form_add_description') }}
|
||||
</span>
|
||||
</form-checkbox>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- Nature of relationship --}}
|
||||
<div class="pa4-ns ph3 pv2 mb3 mb0-ns bb b--gray-monica">
|
||||
<form-select
|
||||
:options="{{ $relationshipTypes }}"
|
||||
value="{{ $type }}"
|
||||
:required="true"
|
||||
:title="'{{
|
||||
$partner->is_partial ?
|
||||
trans('people.relationship_form_is_with') :
|
||||
trans('people.relationship_form_is_with_name', ['name' => $partner->name])
|
||||
}}'"
|
||||
:id="'relationship_type_id'">
|
||||
</form-select>
|
||||
</div>
|
||||
|
||||
{{-- Form actions --}}
|
||||
<div class="ph4-ns ph3 pv3 bb b--gray-monica">
|
||||
<div class="flex-ns justify-between">
|
||||
<div>
|
||||
<a href="{{ route ('people.show', $contact) }}" class="btn btn-secondary w-auto-ns w-100 mb2 pb0-ns">{{ trans('app.cancel') }}</a>
|
||||
</div>
|
||||
<div>
|
||||
<button class="btn btn-primary w-auto-ns w-100 mb2 pb0-ns" v-if="global_relationship_form_new_contact" name="save" type="submit">{{ trans('app.save') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@endsection
|
||||
43
resources/views/people/relationship/index.blade.php
Normal file
43
resources/views/people/relationship/index.blade.php
Normal file
@@ -0,0 +1,43 @@
|
||||
@if ($modules->contains('key', 'love_relationships'))
|
||||
<div class="sidebar-box">
|
||||
<div class="sidebar-box-title">
|
||||
<h3>{{ trans('app.relationship_type_group_love') }}</h3>
|
||||
</div>
|
||||
|
||||
@include('people.relationship._relationship', ['relationships' => $loveRelationships])
|
||||
|
||||
<p class="mb0 bt b--near-white f6">
|
||||
<a href="{{ route('people.relationships.create', $contact) }}?type={{ $contact->account->getRelationshipTypeByType('partner')->id }}">{{ trans('app.add') }}</a>
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($modules->contains('key', 'family_relationships'))
|
||||
<div class="sidebar-box">
|
||||
<div class="sidebar-box-title">
|
||||
<h3>{{ trans('app.relationship_type_group_family') }}</h3>
|
||||
</div>
|
||||
|
||||
@include('people.relationship._relationship', ['relationships' => $familyRelationships])
|
||||
|
||||
<p class="mb0 bt b--near-white f6">
|
||||
<a href="{{ route('people.relationships.create', $contact) }}?type={{ $contact->account->getRelationshipTypeByType('child')->id }}">{{ trans('app.add') }}</a>
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($modules->contains('key', 'other_relationships'))
|
||||
<div class="sidebar-box f6">
|
||||
<div class="sidebar-box-title">
|
||||
<h3>{{ trans('app.relationship_type_group_other') }}</h3>
|
||||
</div>
|
||||
|
||||
@include('people.relationship._relationship', ['relationships' => $friendRelationships])
|
||||
|
||||
@include('people.relationship._relationship', ['relationships' => $workRelationships])
|
||||
|
||||
<p class="mb0 bt b--near-white f6">
|
||||
<a href="{{ route('people.relationships.create', $contact) }}?type={{ $contact->account->getRelationshipTypeByType('friend')->id }}">{{ trans('app.add') }}</a>
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
187
resources/views/people/relationship/new.blade.php
Normal file
187
resources/views/people/relationship/new.blade.php
Normal file
@@ -0,0 +1,187 @@
|
||||
@extends('layouts.skeleton')
|
||||
|
||||
@section('content')
|
||||
|
||||
<section class="ph3 ph0-ns">
|
||||
|
||||
{{-- Breadcrumb --}}
|
||||
<div class="mt4 mw7 center mb3">
|
||||
<p><a href="{{ route('people.show', $contact) }}">< {{ $contact->name }}</a></p>
|
||||
<div class="mt4 mw7 center mb3">
|
||||
<h3 class="f3 fw5">{{ trans('people.relationship_form_add') }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mw7 center br3 ba b--gray-monica bg-white mb6">
|
||||
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@include('partials.errors')
|
||||
|
||||
<form action="{{ route('people.relationships.store', $contact) }}" method="POST">
|
||||
@csrf
|
||||
|
||||
{{-- New contact / link existing --}}
|
||||
<div class="pa4-ns ph3 pv2 mb3 mb0-ns bb b--gray-monica">
|
||||
<p class="mb2 b">{{ trans('people.relationship_form_add_choice') }}</p>
|
||||
<div class="dt dt--fixed">
|
||||
<div class="dtc pr2">
|
||||
<input type="radio" id="new" name="relationship_type" value="new" @click="global_relationship_form_new_contact = true" checked>
|
||||
<label for="new" class="pointer">{{ trans('people.relationship_form_create_contact') }}</label>
|
||||
</div>
|
||||
<div class="dtc">
|
||||
<input type="radio" id="existing" name="relationship_type" value="existing" @click="global_relationship_form_new_contact = false">
|
||||
<label for="existing" class="pointer">{{ trans('people.relationship_form_associate_contact') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="global_relationship_form_new_contact">
|
||||
{{-- Name --}}
|
||||
<div class="pa4-ns ph3 pv2 bb b--gray-monica">
|
||||
{{-- This check is for the cultures that are used to say the last name first --}}
|
||||
<div class="mb3 mb0-ns">
|
||||
@if ($formNameOrder == 'firstname')
|
||||
|
||||
<div class="dt dt--fixed">
|
||||
<div class="dtc pr2">
|
||||
<form-input
|
||||
value=""
|
||||
:input-type="'text'"
|
||||
:id="'first_name'"
|
||||
:required="true"
|
||||
:title="'{{ trans('people.people_add_firstname') }}'">
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="dtc">
|
||||
<form-input
|
||||
value=""
|
||||
:input-type="'text'"
|
||||
:id="'last_name'"
|
||||
:required="false"
|
||||
:title="'{{ trans('people.people_add_lastname') }}'">
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@else
|
||||
|
||||
<div class="dt dt--fixed">
|
||||
<div class="dtc pr2">
|
||||
<form-input
|
||||
value=""
|
||||
:input-type="'text'"
|
||||
:id="'last_name'"
|
||||
:required="false"
|
||||
:title="'{{ trans('people.people_add_lastname') }}'">
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="dtc">
|
||||
<form-input
|
||||
value=""
|
||||
:input-type="'text'"
|
||||
:id="'first_name'"
|
||||
:required="true"
|
||||
:title="'{{ trans('people.people_add_firstname') }}'">
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Gender --}}
|
||||
<div class="pa4-ns ph3 pv2 mb3 mb0-ns bb b--gray-monica">
|
||||
<form-select
|
||||
:options="{{ $genders }}"
|
||||
:required="false"
|
||||
:title="'{{ trans('people.people_add_gender') }}'"
|
||||
:id="'gender_id'"
|
||||
:value="'{{ $defaultGender }}'">
|
||||
</form-select>
|
||||
</div>
|
||||
|
||||
{{-- Birthdate --}}
|
||||
<form-specialdate
|
||||
:months="{{ $months }}"
|
||||
:days="{{ $days }}"
|
||||
:birthdate="'{{ $birthdate }}'"
|
||||
></form-specialdate>
|
||||
|
||||
<div class="pa4-ns ph3 pv2 bb b--gray-monica">
|
||||
{{-- Real or partial contact (default true) --}}
|
||||
<form-checkbox
|
||||
:name="'realContact'"
|
||||
:iclass="'pa0 ma0 lh-copy'"
|
||||
:dclass="'mb3 mb0-ns flex'"
|
||||
value="1"
|
||||
:model-value="true"
|
||||
>
|
||||
<template slot="label">
|
||||
{{ trans('people.relationship_form_also_create_contact') }}
|
||||
</template>
|
||||
<span slot="extra" class="silver">
|
||||
{{ trans('people.relationship_form_add_description') }}
|
||||
</span>
|
||||
</form-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="!global_relationship_form_new_contact">
|
||||
<div class="pa4-ns ph3 pv2 mb3 mb0-ns bb b--gray-monica">
|
||||
@if ($existingContacts->count() == 0)
|
||||
<div class="mb1 mt2 tc">
|
||||
<img src="img/people/no_record_found.svg">
|
||||
<p>{{ trans('people.relationship_form_add_no_existing_contact', ['name' => $contact->first_name]) }}</p>
|
||||
</div>
|
||||
@else
|
||||
<contact-select
|
||||
:required="true"
|
||||
:title="'{{ trans('people.relationship_form_associate_dropdown') }}'"
|
||||
:name="'existing_contact_id'"
|
||||
:placeholder="'{{ trans('people.relationship_form_associate_dropdown_placeholder') }}'"
|
||||
:default-options="{{ \Safe\json_encode($existingContacts) }}"
|
||||
:user-contact-id="{{ $contact->id }}">
|
||||
</contact-select>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Nature of relationship --}}
|
||||
<div class="pa4-ns ph3 pv2 mb3 mb0-ns bb b--gray-monica">
|
||||
<form-select
|
||||
:options="{{ $relationshipTypes }}"
|
||||
value="{{ $type }}"
|
||||
:required="true"
|
||||
:title="'{{ trans('people.relationship_form_is_with') }}'"
|
||||
:id="'relationship_type_id'">
|
||||
</form-select>
|
||||
</div>
|
||||
|
||||
{{-- Form actions --}}
|
||||
<div class="ph4-ns ph3 pv3 bb b--gray-monica">
|
||||
<div class="flex-ns justify-between">
|
||||
<div>
|
||||
<a href="{{ route('people.show', $contact) }}" class="btn btn-secondary w-auto-ns w-100 mb2 pb0-ns" style="text-align: center;">{{ trans('app.cancel') }}</a>
|
||||
</div>
|
||||
<div>
|
||||
@if ($existingContacts->count() == 0)
|
||||
<button class="btn btn-primary w-auto-ns w-100 mb2 pb0-ns" disabled v-if="!global_relationship_form_new_contact" name="save" type="submit">{{ trans('app.add') }}</button>
|
||||
<button class="btn btn-primary w-auto-ns w-100 mb2 pb0-ns" v-if="global_relationship_form_new_contact" name="save" type="submit">{{ trans('app.add') }}</button>
|
||||
@else
|
||||
<button class="btn btn-primary w-auto-ns w-100 mb2 pb0-ns" name="save" type="submit">{{ trans('app.add') }}</button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@endsection
|
||||
Reference in New Issue
Block a user