diff --git a/frontend/src/components/BookingForm.vue b/frontend/src/components/BookingForm.vue index ffa85e5..bae8a1b 100644 --- a/frontend/src/components/BookingForm.vue +++ b/frontend/src/components/BookingForm.vue @@ -1,33 +1,6 @@ diff --git a/frontend/src/components/SpaceCalendar.vue b/frontend/src/components/SpaceCalendar.vue index 5976d27..7bd4731 100644 --- a/frontend/src/components/SpaceCalendar.vue +++ b/frontend/src/components/SpaceCalendar.vue @@ -39,7 +39,7 @@ diff --git a/frontend/src/views/Admin.vue b/frontend/src/views/Admin.vue index 3dd9342..2669fe3 100644 --- a/frontend/src/views/Admin.vue +++ b/frontend/src/views/Admin.vue @@ -1,69 +1,10 @@ @@ -127,12 +187,17 @@ const loading = ref(false) const error = ref('') const success = ref('') const editingSpace = ref(null) +const showModal = ref(false) const formData = ref({ name: '', type: 'sala', capacity: 1, - description: '' + description: '', + working_hours_start: null as number | null, + working_hours_end: null as number | null, + min_duration_minutes: null as number | null, + max_duration_minutes: null as number | null }) const loadSpaces = async () => { @@ -161,8 +226,8 @@ const handleSubmit = async () => { success.value = 'Space created successfully!' } - resetForm() await loadSpaces() + closeModal() // Clear success message after 3 seconds setTimeout(() => { @@ -175,18 +240,28 @@ const handleSubmit = async () => { } } +const openCreateModal = () => { + resetForm() + showModal.value = true +} + const startEdit = (space: Space) => { editingSpace.value = space formData.value = { name: space.name, type: space.type, capacity: space.capacity, - description: space.description || '' + description: space.description || '', + working_hours_start: space.working_hours_start ?? null, + working_hours_end: space.working_hours_end ?? null, + min_duration_minutes: space.min_duration_minutes ?? null, + max_duration_minutes: space.max_duration_minutes ?? null } - window.scrollTo({ top: 0, behavior: 'smooth' }) + showModal.value = true } -const cancelEdit = () => { +const closeModal = () => { + showModal.value = false resetForm() } @@ -196,7 +271,11 @@ const resetForm = () => { name: '', type: 'sala', capacity: 1, - description: '' + description: '', + working_hours_start: null, + working_hours_end: null, + min_duration_minutes: null, + max_duration_minutes: null } } @@ -245,6 +324,38 @@ onMounted(() => { gap: 16px; } +.form-section-header { + margin-top: 16px; + margin-bottom: 8px; + padding-top: 16px; + border-top: 1px solid #e5e7eb; +} + +.form-section-header h4 { + margin: 0 0 4px 0; + font-size: 16px; + font-weight: 600; + color: #1f2937; +} + +.help-text { + margin: 0; + font-size: 13px; + color: #6b7280; +} + +.form-row { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 16px; +} + +@media (max-width: 640px) { + .form-row { + grid-template-columns: 1fr; + } +} + .form-group { display: flex; flex-direction: column; @@ -254,6 +365,7 @@ onMounted(() => { .form-group label { font-weight: 500; color: #374151; + font-size: 14px; } .form-group input, @@ -408,4 +520,46 @@ onMounted(() => { display: flex; gap: 8px; } + +.page-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 24px; + flex-wrap: wrap; + gap: 16px; +} + +.page-header h2 { + margin: 0; +} + +.modal { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, 0.5); + display: flex; + align-items: center; + justify-content: center; + z-index: 1000; +} + +.modal-content { + background: white; + border-radius: 8px; + padding: 24px; + max-width: 600px; + width: 90%; + max-height: 90vh; + overflow-y: auto; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); +} + +.modal-content h3 { + margin-top: 0; + margin-bottom: 20px; +} diff --git a/frontend/src/views/MyBookings.vue b/frontend/src/views/MyBookings.vue index 00e2bad..6f47dff 100644 --- a/frontend/src/views/MyBookings.vue +++ b/frontend/src/views/MyBookings.vue @@ -124,56 +124,99 @@