Skip to content

Commit

Permalink
Merge pull request #41 from beabee-communityrm/feat/newsletter-group-…
Browse files Browse the repository at this point in the history
…settings

feat: add groups to membership builder
  • Loading branch information
wpf500 authored Aug 2, 2024
2 parents c6e47b4 + 2c946f3 commit 425cd67
Show file tree
Hide file tree
Showing 12 changed files with 200 additions and 72 deletions.
20 changes: 17 additions & 3 deletions apps/frontend/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,10 @@
"none": "None"
},
"hello": "Hallo",
"id": "ID",
"itemsPerPage": "{items} Einträge pro Seite",
"joined": "Mitglied seit",
"label": "Label",
"loading": "Lädt...",
"login": "Login",
"newsletterStatus": {
Expand Down Expand Up @@ -657,7 +659,7 @@
"membershipExpires": "Mitglied bis",
"membershipStarts": "Mitglied seit",
"name": "Name",
"newsletterGroups": "Newsletter-Gruppe",
"newsletterGroups": "Newsletter groups",
"newsletterStatus": "Newsletter-Status",
"notes": "Notizen",
"payingFee": "Übernimmt Transaktionskosten?",
Expand Down Expand Up @@ -1169,6 +1171,10 @@
"membershipBuilder": {
"steps": {
"accountConfirmation": {
"deliveryAddress": {
"showOptIn": "Nach Adresse fragen",
"title": "Adresse"
},
"description": "Stelle ein, welche persönlichen Informationen Du über deine Mitglieder sammeln willst.",
"joinSurvey": {
"required": "Die Mitglieder müssen den Fragebogen ausfüllen, ehe sie fortfahren können.",
Expand All @@ -1178,11 +1184,19 @@
"textIntro": "Erkläre deinen Mitgliedern kurz, warum du weitere Informationen von ihnen haben möchtest.",
"title": "Anmelde-Fragebogen"
},
"newsletter": {
"groups": {
"add": "Neue Gruppe hinzufügen",
"help": "<p>Du kannst Nutzer entscheiden lassen, welche Newsletter-Gruppe sie abonnieren möchten. Die Gruppen müssen zuvor in Mailchimp eingerichtet werden. Wende dich an <a href=\"mailto:support{'@'}beabee.io\">support{'@'}beabee.io</a>, wenn du dabei Hilfe benötigst.</p>\n",
"title": "Newsletter-Gruppe"
},
"optInDisabled": "Der Text wird nicht genutzt, wenn die Newsletter-Gruppen sichtbar sind.",
"showOptIn": "Nach Newsletterabonnement fragen",
"title": "Newsletter"
},
"optInLabel": "Beschriftung Kontrollkästchen ",
"optInText": "Text",
"optInTitle": "Überschrift",
"showMailOptIn": "Nach Adresse fragen",
"showNewsletterOptIn": "Nach Newsletterabonnement fragen",
"text": "Neue Mitglieder müssen ihre Registrierung in folgendem Bildschirm bestätigen. Außerdem werden hier persönliche Informationen abgefragt.",
"title": "Persönliche Informationen abfragen",
"welcomeMessage": "Willkommensnachricht"
Expand Down
6 changes: 5 additions & 1 deletion apps/frontend/locales/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,11 @@
"membershipBuilder": {
"steps": {
"accountConfirmation": {
"joinSurvey": {}
"deliveryAddress": {},
"joinSurvey": {},
"newsletter": {
"groups": {}
}
},
"emails": {},
"intro": {},
Expand Down
18 changes: 16 additions & 2 deletions apps/frontend/locales/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,10 @@
"none": "None"
},
"hello": "Hallo",
"id": "ID",
"itemsPerPage": "{items} Einträge pro Seite",
"joined": "Mitglied seit",
"label": "Label",
"loading": "Lädt...",
"login": "Login",
"newsletterStatus": {
Expand Down Expand Up @@ -1169,6 +1171,10 @@
"membershipBuilder": {
"steps": {
"accountConfirmation": {
"deliveryAddress": {
"showOptIn": "Nach Adresse fragen",
"title": "Adresse"
},
"description": "Stelle ein, welche persönlichen Informationen Du über deine Mitglieder sammeln willst.",
"joinSurvey": {
"required": "Die Mitglieder müssen den Fragebogen ausfüllen, ehe sie fortfahren können.",
Expand All @@ -1178,11 +1184,19 @@
"textIntro": "Erkläre deinen Mitgliedern kurz, warum du weitere Informationen von ihnen haben möchtest.",
"title": "Anmelde-Fragebogen"
},
"newsletter": {
"groups": {
"add": "Neue Gruppe hinzufügen",
"help": "<p>Du kannst Nutzer entscheiden lassen, welche Newsletter-Gruppe sie abonnieren möchten. Die Gruppen müssen zuvor in Mailchimp eingerichtet werden. Wende dich an <a href=\"mailto:support{'@'}beabee.io\">support{'@'}beabee.io</a>, wenn du dabei Hilfe benötigst.</p>\n",
"title": "Newsletter-Gruppe"
},
"optInDisabled": "Der Text wird nicht genutzt, wenn die Newsletter-Gruppen sichtbar sind.",
"showOptIn": "Nach Newsletterabonnement fragen",
"title": "Newsletter"
},
"optInLabel": "Beschriftung Kontrollkästchen ",
"optInText": "Text",
"optInTitle": "Überschrift",
"showMailOptIn": "Nach Adresse fragen",
"showNewsletterOptIn": "Nach Newsletterabonnement fragen",
"text": "Neue Mitglieder müssen ihre Registrierung in folgendem Bildschirm bestätigen. Außerdem werden hier persönliche Informationen abgefragt.",
"title": "Persönliche Informationen abfragen",
"welcomeMessage": "Willkommensnachricht"
Expand Down
18 changes: 16 additions & 2 deletions apps/frontend/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,10 @@
"none": "None"
},
"hello": "Hello",
"id": "ID",
"itemsPerPage": "{items} items per page",
"joined": "Joined",
"label": "Label",
"loading": "Loading...",
"login": "Login",
"newsletterStatus": {
Expand Down Expand Up @@ -1175,6 +1177,10 @@
"membershipBuilder": {
"steps": {
"accountConfirmation": {
"deliveryAddress": {
"showOptIn": "Ask for postal address",
"title": "Postal address"
},
"description": "Compose your confirmation screen",
"joinSurvey": {
"required": "Users must complete the survey before proceeding",
Expand All @@ -1184,11 +1190,19 @@
"textIntro": "Tell your users a bit about why you are asking for this information",
"title": "Join survey"
},
"newsletter": {
"groups": {
"add": "Add new group",
"help": "<p>You can let users choose which newsletter groups they want to join. These groups must already be configured in Mailchimp, contact <a href=\"mailto:support{'@'}beabee.io\">support{'@'}beabee.io</a> if you are unsure how to use this feature.</p>\n",
"title": "Newsletter groups"
},
"optInDisabled": "The label is not used when newsletter groups are visible",
"showOptIn": "Ask to subscribe to newsletter",
"title": "Newsletter"
},
"optInLabel": "Checkbox label",
"optInText": "Text",
"optInTitle": "Heading",
"showMailOptIn": "Ask for postal address",
"showNewsletterOptIn": "Ask to subscribe to newsletter",
"text": "After joining, users will be asked to confirm their registration. Here you can set the details of the confirmation screen.",
"title": "Account confirmation",
"welcomeMessage": "Welcome message"
Expand Down
8 changes: 7 additions & 1 deletion apps/frontend/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
"none": "Nessuno"
},
"hello": "Ciao",
"id": "ID",
"joined": "Iscritto",
"loading": "Caricamento...",
"login": "Login",
Expand Down Expand Up @@ -439,7 +440,12 @@
"membershipBuilder": {
"steps": {
"accountConfirmation": {
"joinSurvey": {}
"deliveryAddress": {},
"joinSurvey": {},
"newsletter": {
"groups": {},
"title": "Newsletter"
}
},
"emails": {},
"intro": {},
Expand Down
8 changes: 7 additions & 1 deletion apps/frontend/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@
"contributionPeriod": {},
"contributionType": {},
"hello": "Hallo",
"id": "ID",
"label": "Label",
"loading": "Ladt...",
"newsletterStatus": {},
"noResults": "Geen resultaten gevonden",
Expand Down Expand Up @@ -356,7 +358,11 @@
"membershipBuilder": {
"steps": {
"accountConfirmation": {
"joinSurvey": {}
"deliveryAddress": {},
"joinSurvey": {},
"newsletter": {
"groups": {}
}
},
"emails": {},
"intro": {},
Expand Down
9 changes: 8 additions & 1 deletion apps/frontend/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,10 @@
"none": "Nenhuma"
},
"hello": "Olá",
"id": "ID",
"itemsPerPage": "{items} itens por página",
"joined": "Juntaste-te",
"label": "Label",
"loading": "A carregar...",
"login": "Login",
"newsletterStatus": {
Expand Down Expand Up @@ -773,7 +775,12 @@
"membershipBuilder": {
"steps": {
"accountConfirmation": {
"joinSurvey": {}
"deliveryAddress": {},
"joinSurvey": {},
"newsletter": {
"groups": {},
"title": "Newsletter"
}
},
"emails": {},
"intro": {},
Expand Down
7 changes: 6 additions & 1 deletion apps/frontend/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,12 @@
"membershipBuilder": {
"steps": {
"accountConfirmation": {
"joinSurvey": {}
"deliveryAddress": {},
"joinSurvey": {},
"newsletter": {
"groups": {},
"title": "Рассылка"
}
},
"emails": {},
"intro": {},
Expand Down
36 changes: 18 additions & 18 deletions apps/frontend/src/components/forms/AppInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,37 +28,36 @@
-->
<template>
<AppLabel v-if="label" :label="label" :required="required" />
<div class="flex items-center">
<div class="flex items-center" :class="disabled && 'opacity-60'">
<div v-if="$slots.before" class="flex-0 mr-2"><slot name="before" /></div>
<div
class="flex flex-1 items-center overflow-hidden rounded border focus-within:shadow-input"
:class="
hasError
? 'border-danger-70 bg-danger-10'
: 'border-primary-40 bg-white'
: disabled
? 'border-primary-40 bg-grey-lighter'
: 'border-primary-40 bg-white'
"
>
<span v-if="prefix" class="flex-0 px-2">{{ prefix }}</span>
<div
class="flex-1"
<input
v-model.trim="value"
class="w-full flex-1 bg-white/0 p-2 leading-[20px] focus:outline-none"
:class="{
'border-l border-primary-40': prefix,
'border-r border-primary-40': suffix,
}"
>
<input
v-model.trim="value"
class="w-full bg-white/0 p-2 leading-[20px] focus:outline-none"
:type="type"
:name="name"
:required="required"
:min="min"
:max="max"
:pattern="pattern"
v-bind="$attrs"
@blur="validation.$touch"
/>
</div>
:type="type"
:name="name"
:required="required"
:disabled="disabled"
:min="min"
:max="max"
:pattern="pattern"
v-bind="$attrs"
@blur="validation.$touch"
/>
<span v-if="suffix" class="flex-0 px-2">{{ suffix }}</span>
</div>
<div v-if="$slots.after" class="flex-0 ml-2"><slot name="after" /></div>
Expand Down Expand Up @@ -95,6 +94,7 @@ const props = withDefaults(
label?: string;
infoMessage?: string;
required?: boolean;
disabled?: boolean;
min?: number | string;
max?: number | string;
sameAs?: number | string;
Expand Down
50 changes: 12 additions & 38 deletions apps/frontend/src/components/forms/AppLinkList.vue
Original file line number Diff line number Diff line change
@@ -1,62 +1,36 @@
<!-- eslint-disable vue/no-mutating-props -->
<template>
<div>
<div v-for="(link, i) in modelValue" :key="i" class="mb-4 flex gap-4">
<AppRepeatable
:model-value="modelValue"
:new-item="() => ({ text: '', url: '' })"
:add-label="t('adminSettings.general.footer.otherLinks.add')"
>
<template #default="{ item }">
<div class="flex-1">
<AppInput
v-model="modelValue[i].text"
v-model="item.text"
:label="t('adminSettings.general.footer.otherLinks.linkText')"
required
/>
</div>
<div class="flex-1">
<AppInput
v-model="modelValue[i].url"
v-model="item.url"
:label="t('adminSettings.general.footer.otherLinks.url')"
type="text"
required
/>
</div>
<div class="flex-0 self-end">
<button
class="-ml-2 p-2 leading-tight text-primary-80 hover:text-primary"
type="button"
@click="removeLink(i)"
>
<font-awesome-icon :icon="faTimes" />
</button>
</div>
</div>

<AppButton
variant="primaryOutlined"
size="sm"
:icon="faPlus"
@click="addLink"
>
{{ t('adminSettings.general.footer.otherLinks.add') }}
</AppButton>
</div>
</template>
</AppRepeatable>
</template>
<script lang="ts" setup>
import { faPlus, faTimes } from '@fortawesome/free-solid-svg-icons';
import { useI18n } from 'vue-i18n';
import AppButton from '../button/AppButton.vue';
import AppInput from './AppInput.vue';
import AppRepeatable from './AppRepeatable.vue';
const props = defineProps<{
defineProps<{
modelValue: { text: string; url: string }[];
}>();
const { t } = useI18n();

function addLink() {
// eslint-disable-next-line vue/no-mutating-props
props.modelValue.push({ text: '', url: '' });
}

function removeLink(n: number) {
// eslint-disable-next-line vue/no-mutating-props
props.modelValue.splice(n, 1);
}
</script>
Loading

0 comments on commit 425cd67

Please sign in to comment.