Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions app/Http/Controllers/ContactFormController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,11 @@ public function submit(Request $request)
->withErrors(['captcha' => 'CAPTCHA verification failed. Please try again.']);
}
}

Log::info('Contact form submitted', [
'ip' => $request->ip(),
'name' => $validated['first_name'] . ' ' . $validated['last_name'],
'email' => $validated['email'],
]);

$locale = app()->getLocale();
$view = view()->exists("emails.$locale.contact") ? "emails.$locale.contact" : 'emails.en.contact';

Expand Down
6 changes: 3 additions & 3 deletions app/Policies/EventPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function report(User $user, Event $event)
return false;
}

if ($user->email === $event->owner->email) {
if ($event->owner && $user->email === $event->owner->email) {
return true;
}

Expand Down Expand Up @@ -84,7 +84,7 @@ public function edit(User $user, Event $event)
return false;
}

if ($user->email === $event->owner->email) {
if ($event->owner && $user->email === $event->owner->email) {
return true;
}

Expand All @@ -105,7 +105,7 @@ public function delete(User $user, Event $event): bool
}
}

if ($user->email === $event->owner->email) {
if ($event->owner && $user->email === $event->owner->email) {
return true;
}

Expand Down
237 changes: 0 additions & 237 deletions public/build/assets/app-B8BfzfKB.js

This file was deleted.

237 changes: 237 additions & 0 deletions public/build/assets/app-CQtKloTa.js

Large diffs are not rendered by default.

237 changes: 237 additions & 0 deletions public/build/assets/app-DxYtHnOh.js

Large diffs are not rendered by default.

299 changes: 299 additions & 0 deletions public/build/assets/php_en-B2R4wRxg.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/build/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"isEntry": true
},
"resources/js/app.js": {
"file": "assets/app-B8BfzfKB.js",
"file": "assets/app-CQtKloTa.js",
"name": "app",
"src": "resources/js/app.js",
"isEntry": true,
Expand Down Expand Up @@ -93,7 +93,7 @@
"isDynamicEntry": true
},
"resources/lang/php_en.json": {
"file": "assets/php_en-Dv7P2FP8.js",
"file": "assets/php_en-B2R4wRxg.js",
"name": "php_en",
"src": "resources/lang/php_en.json",
"isDynamicEntry": true
Expand Down
4 changes: 4 additions & 0 deletions resources/js/components/EventCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
</div>

<div class="flex-grow flex flex-col gap-2 px-6 py-4">
<div class="text-default text-slate-500 mb-2 flex items-center font-semibold">
Organizer: <span class="text-sm font-semibold ml-1 w-fit px-4 py-1.5 bg-[#CCF0F9] rounded-full flex items-center">{{ event.organizer || 'Unknown' }}</span>
</div>

<div v-if="eventTags.length" class="flex gap-2 flex-wrap mb-2">
<template v-for="{ title, highlight } in eventTags">
<span
Expand Down
14 changes: 10 additions & 4 deletions resources/js/components/EventDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
{{ fromText }} - {{ toText }}
</p>

<div class="mb-6">
<p class="text-slate-500 font-semibold p-0 mb-2">
Organizer:
</p>
<p class="text-[#20262C] font-normal p-0 mb-6">
{{ event.organizer || 'Unknown' }}
</p>
</div>

<div v-if="event.activity_format" class="mb-6">
<p class="p-0 mb-2 font-semibold text-slate-500">
Format of the activity:
Expand Down Expand Up @@ -56,7 +65,7 @@
</div>
</div>

<div v-if="event.recurring_event" class="mb-6">
<div v-if="event.recurring_event && recurringFrequentlyMap[event.recurring_event]" class="mb-6">
<p class="p-0 mb-2 font-semibold text-slate-500">Recurring event:</p>
<div class="flex flex-wrap gap-2">
<div
Expand Down Expand Up @@ -139,9 +148,6 @@
</div>

<div class="mb-6 [&_p]:empty:hidden">
<p class="p-0 mb-2 font-semibold text-slate-500">
{{ event.description }}
</p>
<div
class="text-[#20262C] font-normal p-0 mb-6 space-y-2 [&_p]:py-0"
v-html="event.description"
Expand Down
75 changes: 69 additions & 6 deletions resources/js/components/SearchPageComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
<FieldWrapper horizontal label="Language">
<SelectField
multiple
searchable
return-object
placeholder="Select language"
v-model="filters.languages"
Expand All @@ -101,6 +102,7 @@
<FieldWrapper horizontal label="Country">
<SelectField
multiple
searchable
return-object
id-name="iso"
placeholder="Select country"
Expand Down Expand Up @@ -188,6 +190,7 @@
<FieldWrapper horizontal label="Format">
<SelectField
multiple
searchable
return-object
placeholder="Select format"
v-model="filters.formats"
Expand All @@ -199,6 +202,7 @@
<FieldWrapper horizontal label="Activity type">
<SelectField
multiple
searchable
return-object
placeholder="Select type"
v-model="filters.types"
Expand All @@ -210,6 +214,7 @@
<FieldWrapper horizontal label="Audience">
<SelectField
multiple
searchable
return-object
placeholder="Select audience"
v-model="filters.audiences"
Expand All @@ -221,6 +226,7 @@
<FieldWrapper horizontal label="Age range">
<SelectField
multiple
searchable
return-object
placeholder="Select range"
v-model="filters.ages"
Expand All @@ -232,6 +238,7 @@
<FieldWrapper horizontal label="Themes">
<SelectField
multiple
searchable
return-object
placeholder="Select themes"
v-model="filters.themes"
Expand Down Expand Up @@ -281,6 +288,7 @@ import SelectField from './form-fields/SelectField.vue';
import InputField from './form-fields/InputField.vue';

import { useDataOptions } from './activity-form/mixins.js';
import { useQueryParams } from '../composables/useQueryParams.js';

export default {
name: 'SearchPageComponent',
Expand Down Expand Up @@ -312,6 +320,8 @@ export default {
const { activityFormatOptions, activityTypeOptions, ageOptions } =
useDataOptions();

const { queryParams, onChangeQueryParams } = useQueryParams();

const isLoading = ref(true);
const mapContainerRef = ref(null);
const mapInstance = ref(null);
Expand All @@ -321,7 +331,7 @@ export default {
const errors = ref(null);

const emptyFilters = {
query: '',
query: props.prpQuery || '',
languages: [],
countries: [],
start_date: '',
Expand All @@ -330,13 +340,12 @@ export default {
audiences: [],
ages: [],
themes: [],
year: { id: new Date().getFullYear(), name: new Date().getFullYear() },
countries: props.prpSelectedCountry || [],
};

const filters = ref({
...emptyFilters,
query: props.prpQuery || '',
year: { id: new Date().getFullYear(), name: new Date().getFullYear() },
countries: props.prpSelectedCountry || [],
});

const pagination = ref({
Expand All @@ -363,6 +372,55 @@ export default {
}))
);

const handleUpdateParams = () => {
const updatedParams = {
page: pagination.value.current_page,
query: filters.value.query,
year: filters.value.year?.id,
start_date: filters.value.start_date,
languages: filters.value.languages?.map((i) => i.id).join(','),
countries: filters.value.countries?.map((i) => i.iso).join(','),
formats: filters.value.formats?.map((i) => i.id).join(','),
types: filters.value.types?.map((i) => i.id).join(','),
audiences: filters.value.audiences?.map((i) => i.id).join(','),
ages: filters.value.ages?.map((i) => i.id).join(','),
themes: filters.value.themes?.map((i) => i.id).join(','),
};
console.log('updatedParams', updatedParams);
onChangeQueryParams(updatedParams);
};

const onInitFilters = () => {
const params = queryParams.value;
console.log('init params', params);

const mapList = (listVal, options, key = 'id') => {
return (listVal || '')
.split(',')
.map((val) => options.find((op) => String(op[key]) === String(val)))
.filter((i) => !!i);
};
if (params.page) {
pagination.value.current_page = params.page;
}

filters.value = {
...emptyFilters,
query: params.query || '',
start_date: params.start_date || '',
year: params.year
? { id: params.year, name: params.year }
: emptyFilters.year,
languages: mapList(params.languages, languageOptions.value),
countries: mapList(params.countries, props.countrieslist, 'iso'),
formats: mapList(params.formats, activityFormatOptions.value),
types: mapList(params.types, activityTypeOptions.value),
audiences: mapList(params.audiences, props.audienceslist),
ages: mapList(params.ages, ageOptions.value),
themes: mapList(params.themes, props.themeslist),
};
};

const tags = computed(() => {
const result = [
...filters.value.languages,
Expand Down Expand Up @@ -424,6 +482,8 @@ export default {
url = `/search?page=${pagination.value.current_page}`;
}

handleUpdateParams();

const requestData = {
...filters.value,
year: filters.value.year?.id,
Expand Down Expand Up @@ -623,7 +683,7 @@ export default {
const handleInitMap = () => {
mapInstance.value = L.map('mapid');
mapInstance.value.setView([51, 10], 5);

L.tileLayer(props.mapTileUrl, {
maxZoom: 18,
attribution: '© <a href="https://www.mapbox.com/">Mapbox</a>',
Expand All @@ -648,7 +708,10 @@ export default {
};

onMounted(() => {
onSubmit();
setTimeout(() => {
onInitFilters();
onSubmit();
}, 100);

// document.addEventListener('leaflet-ready', () => {
setTimeout(() => {
Expand Down
10 changes: 7 additions & 3 deletions resources/js/components/activity-form/AddConfirmation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
</template>

<script>
import { computed } from 'vue';
import { trans } from 'laravel-vue-i18n';
import { computed } from 'vue';
import _ from 'lodash';
import { useDataOptions } from './mixins.js';

Expand Down Expand Up @@ -105,8 +105,12 @@ export default {
{ label: trans('event.theme-title'), value: themeValues.join(', ') },
{ label: trans('event.activity-description'), htmlValue: description },
];

const audienceValues = (audience || [])
.map(item => props.audiences.find(({ id }) => id === item))
.filter(aud => aud)
.map(aud => aud.name);

const audienceValues = (audience || []).map(item => props.audiences.find(({ id }) => id === item)?.name).map(name => trans(`event.audience.${name}`));
const participantsValue = [
participants_count || 0,
[
Expand Down Expand Up @@ -155,7 +159,7 @@ export default {
});

return {
stepDataList,
stepDataList, trans
};
},
};
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/activity-form/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export default {
CheckboxField,
},
setup(props, { emit }) {
console.log('event', props.event);
// console.log('event', props.event);
const { stepTitles } = useDataOptions();

const newEvent = ref(null);
Expand Down
16 changes: 0 additions & 16 deletions resources/js/components/activity-form/mixins.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,6 @@ export function useDataOptions() {
buildOptionMap(themeOptions.value)
);

const audienceOptions = ref([]);

onMounted(async () => {
const response = await axios.get('/api/audiences');
audienceOptions.value = response.data.map((audience) => ({
id: audience.id,
name: trans(`event.${audience.slug}`),
}));
});

const audienceOptionsMap = computed(() =>
buildOptionMap(audienceOptions.value)
);

return {
stepTitles,
activityFormatOptions,
Expand All @@ -148,7 +134,5 @@ export function useDataOptions() {
organizerTypeOptionsMap,
themeOptions,
themeOptionsMap,
audienceOptions,
audienceOptionsMap,
};
}
1 change: 1 addition & 0 deletions resources/js/components/form-fields/SelectField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ export default {

const isSelectedOption = (option) => {
if (props.multiple) {
if (!selectedValues.value) return false;
return selectedValues.value?.some(
(item) => String(item[props.idName]) === String(option[props.idName])
);
Expand Down
Loading
Loading