Ui fixes #16
@@ -252,8 +252,12 @@ class FlightController extends Controller
|
|||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
if ($request->boolean('add_more')) {
|
||||||
|
return redirect()->route('flights.add')
|
||||||
|
->with('success', 'Flight saved. Add another below.');
|
||||||
|
}
|
||||||
|
|
||||||
return redirect()->route('profile.departure-board', [Auth::user()->name, $newFlight->id]);
|
return redirect()->route('profile.flight', [Auth::user()->name, $newFlight->id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -154,9 +154,9 @@ const submitForm = useForm({
|
|||||||
crew_type_id: null as number | null,
|
crew_type_id: null as number | null,
|
||||||
note: '' as string | null,
|
note: '' as string | null,
|
||||||
auto_update: false,
|
auto_update: false,
|
||||||
|
add_more: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
const departureIsFuture = computed(() => {
|
const departureIsFuture = computed(() => {
|
||||||
if (!form.departure_date) return false
|
if (!form.departure_date) return false
|
||||||
return new Date(form.departure_date) > new Date()
|
return new Date(form.departure_date) > new Date()
|
||||||
@@ -168,7 +168,7 @@ watch(departureIsFuture, (isFuture) => {
|
|||||||
}, { immediate: true })
|
}, { immediate: true })
|
||||||
|
|
||||||
|
|
||||||
function submit() {
|
function submit(addMore = false) {
|
||||||
submitForm.flight_number = flightNumber.value
|
submitForm.flight_number = flightNumber.value
|
||||||
submitForm.departure_date = form.departure_date
|
submitForm.departure_date = form.departure_date
|
||||||
submitForm.arrival_date = form.arrival_date
|
submitForm.arrival_date = form.arrival_date
|
||||||
@@ -184,6 +184,7 @@ function submit() {
|
|||||||
submitForm.crew_type_id = form.crew_type?.id ?? null
|
submitForm.crew_type_id = form.crew_type?.id ?? null
|
||||||
submitForm.note = form.note
|
submitForm.note = form.note
|
||||||
submitForm.auto_update = form.auto_update
|
submitForm.auto_update = form.auto_update
|
||||||
|
submitForm.add_more = addMore
|
||||||
|
|
||||||
if (isEdit) {
|
if (isEdit) {
|
||||||
submitForm.put(route('flights.update', { flight: props.flight!.id }))
|
submitForm.put(route('flights.update', { flight: props.flight!.id }))
|
||||||
@@ -897,15 +898,27 @@ function commitArrivalTimeInput() {
|
|||||||
|
|
||||||
<!-- ── Submit ─────────────────────────────────────────────── -->
|
<!-- ── Submit ─────────────────────────────────────────────── -->
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col cols="12">
|
<v-col v-if="!isEdit" cols="12" md="6">
|
||||||
<v-btn
|
<v-btn
|
||||||
block
|
block
|
||||||
size="large"
|
size="large"
|
||||||
:loading="submitForm.processing"
|
variant="outlined"
|
||||||
|
:loading="submitForm.processing && submitForm.add_more"
|
||||||
:disabled="submitForm.processing"
|
:disabled="submitForm.processing"
|
||||||
@click="submit"
|
@click="submit(true)"
|
||||||
>
|
>
|
||||||
{{ isEdit ? 'Save Changes' : 'Add Flight' }}
|
Save Flight and Add Another
|
||||||
|
</v-btn>
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="12" :md="isEdit ? 12 : 6">
|
||||||
|
<v-btn
|
||||||
|
block
|
||||||
|
size="large"
|
||||||
|
:loading="submitForm.processing && !submitForm.add_more"
|
||||||
|
:disabled="submitForm.processing"
|
||||||
|
@click="submit(false)"
|
||||||
|
>
|
||||||
|
{{ isEdit ? 'Save Changes' : 'Save Flight' }}
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
@@ -927,8 +940,8 @@ function commitArrivalTimeInput() {
|
|||||||
gap: 10px;
|
gap: 10px;
|
||||||
min-height: 56px;
|
min-height: 56px;
|
||||||
padding: 8px 12px;
|
padding: 8px 12px;
|
||||||
border: 1px solid rgba(255, 255, 255, 0.24);
|
border: 1px none rgba(255, 255, 255, 0.24);
|
||||||
border-radius: 4px;
|
border-bottom-style: solid;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
transition: border-color 0.15s ease;
|
transition: border-color 0.15s ease;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user