ref #78
This commit is contained in:
Nicolai Ort 2021-02-20 19:13:33 +01:00
parent cb704c4551
commit 19393006ef
6 changed files with 39 additions and 25 deletions

View File

@ -75,7 +75,7 @@
if (processed_last_submit === true) {
processed_last_submit = false;
const toast = Toastify({
text: "Donor is being added...",
text: $_('donor-is-being-added'),
duration: -1,
}).showToast();
let address = {};
@ -92,6 +92,7 @@
firstname: firstname_input_value,
lastname: lastname_input_value,
address,
receiptNeeded: address_checked
};
if (middlename_input_value) {
postdata.middlename = middlename_input_value;
@ -111,7 +112,7 @@
modal_open = false;
//
Toastify({
text: "Donor added",
text: $_('donor-added'),
duration: 500,
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
}).showToast();
@ -169,11 +170,11 @@
</div>
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left">
<h3 class="text-lg leading-6 font-medium text-gray-900">
Create a new donor
{$_('create-a-new-donor')}
</h3>
<div class="mt-2 mb-6">
<p class="text-sm text-gray-500">
Please provide the nessecary information to add a new donor
{$_('please-provide-the-nessecary-information-to-add-a-new-donor')}
</p>
</div>
<div class="grid grid-cols-6 gap-6">
@ -291,7 +292,7 @@
<div class="ml-3 text-sm">
<label
for="comments"
class="font-medium text-gray-700">Receipt needed (address)</label>
class="font-medium text-gray-700">{$_('receipt-needed')}</label>
</div>
</div>
{#if address_checked === true}

View File

@ -70,15 +70,11 @@
</h3>
<div class="mt-2 mb-6">
<p class="text-sm text-gray-500">
<!-- {$_(
'do-you-want-to-delete-the-organization-delete_org-name',
{
values: { orgname: delete_donor.name },
}
)}-->
Do you want to delete this donor with all related donations?
{$_(
'do-you-want-to-delete-this-donor-with-all-related-donations'
)}
<br />
All associated donations will get deleted as well
{$_('all-associated-donations-will-get-deleted-as-well')}
</p>
</div>
</div>
@ -89,13 +85,13 @@
on:click={deleteDonor}
type="button"
class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">
Confirm, delete donor with all donations
{$_('confirm-delete-donor-with-all-donations')}
</button>
<button
on:click={cancelDelete}
type="button"
class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm">
Cancel, keep donor
{$_('cancel-keep-donor')}
</button>
</div>
</div>

View File

@ -59,7 +59,7 @@
function submit() {
if (data_loaded === true && save_enabled) {
Toastify({
text: "donor is being updated",
text: $_('donor-is-being-updated'),
duration: 2500,
}).showToast();
editable.address.country = "DE";
@ -74,7 +74,7 @@
Object.assign(original_data, editable);
original_data=original_data;
Toastify({
text: "updated donor",
text: $_('updated-donor'),
duration: 2500,
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
}).showToast();
@ -90,7 +90,7 @@
)
.then((resp) => {
Toastify({
text: "donor deleted",
text: $_('donor-deleted'),
duration: 500,
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
}).showToast();
@ -105,7 +105,7 @@
<ConfirmDonorDeletion bind:modal_open bind:delete_donor />
{#await promise}
Loading donor details
{$_('loading-donor-details')}
{:then}
<section class="container p-5 select-none">
<div class="flex flex-row mb-4">
@ -123,7 +123,7 @@
d="M2 22a8 8 0 1 1 16 0H2zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6 6 2.685 6 6-2.685 6-6 6zm10 4h4v2h-4v-2zm-3-5h7v2h-7v-2zm2-5h5v2h-5V7z" /></svg>
</li>
<li class="flex items-center ml-2">
<a class="mr-2" href="./">Donors</a><svg
<a class="mr-2" href="./">{$_('donors')}</a><svg
stroke="currentColor"
fill="none"
stroke-width="2"
@ -171,7 +171,7 @@
delete_triggered = true;
}}
type="button"
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">delete donor</button>
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">{$_('delete-donor')}</button>
{/if}
{/if}
{#if !delete_triggered}

View File

@ -6,7 +6,7 @@
<div class="text-center items-center justify-center">
<p class="mb-16 text-lg text-gray-500">
<img class="w-full h-44" src={donors_empty} alt="" />
<span class="font-bold">there are no donors yet</span><br />
<span>add your first donor</span>
<span class="font-bold">{$_('there-are-no-donors-yet')}</span><br />
<span>{$_('add-your-first-donor')}</span>
</p>
</div>

View File

@ -33,7 +33,7 @@
<div
class="bg-teal-lightest border-t-4 border-teal rounded-b text-teal-darkest px-4 py-3 shadow-md my-2"
role="alert">
<p class="font-bold">donors are being loaded</p>
<p class="font-bold">{$_('donors-are-being-loaded')}</p>
<p class="text-sm">{$_('this-might-take-a-moment')}</p>
</div>
{:then}

View File

@ -251,5 +251,22 @@
"donors": "donors",
"add-donor": "add donor",
"donations": "donations",
"total-donation-amount": "total donation amount"
"total-donation-amount": "total donation amount",
"donor-is-being-added": "Donor is being added...",
"donor-added": "Donor added",
"create-a-new-donor": "Create a new donor",
"please-provide-the-nessecary-information-to-add-a-new-donor": "Please provide the nessecary information to add a new donor",
"receipt-needed": "Receipt needed",
"do-you-want-to-delete-this-donor-with-all-related-donations": "Do you want to delete this donor with all related donations",
"all-associated-donations-will-get-deleted-as-well": "All associated donations will get deleted as well",
"confirm-delete-donor-with-all-donations": "Confirm, delete donor with all donations",
"cancel-keep-donor": "Cancel, keep donor",
"donor-is-being-updated": "donor is being updated",
"updated-donor": "updated donor",
"donor-deleted": "donor deleted",
"loading-donor-details": "Loading donor details",
"delete-donor": "Delete donor",
"there-are-no-donors-yet": "there are no donors yet",
"add-your-first-donor": "add your first donor",
"donors-are-being-loaded": "donors are being loaded"
}