Merge branch 'master' into 2116-retrieve-admin-and-moderators

This commit is contained in:
Hannes Heine 2022-08-10 11:31:09 +02:00 committed by GitHub
commit e7c989da60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 12 deletions

View File

@ -13,7 +13,7 @@
</div>
</div>
<b-form ref="form" @submit.prevent="submit" class="border p-3">
<label>{{ $t('contribution.selectDate') }}</label>
<label>{{ $t('contribution.selectDate') }} {{ $t('math.asterisk') }}</label>
<b-form-datepicker
id="contribution-date"
v-model="form.date"
@ -31,33 +31,32 @@
</b-form-datepicker>
<validation-provider
:rules="{
required: true,
min: minlength,
max: maxlength,
}"
:name="$t('form.message')"
v-slot="{ errors }"
>
<label class="mt-3">{{ $t('contribution.activity') }}</label>
<label class="mt-3">{{ $t('contribution.activity') }} {{ $t('math.asterisk') }}</label>
<b-form-textarea
id="contribution-memo"
v-model="form.memo"
rows="3"
max-rows="6"
:placeholder="$t('contribution.yourActivity')"
required
></b-form-textarea>
<b-col v-if="errors">
<span v-for="error in errors" class="errors" :key="error">{{ error }}</span>
</b-col>
</validation-provider>
<label class="mt-3">{{ $t('form.amount') }}</label>
<b-input-group size="lg" prepend="GDD" append=".00">
<label class="mt-3">{{ $t('form.amount') }} {{ $t('math.asterisk') }}</label>
<b-input-group size="lg" prepend="GDD">
<b-form-input
id="contribution-amount"
v-model="form.amount"
type="number"
min="1"
:max="isThisMonth ? maxGddThisMonth : maxGddLastMonth"
type="text"
:formatter="numberFormat"
></b-form-input>
</b-input-group>
<div
@ -85,6 +84,7 @@
</b-col>
</b-row>
</b-form>
<p class="p-2">{{ $t('math.asterisk') }} {{ $t('form.mandatoryField') }}</p>
</div>
</template>
<script>
@ -103,7 +103,11 @@ export default {
}
},
methods: {
numberFormat(value) {
return value.replace(/\D/g, '')
},
submit() {
this.form.amount = this.numberFormat(this.form.amount)
if (this.form.id) {
this.$emit('update-contribution', this.form)
} else {
@ -131,8 +135,8 @@ export default {
if (
this.form.date === '' ||
this.form.memo.length < this.minlength ||
this.form.amount <= 0 ||
this.form.amount > 1000 ||
parseInt(this.form.amount) <= 0 ||
parseInt(this.form.amount) > 1000 ||
(this.isThisMonth && parseInt(this.form.amount) > parseInt(this.maxGddThisMonth)) ||
(!this.isThisMonth && parseInt(this.form.amount) > parseInt(this.maxGddLastMonth))
)

View File

@ -55,7 +55,8 @@
"selectDate": "Wann war dein Beitrag?",
"submit": "Einreichen",
"submitted": "Der Beitrag wurde eingereicht.",
"updated": "Der Beitrag wurde geändert."
"updated": "Der Beitrag wurde geändert.",
"yourActivity": "Bitte trage eine Tätigkeit ein!"
},
"contribution-link": {
"thanksYouWith": "dankt dir mit"
@ -117,6 +118,7 @@
"from": "Von",
"generate_now": "Jetzt generieren",
"lastname": "Nachname",
"mandatoryField": "Pflichtfeld",
"memo": "Nachricht",
"message": "Nachricht",
"new_balance": "Neuer Kontostand nach Bestätigung",
@ -204,6 +206,7 @@
"login": "Anmeldung",
"math": {
"aprox": "~",
"asterisk": "*",
"equal": "=",
"minus": "",
"pipe": "|"

View File

@ -55,7 +55,8 @@
"selectDate": "When was your contribution?",
"submit": "Submit",
"submitted": "The contribution was submitted.",
"updated": "The contribution was changed."
"updated": "The contribution was changed.",
"yourActivity": "Please enter an activity!"
},
"contribution-link": {
"thanksYouWith": "thanks you with"
@ -117,6 +118,7 @@
"from": "from",
"generate_now": "Generate now",
"lastname": "Lastname",
"mandatoryField": "mandatory field",
"memo": "Message",
"message": "Message",
"new_balance": "Account balance after confirmation",
@ -204,6 +206,7 @@
"login": "Login",
"math": {
"aprox": "~",
"asterisk": "*",
"equal": "=",
"minus": "",
"pipe": "|"