From b89f8c1e535c3da81078de3f69bd5155c62c735d Mon Sep 17 00:00:00 2001 From: zmigroo Date: Sat, 13 Jan 2024 12:13:54 +0100 Subject: [PATCH 1/7] Update app.css and Index.vue --- resources/css/app.css | 4 +++- resources/js/Pages/City/Index.vue | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/resources/css/app.css b/resources/css/app.css index 789008dc..96a8cb2a 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -29,11 +29,13 @@ } div.regulations>div:nth-child(2) { max-height: 0vh; - margin-top: 12px; + margin-bottom: 0px; + transition: all 0.5s ease-in-out; } div.regulations>div:nth-child(2).show { max-height: 50vh; + margin-bottom: 12px; } div.regulations>div>svg { diff --git a/resources/js/Pages/City/Index.vue b/resources/js/Pages/City/Index.vue index 9a3fe902..e95f808b 100644 --- a/resources/js/Pages/City/Index.vue +++ b/resources/js/Pages/City/Index.vue @@ -111,9 +111,9 @@ function createOpinion() { {{ city.latitude }}, {{ city.longitude }} -
-
{{ __('Regulations') }}
-
Content
+
+
{{ __('Regulations') }}
+
~~~Content~~~

From afeb0b33093e18f2b9d93ab6b0eeba2fdcde70b8 Mon Sep 17 00:00:00 2001 From: Artur Flis Date: Sat, 13 Jan 2024 12:23:53 +0100 Subject: [PATCH 2/7] added import rules button, changes in city view for fetching data, rules route --- resources/js/Pages/City/Index.vue | 13 ++++++++++++- resources/js/Pages/Importers/Index.vue | 12 +++++++++++- routes/web.php | 2 +- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/resources/js/Pages/City/Index.vue b/resources/js/Pages/City/Index.vue index 9a3fe902..7d0fd900 100644 --- a/resources/js/Pages/City/Index.vue +++ b/resources/js/Pages/City/Index.vue @@ -8,12 +8,13 @@ import { useFilterStore } from '@/Shared/Stores/FilterStore' import FavoriteButton from '@/Shared/Components/FavoriteButton.vue' import ProviderIcons from '@/Shared/Components/ProviderIcons.vue' import { __ } from '@/translate' -import { useForm, usePage } from '@inertiajs/vue3' +import { router, useForm, usePage } from '@inertiajs/vue3' import ErrorMessage from '@/Shared/Components/ErrorMessage.vue' import { useToast } from 'vue-toastification' import Pagination from '@/Shared/Components/Pagination.vue' import InfoPopup from '@/Shared/Components/InfoPopup.vue' import Opinion from '@/Shared/Components/Opinion.vue' +import axios from 'axios' const toast = useToast() const page = usePage() @@ -63,6 +64,16 @@ function toggleRegulations() { console.log(regulationsOpen) } +function fetchRegulations() { + axios.get(`/api/rules/{city.country.name}/{city.name}`) + .then(response => { + console.log(response.data) + }) + .catch(error => { + console.log(error) + }) +} + const emptyRatingError = ref('') function createOpinion() { diff --git a/resources/js/Pages/Importers/Index.vue b/resources/js/Pages/Importers/Index.vue index 2da7b0eb..e93b4427 100644 --- a/resources/js/Pages/Importers/Index.vue +++ b/resources/js/Pages/Importers/Index.vue @@ -20,6 +20,11 @@ function runImporters() { router.post('/run-importers', []) toast.success(__('Importers started.')) } + +function runRules() { + router.post('/rules/import-rules/false', []) + toast.success(__('Rules started.')) +}