Skip to content

Commit

Permalink
Added Modal for organizations involved in the event. And also the (+#…
Browse files Browse the repository at this point in the history
… more) button
  • Loading branch information
rahulharpal1603 committed Oct 1, 2024
1 parent a7cfdf3 commit bf7806e
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 17 deletions.
33 changes: 19 additions & 14 deletions frontend/components/card/CardDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,34 @@
<h3 class="responsive-h3 text-left font-display">
{{ $t("components.card_details.header") }}
</h3>
<IconEdit @click="openModal()" @keydown.enter="openModal()" />
<ModalEditAboutEvent
<IconEdit @click="openModal('ModalEditAboutEvent')" @keydown.enter="openModal('ModalEditAboutEvent')" />
<!-- <ModalEditAboutEvent
v-if="event"
@closeModal="handleCloseModal"
:event="event"
:sectionsToEdit="[
$t('_global.about'),
$t('components._global.participate'),
$t('components._global.offer_to_help_link'),
]"
:isOpen="modalIsOpen"
/>
/> -->
</div>
<div v-if="event" class="flex-col space-y-6 py-2">
<div class="flex items-center gap-3">
<MetaTagOrganization
v-for="(o, i) in event.organizations"
:key="i"
:organization="o"
/>
<MetaTagOrganization
v-for="(o, i) in event.organizations.slice(0, 1)"
:key="i"
:organization="o"
/>
<button v-if="event.organizations.length > 1" @click="openModal('ModalOrganizationOverview')" @keydown.enter="openModal('ModalOrganizationOverview')" class="text-sm font-semibold text-black">
(+{{ event.organizations.length - 1 }} more)
</button>
<ModalOrganizationOverview
@closeModal="handleCloseModal('ModalOrganizationOverview')"
:cta="true"
:event="event"
:isOpen="modalIsOpen"
/>
</div>
<!-- <MetaTagAttendance
:numAttending="event.attendees ? event.attendees.length : 0"
Expand All @@ -45,22 +53,19 @@

<script setup lang="ts">
import type { Event } from "~/types/events/event";
defineProps<{
event?: Event;
}>();
const modals = useModals();
const modalName = "ModalEditPageText";
const modalIsOpen = ref(false);
function openModal() {
function openModal(modalName: string) {
modals.openModal(modalName);
modalIsOpen.value = modals.modals[modalName].isOpen;
}
const handleCloseModal = () => {
const handleCloseModal = (modalName: string) => {
modals.closeModal(modalName);
modalIsOpen.value = modals.modals[modalName].isOpen;
};
Expand Down
36 changes: 36 additions & 0 deletions frontend/components/modal/ModalOrganizationOverview.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<template>
<ModalBase :modalName="modalName">
<div class="px-2 pb-2 pt-1 lg:px-4 lg:pb-4 lg:pt-2">
<DialogTitle class="font-display">
<p class="responsive-h2 font-bold">
{{ $t("components.modal_organization_overview.header") }}
</p>
</DialogTitle>
<div class="mt-6 md:max-h-[50vh] md:overflow-y-auto py-2 pr-1">
<div v-if="event" class="space-y-3">
<div
v-for="(o, i) in event.organizations"
:key="i"
class="m-1 card-style p-2"
>
<MetaTagOrganization
:organization="o"
/>
</div>
</div>
</div>
</div>
</ModalBase>
</template>

<script setup lang="ts">
import ModalBase from "~/components/modal/ModalBase.vue";
import { DialogTitle } from "@headlessui/vue";
import type { Event } from "~/types/events/event";
const props = defineProps<{

Check warning on line 31 in frontend/components/modal/ModalOrganizationOverview.vue

View workflow job for this annotation

GitHub Actions / Run PR Frontend Check

'props' is assigned a value but never used
event?: Event;
}>();
const modalName = "ModalOrganizationOverview";
</script>
1 change: 1 addition & 0 deletions frontend/components/modal/ModalSharePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ import type { Group } from "~/types/entities/group";
import type { Organization } from "~/types/entities/organization";
import type { Event } from "~/types/events/event";
import { IconMap } from "~/types/icon-map";
import { DialogTitle } from "@headlessui/vue";
const props = defineProps<{
cta: BtnAction["cta"];
Expand Down
3 changes: 2 additions & 1 deletion frontend/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
"components.modal_command_palette.jump_to": "Springen zu",
"components.modal_image_btn.open_modal_aria_label": "Größere Version dieses Bildes öffnen",
"components.modal_organization_status.status_accepted": "Bewerbungsstatus: Angenommen",
"components.modal_organization_overview.header": "Organisationen",
"components.modal_qr_code.aria_label": "QR-Code in einem neuen Tab öffnen",
"components.modal_qr_code.download_qr_code": "QR-Code herunterladen",
"components.modal_qr_code.download_qr_code_aria_label": "QR-Code herunterladen, der auf diese Seite verlinkt",
Expand Down Expand Up @@ -730,4 +731,4 @@
"types.topics.transparency": "Transparenz",
"types.topics.women": "Frauenrechte",
"utils.nav_menu_items.organizations": "Organisationen"
}
}
3 changes: 2 additions & 1 deletion frontend/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@
"components.modal_command_palette.jump_to": "Jump to",
"components.modal_image_btn.open_modal_aria_label": "Open a larger version of this image",
"components.modal_organization_status.status_accepted": "Application status: Accepted",
"components.modal_organization_overview.header": "Organizations",
"components.modal_qr_code.aria_label": "Open the QR code in a new tab",
"components.modal_qr_code.download_qr_code": "Download QR code",
"components.modal_qr_code.download_qr_code_aria_label": "Download a QR code that links to this page",
Expand Down Expand Up @@ -734,4 +735,4 @@
"types.topics.transparency": "Transparency",
"types.topics.women": "Women's Rights",
"utils.nav_menu_items.organizations": "Organizations"
}
}
3 changes: 2 additions & 1 deletion frontend/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@
"components.modal_command_palette.jump_to": "Sauter vers",
"components.modal_image_btn.open_modal_aria_label": "Ouvrir une version agrandie de cette image",
"components.modal_organization_status.status_accepted": "Statut de la demande : acceptée",
"components.modal_organization_overview.header": "Organizations",
"components.modal_qr_code.aria_label": "Ouvrir le code QR dans un nouvel onglet",
"components.modal_qr_code.download_qr_code": "Télécharger le code QR",
"components.modal_qr_code.download_qr_code_aria_label": "Télécharger un code QR qui renvoie à cette page",
Expand Down Expand Up @@ -722,4 +723,4 @@
"types.topics.transparency": "Transparence",
"types.topics.women": "Droits des femmes",
"utils.nav_menu_items.organizations": "Organisations"
}
}

0 comments on commit bf7806e

Please sign in to comment.