-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Refactor relationships #971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
89bfd2b
composer update
djaiss 2692ec5
wip
djaiss 5aa5143
wip
djaiss c0a3215
wip
djaiss f2d6ac8
wip
djaiss e28d17b
wip
djaiss 1d05bb2
wip
djaiss ea24eff
wip
djaiss 8feb259
merge master
djaiss 63b2c78
wip
djaiss a616fea
wip
djaiss e9658ef
wip
djaiss 4a772a9
wip
djaiss 3480bb3
wip
djaiss 3cb1e73
wip
djaiss cc9b3fa
wip
djaiss a167d84
Merge branch 'replace-relationships' of github.com:monicahq/monica in…
djaiss e6d6a85
wip
djaiss 1f03697
far from being over... depressing
djaiss 7fb1f20
fix stupid mistake I made while freaking tired
djaiss 4ade29d
wip
djaiss dd7622b
wip
djaiss 99f8f3a
Add better design for displaying a relationship
djaiss 4cf1c10
wip
djaiss 15bc1dd
tests
djaiss 91a6501
final test
djaiss 941f5ee
api
djaiss 1671a86
wip
djaiss f9d4595
merge master
djaiss 55aae4b
styleci
djaiss a2edbeb
styleci
djaiss 0b128cc
bump files
djaiss beb7ecc
tests
djaiss f855158
merge master
djaiss a405ea3
fix styleci
djaiss 7f5b09b
wip api
djaiss eae3fb1
wip api
djaiss 82da42a
wip
djaiss c558111
wip
djaiss 5f8a665
wip
djaiss f5e899a
wip
djaiss 2727011
wip
djaiss bf0dd02
fix tests
djaiss 91ec824
styleci
djaiss 1c63734
merge master
djaiss 1ad5764
fix bug
djaiss d7ffd47
fix test
djaiss b9ee161
remove useless test
djaiss df2e51a
Merge branch 'master' into replace-relationships
djaiss d0d5441
optimization
djaiss 66b1965
Merge branch 'master' into replace-relationships
djaiss e7a7087
fix stuff
djaiss 35020f1
Merge branch 'replace-relationships' of github.com:monicahq/monica in…
djaiss afaae90
fix dashboard
djaiss 4e49981
merge mastr
djaiss 916107c
styleci
djaiss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
wip
- Loading branch information
commit dd7622bda56b9a66c60461cb3c553fad5241dcdf
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
resources/views/people/relationship/_relationship.blade.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| @foreach ($relationships as $relationship) | ||
| <div> | ||
| <span class="silver fw3">[{{ $relationship->relationshipType->getLocalizedName(null, false, $relationship->withContact->gender->name) }}]</span> | ||
|
|
||
| {{-- NAME --}} | ||
| @if ($relationship->withContact->is_partial) | ||
| <span>{{ $relationship->withContact->getCompleteName(auth()->user()->name_order) }}</span> | ||
| @else | ||
| <a href="{{ route('people.show', $relationship->withContact) }}">{{ $relationship->withContact->getCompleteName(auth()->user()->name_order) }}</a> | ||
| @endif | ||
|
|
||
| {{-- AGE --}} | ||
| @if ($relationship->withContact->birthday_special_date_id) | ||
| @if ($relationship->withContact->birthdate->getAge()) | ||
| ({{ $relationship->withContact->birthdate->getAge() }}) | ||
| @endif | ||
| @endif | ||
|
|
||
| {{-- ACTIONS: EDIT/DELETE --}} | ||
| @if ($relationship->withContact->is_partial) | ||
| <a href="{{ route('people.relationships.edit', [$contact, $relationship->withContact]) }}" class="action-link {{ $contact->id }}-edit-relationship"> | ||
| {{ trans('app.edit') }} | ||
| </a> | ||
| <a href="#" onclick="if (confirm('{{ trans('people.relationship_delete_confirmation') }}')) { $(this).closest('.sidebar-box-paragraph').find('.entry-delete-form').submit(); } return false;" class="action-link"> | ||
| {{ trans('app.delete') }} | ||
| </a> | ||
| @else | ||
| <a href="#" onclick="if (confirm('{{ trans('people.relationship_unlink_confirmation') }}')) { $(this).closest('.sidebar-box-paragraph').find('.entry-delete-form').submit(); } return false;" class="action-link"> | ||
| {{ trans('app.delete') }} | ||
| </a> | ||
| @endif | ||
|
|
||
| <form method="POST" action="/people/{{ $contact->id }}/relationships/{{ $relationship->withContact->id }}" class="entry-delete-form hidden"> | ||
| {{ method_field('DELETE') }} | ||
| {{ csrf_field() }} | ||
| </form> | ||
| </div> | ||
| @endforeach |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| <div class="ba b--near-white br2 bg-gray-monica pa3 mb3 f6"> | ||
| <div class="w-100 dt"> | ||
| <div class="dtc"> | ||
| <h3 class="f6 ttu normal">{{ trans('app.relationship_type_group_'.auth()->user()->account->getRelationshipTypeGroupByType('love')->name) }}</h3> | ||
| </div> | ||
| </div> | ||
|
|
||
| @include('people.relationship._relationship', ['relationships' => $loveRelationships]) | ||
|
|
||
| <p class="mb0"> | ||
| <a href="/people/{{ $contact->id }}/relationships/new?type={{ $contact->account->getRelationshipTypeByType('partner')->id }}">Add</a> | ||
| </p> | ||
| </div> | ||
|
|
||
| <div class="ba b--near-white br2 bg-gray-monica pa3 mb3 f6"> | ||
| <div class="w-100 dt"> | ||
| <div class="dtc"> | ||
| <h3 class="f6 ttu normal">{{ trans('app.relationship_type_group_'.auth()->user()->account->getRelationshipTypeGroupByType('family')->name) }}</h3> | ||
| </div> | ||
| </div> | ||
|
|
||
| @include('people.relationship._relationship', ['relationships' => $familyRelationships]) | ||
|
|
||
| <p class="mb0"> | ||
| <a href="/people/{{ $contact->id }}/relationships/new?type={{ $contact->account->getRelationshipTypeByType('child')->id }}">Add</a> | ||
| </p> | ||
| </div> | ||
|
|
||
| <div class="ba b--near-white br2 bg-gray-monica pa3 mb3 f6"> | ||
| <div class="w-100 dt"> | ||
| <div class="dtc"> | ||
| <h3 class="f6 ttu normal">{{ trans('app.relationship_type_group_other') }}</h3> | ||
| </div> | ||
| </div> | ||
|
|
||
| @include('people.relationship._relationship', ['relationships' => $friendRelationships]) | ||
|
|
||
| @include('people.relationship._relationship', ['relationships' => $workRelationships]) | ||
|
|
||
| <p class="mb0"> | ||
| <a href="/people/{{ $contact->id }}/relationships/new?type={{ $contact->account->getRelationshipTypeByType('friend')->id }}">Add</a> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Add" should be localized
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well done |
||
| </p> | ||
| </div> | ||
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Add" should be localized
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done