Merge branch '6-nakon-kreiranja-rezervacije-otici-ponovo-na-kalendar' into 'master'
Redirect to reservation after created notification Closes #6 See merge request kbr4/zsterminator!4
This commit was merged in pull request #18.
This commit is contained in:
@@ -47,7 +47,7 @@ class ReservationsController < ApplicationController
|
|||||||
assign_customer_to_reservation
|
assign_customer_to_reservation
|
||||||
|
|
||||||
if @reservation.save
|
if @reservation.save
|
||||||
redirect_to @reservation, notice: t('.reservation_created')
|
redirect_to reservations_url, notice: t('.reservation_created')
|
||||||
else
|
else
|
||||||
@customers = @company.customers
|
@customers = @company.customers
|
||||||
render :new, status: :unprocessable_entity
|
render :new, status: :unprocessable_entity
|
||||||
@@ -98,7 +98,7 @@ class ReservationsController < ApplicationController
|
|||||||
# Check if reservation update was successful
|
# Check if reservation update was successful
|
||||||
# (We might ignore customer_updated status for now, or add more complex checks)
|
# (We might ignore customer_updated status for now, or add more complex checks)
|
||||||
if reservation_updated
|
if reservation_updated
|
||||||
format.html { redirect_to reservation_url(@reservation), notice: t('.reservation_updated') }
|
format.html { redirect_to reservations_url, notice: t('.reservation_updated') }
|
||||||
format.json { render :show, status: :ok, location: @reservation }
|
format.json { render :show, status: :ok, location: @reservation }
|
||||||
else
|
else
|
||||||
@customers = @company.customers # Reload for form
|
@customers = @company.customers # Reload for form
|
||||||
|
|||||||
@@ -2,15 +2,14 @@
|
|||||||
<div class="reservation-page" data-controller="main-calendar" style="display: block; width: 100%; height: 100vh; overflow: hidden;">
|
<div class="reservation-page" data-controller="main-calendar" style="display: block; width: 100%; height: 100vh; overflow: hidden;">
|
||||||
<!-- Fixed height header -->
|
<!-- Fixed height header -->
|
||||||
<header style="height: 80px; padding: 15px; background-color: white; box-shadow: 0 2px 4px rgba(0,0,0,0.1); position: relative; z-index: 100;">
|
<header style="height: 80px; padding: 15px; background-color: white; box-shadow: 0 2px 4px rgba(0,0,0,0.1); position: relative; z-index: 100;">
|
||||||
<% if notice.present? %>
|
|
||||||
<p class="py-2 px-3 bg-green-50 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% content_for :title, "Reservations" %>
|
<% content_for :title, "Reservations" %>
|
||||||
|
|
||||||
<div class="flex justify-between items-center-calendar">
|
<div class="flex justify-between items-center-calendar">
|
||||||
<div class="flex items-center space-x-4">
|
<div class="flex items-center space-x-4">
|
||||||
<h1 class="font-bold text-4xl px-5">Reservations</h1>
|
<h1 class="font-bold text-4xl px-5">Reservations</h1>
|
||||||
|
<% if notice.present? %>
|
||||||
|
<p class="py-1 px-3 ml-4 bg-green-100 text-green-700 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
|
||||||
|
<% end %>
|
||||||
<div class="flex items-center space-x-2 ml-6" data-main-calendar-target="navigation">
|
<div class="flex items-center space-x-2 ml-6" data-main-calendar-target="navigation">
|
||||||
<button data-action="main-calendar#prev" class="px-3 py-1 bg-gray-100 rounded-md hover:bg-gray-200">
|
<button data-action="main-calendar#prev" class="px-3 py-1 bg-gray-100 rounded-md hover:bg-gray-200">
|
||||||
« Prev
|
« Prev
|
||||||
|
|||||||
Reference in New Issue
Block a user