Skip to content
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

feat: add ability to attach dates to gifts #4909

Merged
merged 7 commits into from
Mar 21, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion public/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/langs/en.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/vendor.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"/js/manifest.js": "/js/manifest.js?id=7db827d654313dce4250",
"/js/vendor.js": "/js/vendor.js?id=226c1bfee3b4cb398741",
"/js/app.js": "/js/app.js?id=d50cd08fa76231e8e22d",
"/js/vendor.js": "/js/vendor.js?id=c8f6bd93750faaa40b72",
"/js/app.js": "/js/app.js?id=45cda3b1deb3239071bf",
"/css/app-ltr.css": "/css/app-ltr.css?id=c060239b19c6a9f55d0d",
"/css/app-rtl.css": "/css/app-rtl.css?id=dba410c268f83eab2638",
"/css/stripe.css": "/css/stripe.css?id=04066fb482310d18299c",
Expand Down
19 changes: 19 additions & 0 deletions resources/js/components/people/gifts/CreateGift.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@
<li v-if="!reachLimit" v-show="!displayUpload" class="di pointer" :class="dirltr ? 'mr3' : 'ml3'">
<a href="" @click.prevent="() => { displayUpload = true; $refs.upload.showUploadZone(); }">{{ $t('people.gifts_add_photo') }}</a>
</li>
<li v-show="!displayDate" class="di pointer" :class="dirltr ? 'mr3' : 'ml3'">
<a href="" @click.prevent="displayDate = true">{{ $t('people.gifts_add_date') }}</a>
</li>
</ul>
</div>

Expand Down Expand Up @@ -109,6 +112,19 @@
/>
</div>

<div v-if="displayDate" class="dt dt--fixed pb3 mb3 bb b--gray-monica">
<!-- Date -->
<form-date
:id="'date'"
v-model="newGift.date"
:show-calendar-on-focus="true"
:locale="locale"
:class="[ dirltr ? 'fl dtc pr2' : 'fr dtc pr2' ]"
:label="$t('people.gifts_add_date')"
@submit="store"
/>
</div>

<div v-if="displayAmount" class="dt dt--fixed pb3 mb3 bb b--gray-monica">
<!-- AMOUNT -->
<form-input
Expand Down Expand Up @@ -252,6 +268,7 @@ export default {
displayAmount: false,
displayRecipient: false,
displayUpload: false,
displayDate: false,
newGift: {
name: '',
status: 'idea',
Expand Down Expand Up @@ -301,6 +318,7 @@ export default {
return !this.displayComment ||
!this.displayUrl ||
!this.displayAmount ||
!this.displayDate ||
!(this.displayRecipient || this.familyContacts.length == 0) ||
!(this.displayUpload || this.reachLimit);
}
Expand Down Expand Up @@ -341,6 +359,7 @@ export default {
this.hasRecipient = false;
}
this.displayComment = this.gift ? this.gift.comment : false;
this.displayDate = this.gift ? this.gift.date : false;
this.displayUrl = this.gift ? this.gift.url : false;
this.displayAmount = this.gift ? this.gift.amount != '' : false;
this.displayRecipient = this.gift ? (this.gift.recipient ? this.gift.recipient.id !== 0 : false) : false;
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en/people.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@
'gifts_view_comment' => 'View comment',
'gifts_mark_offered' => 'Mark as given',
'gifts_update_success' => 'The gift has been updated successfully',
'gifts_add_date' => 'Date (optional)',

// debts
'debt_delete_confirmation' => 'Are you sure you want to delete this debt?',
Expand Down