From 295dbff4f8b4d6411bbc3d788fdd39cafe1c074d Mon Sep 17 00:00:00 2001 From: ogerly Date: Tue, 24 Jan 2023 16:51:56 +0100 Subject: [PATCH 01/35] show info if no open contribution for selected date --- .../Contributions/ContributionForm.vue | 123 +++++++++++------- frontend/src/locales/de.json | 5 + frontend/src/locales/en.json | 5 + frontend/src/pages/Community.vue | 51 +++++--- 4 files changed, 120 insertions(+), 64 deletions(-) diff --git a/frontend/src/components/Contributions/ContributionForm.vue b/frontend/src/components/Contributions/ContributionForm.vue index bdd25f23c..9a2ffb54b 100644 --- a/frontend/src/components/Contributions/ContributionForm.vue +++ b/frontend/src/components/Contributions/ContributionForm.vue @@ -3,7 +3,7 @@ - - - +
+ {{ noOpenCreation }} +
+
+ + + - - - - {{ $t('form.cancel') }} - - - - - {{ form.id ? $t('form.change') : $t('contribution.submit') }} - - - + + + + {{ $t('form.cancel') }} + + + + + {{ form.id ? $t('form.change') : $t('contribution.submit') }} + + + +
@@ -133,6 +153,18 @@ export default { validMaxTime() { return Number(this.validMaxGDD / 20) }, + noOpenCreation() { + if (this.maxGddThisMonth <= 0 && this.maxGddLastMonth <= 0) { + return this.$t('contribution.noOpenCreation.allMonth') + } + if (this.isThisMonth && this.maxGddThisMonth <= 0) { + return this.$t('contribution.noOpenCreation.thisMonth') + } + if (!this.isThisMonth && this.maxGddLastMonth <= 0) { + return this.$t('contribution.noOpenCreation.lastMonth') + } + return '' + }, }, watch: { value() { @@ -142,6 +174,9 @@ export default { }