diff --git a/app/errors/errors.go b/app/errors/errors.go new file mode 100644 index 0000000..6d5623f --- /dev/null +++ b/app/errors/errors.go @@ -0,0 +1,30 @@ +package httperror + +import ( + "encoding/json" + "net/http" +) + +type HTTPError struct { + Message string `json:"message"` + StatusCode int `json:"status_code"` +} + +func (e *HTTPError) WriteError(w http.ResponseWriter) { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(e.StatusCode) + json.NewEncoder(w).Encode(e) +} + +var ( + ErrInvalidID = &HTTPError{Message: "Invalid ID", StatusCode: http.StatusBadRequest} + ErrNotFound = &HTTPError{Message: "Resource not found", StatusCode: http.StatusNotFound} + ErrInternalServer = &HTTPError{Message: "Internal server error", StatusCode: http.StatusInternalServerError} +) + +func NewHTTPError(message string, statusCode int) *HTTPError { + return &HTTPError{ + Message: message, + StatusCode: statusCode, + } +} diff --git a/app/handlers/airline.go b/app/handlers/airline.go index 6fdf3a5..2dfd385 100644 --- a/app/handlers/airline.go +++ b/app/handlers/airline.go @@ -7,6 +7,7 @@ import ( "context" + httperror "github.com/FACorreiaa/Aviation-tracker/app/errors" "github.com/FACorreiaa/Aviation-tracker/app/models" svg2 "github.com/FACorreiaa/Aviation-tracker/app/static/svg" airline "github.com/FACorreiaa/Aviation-tracker/app/view/airlines" @@ -30,7 +31,7 @@ func (h *Handler) renderAirlineSidebar() []models.SidebarItem { return sidebar } -func (h *Handler) getAirline(_ http.ResponseWriter, r *http.Request) (int, []models.Airline, error) { +func (h *Handler) getAirline(w http.ResponseWriter, r *http.Request) (int, []models.Airline, error) { pageSize := 20 name := r.FormValue("airline_name") callSign := r.FormValue("call_sign") @@ -56,18 +57,20 @@ func (h *Handler) getAirline(_ http.ResponseWriter, r *http.Request) (int, []mod return page, al, nil } -func (h *Handler) getAirlineDetails(_ http.ResponseWriter, r *http.Request) (models.Airline, error) { +func (h *Handler) getAirlineDetails(w http.ResponseWriter, r *http.Request) (models.Airline, error) { vars := mux.Vars(r) airlineName, ok := vars["airline_name"] if !ok { err := errors.New("airline_name not found in path") HandleError(err, "Error fetching airline_name") + httperror.ErrNotFound.WriteError(w) return models.Airline{}, err } c, err := h.service.GetAirlineByName(context.Background(), airlineName) if err != nil { HandleError(err, "Error fetching airline_name details") + httperror.ErrInvalidID.WriteError(w) return models.Airline{}, err } @@ -104,6 +107,7 @@ func (h *Handler) renderAirlineTable(w http.ResponseWriter, r *http.Request) (te if err != nil { HandleError(err, "Error fetching airlines") + httperror.ErrNotFound.WriteError(w) return nil, err } @@ -117,6 +121,7 @@ func (h *Handler) renderAirlineTable(w http.ResponseWriter, r *http.Request) (te if err != nil { HandleError(err, "error fetching total airline") + httperror.ErrNotFound.WriteError(w) return nil, err } @@ -143,12 +148,14 @@ func (h *Handler) AirlineMainPage(w http.ResponseWriter, r *http.Request) error var table, err = h.renderAirlineTable(w, r) if err != nil { HandleError(err, "Error rendering airline table") + httperror.ErrInternalServer.WriteError(w) return err } al, err := h.service.GetAirlinesLocation() if err != nil { HandleError(err, "Error rendering airlines location") + httperror.ErrNotFound.WriteError(w) return err } @@ -163,6 +170,7 @@ func (h *Handler) AirlineLocationPage(w http.ResponseWriter, r *http.Request) er al, err := h.service.GetAirlinesLocation() if err != nil { HandleError(err, "Error rendering locations") + httperror.ErrInternalServer.WriteError(w) return err } a := airline.AirlineLocationsPage(sidebar, al, "Airline", "Check airline expanded locations") @@ -174,6 +182,7 @@ func (h *Handler) AirlineDetailsPage(w http.ResponseWriter, r *http.Request) err al, err := h.getAirlineDetails(w, r) if err != nil { HandleError(err, "Error rendering details") + httperror.ErrNotFound.WriteError(w) return err } a := airline.AirlineDetailsPage(sidebar, al, "Airline", "Check airport locations") @@ -222,6 +231,7 @@ func (h *Handler) renderAirlineAircraftTable(w http.ResponseWriter, r *http.Requ lastPage, err := h.service.GetAllAircraft() if err != nil { HandleError(err, "Error fetching last page") + httperror.ErrNotFound.WriteError(w) return nil, err } data := models.AircraftTable{ @@ -243,7 +253,7 @@ func (h *Handler) renderAirlineAircraftTable(w http.ResponseWriter, r *http.Requ return taxTable, nil } -func (h *Handler) getAircraft(_ http.ResponseWriter, r *http.Request) (int, []models.Aircraft, error) { +func (h *Handler) getAircraft(w http.ResponseWriter, r *http.Request) (int, []models.Aircraft, error) { pageSize := 20 orderBy := r.FormValue("orderBy") sortBy := r.FormValue("sortBy") @@ -254,7 +264,6 @@ func (h *Handler) getAircraft(_ http.ResponseWriter, r *http.Request) (int, []mo page, err := strconv.Atoi(r.URL.Query().Get("page")) if err != nil { - // Handle error or set a default page number page = 1 } @@ -262,6 +271,7 @@ func (h *Handler) getAircraft(_ http.ResponseWriter, r *http.Request) (int, []mo typeEngine, modelCode, planeOwner) if err != nil { HandleError(err, "Error fetching aircraft") + httperror.ErrNotFound.WriteError(w) return 0, nil, err } @@ -272,6 +282,7 @@ func (h *Handler) AirlineAircraftPage(w http.ResponseWriter, r *http.Request) er taxTable, err := h.renderAirlineAircraftTable(w, r) sidebar := h.renderAirlineSidebar() if err != nil { + httperror.ErrInternalServer.WriteError(w) return err } a := airline.AirlineLayoutPage("Aircraft", "Check models about aircraft", taxTable, sidebar) @@ -280,7 +291,7 @@ func (h *Handler) AirlineAircraftPage(w http.ResponseWriter, r *http.Request) er // Airplane -func (h *Handler) getAirplane(_ http.ResponseWriter, r *http.Request) (int, []models.Airplane, error) { +func (h *Handler) getAirplane(w http.ResponseWriter, r *http.Request) (int, []models.Airplane, error) { pageSize := 20 page, err := strconv.Atoi(r.URL.Query().Get("page")) orderBy := r.FormValue("orderBy") @@ -297,6 +308,7 @@ func (h *Handler) getAirplane(_ http.ResponseWriter, r *http.Request) (int, []mo a, err := h.service.GetAirplanes(context.Background(), page, pageSize, orderBy, sortBy, airlineName, modelName, productionLine, registrationNumber) if err != nil { + httperror.ErrNotFound.WriteError(w) return 0, nil, err } @@ -348,6 +360,7 @@ func (h *Handler) renderAirlineAirplaneTable(w http.ResponseWriter, r *http.Requ lastPage, err := h.service.GetAllAirplanes() if err != nil { HandleError(err, "Error fetching last page") + httperror.ErrNotFound.WriteError(w) return nil, err } a := models.AirplaneTable{ @@ -373,6 +386,7 @@ func (h *Handler) AirlineAirplanePage(w http.ResponseWriter, r *http.Request) er a, err := h.renderAirlineAirplaneTable(w, r) sidebar := h.renderAirlineSidebar() if err != nil { + httperror.ErrInternalServer.WriteError(w) return err } al := airline.AirlineLayoutPage("Airplane", "Check models about airplanes", a, sidebar) @@ -381,7 +395,7 @@ func (h *Handler) AirlineAirplanePage(w http.ResponseWriter, r *http.Request) er // Tax -func (h *Handler) getAirlineTax(_ http.ResponseWriter, r *http.Request) (int, []models.Tax, error) { +func (h *Handler) getAirlineTax(w http.ResponseWriter, r *http.Request) (int, []models.Tax, error) { pageSize := 20 orderBy := r.FormValue("orderBy") sortBy := r.FormValue("sortBy") @@ -397,6 +411,7 @@ func (h *Handler) getAirlineTax(_ http.ResponseWriter, r *http.Request) (int, [] t, err := h.service.GetTax(context.Background(), page, pageSize, orderBy, sortBy, taxName, countryName, airlineName) if err != nil { + httperror.ErrNotFound.WriteError(w) return 0, nil, err } @@ -436,6 +451,7 @@ func (h *Handler) renderAirlineTaxTable(w http.ResponseWriter, r *http.Request) lastPage, err := h.service.GetSum() if err != nil { HandleError(err, "Error fetching tax") + httperror.ErrNotFound.WriteError(w) return nil, err } taxData := models.TaxTable{ @@ -460,6 +476,7 @@ func (h *Handler) AirlineTaxPage(w http.ResponseWriter, r *http.Request) error { taxTable, err := h.renderAirlineTaxTable(w, r) sidebar := h.renderAirlineSidebar() if err != nil { + httperror.ErrNotFound.WriteError(w) HandleError(err, "Error rendering table") return err } diff --git a/app/handlers/airport.go b/app/handlers/airport.go index 64275b1..53f720e 100644 --- a/app/handlers/airport.go +++ b/app/handlers/airport.go @@ -7,6 +7,7 @@ import ( "context" + httperror "github.com/FACorreiaa/Aviation-tracker/app/errors" "github.com/FACorreiaa/Aviation-tracker/app/models" svg2 "github.com/FACorreiaa/Aviation-tracker/app/static/svg" airport "github.com/FACorreiaa/Aviation-tracker/app/view/airports" @@ -14,7 +15,7 @@ import ( "github.com/gorilla/mux" ) -func (h *Handler) getAirports(_ http.ResponseWriter, r *http.Request) (int, []models.Airport, error) { +func (h *Handler) getAirports(w http.ResponseWriter, r *http.Request) (int, []models.Airport, error) { pageSize := 20 page, err := strconv.Atoi(r.URL.Query().Get("page")) orderBy := r.URL.Query().Get("orderBy") @@ -27,18 +28,20 @@ func (h *Handler) getAirports(_ http.ResponseWriter, r *http.Request) (int, []mo a, err := h.service.GetAirports(context.Background(), page, pageSize, orderBy, sortBy) if err != nil { + httperror.ErrNotFound.WriteError(w) return 0, nil, err } return page, a, nil } -func (h *Handler) getAirportDetails(_ http.ResponseWriter, r *http.Request) (models.Airport, error) { +func (h *Handler) getAirportDetails(w http.ResponseWriter, r *http.Request) (models.Airport, error) { vars := mux.Vars(r) idStr, ok := vars["airport_id"] if !ok { err := errors.New("airport_id not found in path") HandleError(err, "Error fetching airport_id") + httperror.ErrInternalServer.WriteError(w) return models.Airport{}, err } @@ -51,13 +54,14 @@ func (h *Handler) getAirportDetails(_ http.ResponseWriter, r *http.Request) (mod ap, err := h.service.GetAirportByID(context.Background(), id) if err != nil { HandleError(err, "Error fetching airport details") + httperror.ErrNotFound.WriteError(w) return models.Airport{}, err } return ap, nil } -func (h *Handler) getAirportByName(_ http.ResponseWriter, r *http.Request) (int, []models.Airport, error) { +func (h *Handler) getAirportByName(w http.ResponseWriter, r *http.Request) (int, []models.Airport, error) { airportName := r.FormValue("airport_name") countryName := r.FormValue("country_name") gmt := r.FormValue("gmt") @@ -71,6 +75,7 @@ func (h *Handler) getAirportByName(_ http.ResponseWriter, r *http.Request) (int, } ap, err := h.service.GetAirportByName(context.Background(), page, pageSize, orderBy, sortBy, airportName, countryName, gmt) if err != nil { + httperror.ErrNotFound.WriteError(w) return 0, nil, err } return page, ap, err @@ -120,6 +125,7 @@ func (h *Handler) renderAirportTable(w http.ResponseWriter, r *http.Request) (te lastPage, err := h.service.GetAllAirports() if err != nil { + httperror.ErrInternalServer.WriteError(w) HandleError(err, "Error fetching airports") return nil, err } @@ -155,20 +161,19 @@ func (h *Handler) renderSidebar() []models.SidebarItem { func (h *Handler) AirportPage(w http.ResponseWriter, r *http.Request) error { at, err := h.renderAirportTable(w, r) if err != nil { + httperror.ErrInternalServer.WriteError(w) HandleError(err, "Error fetching airport data table") return err } al, err := h.service.GetAirportsLocation() if err != nil { + httperror.ErrNotFound.WriteError(w) HandleError(err, "Error getting airport locations") return err } sidebar := h.renderSidebar() - if err != nil { - HandleError(err, "Error fetching airport data table") - return err - } + a := airport.AirportPage(at, sidebar, "Airports", "Check airport locations", al) return h.CreateLayout(w, r, "Airport Page", a).Render(context.Background(), w) } @@ -177,6 +182,7 @@ func (h *Handler) AirportLocationPage(w http.ResponseWriter, r *http.Request) er al, err := h.service.GetAirportsLocation() sidebar := h.renderSidebar() if err != nil { + httperror.ErrInternalServer.WriteError(w) HandleError(err, "Error fetching airport location table") return err } @@ -188,6 +194,7 @@ func (h *Handler) AirportDetailsPage(w http.ResponseWriter, r *http.Request) err ad, err := h.getAirportDetails(w, r) sidebar := h.renderSidebar() if err != nil { + httperror.ErrInternalServer.WriteError(w) HandleError(err, "Error fetching airport details page") return err } diff --git a/app/handlers/flights.go b/app/handlers/flights.go index 42dd1a1..5e4078d 100644 --- a/app/handlers/flights.go +++ b/app/handlers/flights.go @@ -7,6 +7,7 @@ import ( "context" + httperror "github.com/FACorreiaa/Aviation-tracker/app/errors" "github.com/FACorreiaa/Aviation-tracker/app/models" svg2 "github.com/FACorreiaa/Aviation-tracker/app/static/svg" "github.com/FACorreiaa/Aviation-tracker/app/view/components" @@ -67,7 +68,7 @@ func (h *Handler) renderLiveLocationsSidebar() []models.SidebarItem { return sidebar } -func (h *Handler) getFlights(_ http.ResponseWriter, r *http.Request) (int, []models.LiveFlights, error) { +func (h *Handler) getFlights(w http.ResponseWriter, r *http.Request) (int, []models.LiveFlights, error) { pageSize := 20 vars := mux.Vars(r) flightStatus := vars["flight_status"] @@ -95,19 +96,21 @@ func (h *Handler) getFlights(_ http.ResponseWriter, r *http.Request) (int, []mod } if err != nil { + httperror.ErrNotFound.WriteError(w) return 0, nil, err } return page, lf, nil } -func (h *Handler) getFlightsResumeByStatus(_ http.ResponseWriter, r *http.Request) (models.LiveFlightsResume, error) { +func (h *Handler) getFlightsResumeByStatus(w http.ResponseWriter, r *http.Request) (models.LiveFlightsResume, error) { vars := mux.Vars(r) flightStatus := vars["flight_status"] lfr, err := h.service.GetFlightResumeByStatus(context.Background(), flightStatus) if err != nil { + httperror.ErrNotFound.WriteError(w) return models.LiveFlightsResume{}, err } @@ -124,7 +127,7 @@ func (h *Handler) getFlightsResume() ([]models.LiveFlightsResume, error) { return lfr, nil } -func (h *Handler) getLiveFlights(_ http.ResponseWriter, r *http.Request) (int, []models.LiveFlights, error) { +func (h *Handler) getLiveFlights(w http.ResponseWriter, r *http.Request) (int, []models.LiveFlights, error) { pageSize := 20 // vars := mux.Vars(r) // flightStatus := vars["flight_status"] @@ -146,6 +149,7 @@ func (h *Handler) getLiveFlights(_ http.ResponseWriter, r *http.Request) (int, [ lf, err = h.service.GetLiveFlights(context.Background(), page, pageSize, orderBy, sortBy) if err != nil { + httperror.ErrNotFound.WriteError(w) return 0, nil, err } @@ -190,12 +194,12 @@ func (h *Handler) renderFlightsTable(w http.ResponseWriter, page, lf, err := h.getFlights(w, r) if err != nil { + httperror.ErrNotFound.WriteError(w) HandleError(err, "Error fetching total flights") return nil, err } if len(lf) == 0 { - // If empty, return a message component message := components.EmptyPageComponent() return message, nil } @@ -209,6 +213,7 @@ func (h *Handler) renderFlightsTable(w http.ResponseWriter, lastPage, err := h.service.GetAllFlightsSum() if err != nil { + httperror.ErrInternalServer.WriteError(w) HandleError(err, "Error fetching total flights") return nil, err } @@ -236,6 +241,7 @@ func (h *Handler) renderFlightsResumeByStatus(w http.ResponseWriter, resume, err := h.getFlightsResumeByStatus(w, r) if err != nil { + httperror.ErrNotFound.WriteError(w) HandleError(err, "Error fetching total flights") return components.EmptyPageComponent() } @@ -291,6 +297,7 @@ func (h *Handler) renderLiveFlightsTable(w http.ResponseWriter, page, lf, err := h.getLiveFlights(w, r) if err != nil { + httperror.ErrNotFound.WriteError(w) HandleError(err, "Error fetching total flights") return nil, err } @@ -309,6 +316,7 @@ func (h *Handler) renderLiveFlightsTable(w http.ResponseWriter, lastPage, err := h.service.GetAllFlightsSum() if err != nil { + httperror.ErrNotFound.WriteError(w) HandleError(err, "Error fetching total flights") return nil, err } diff --git a/app/handlers/handler.go b/app/handlers/handler.go index 7b8abc7..35521e6 100644 --- a/app/handlers/handler.go +++ b/app/handlers/handler.go @@ -60,6 +60,27 @@ func HandleError(err error, message string) { } } +//// HTTPError represents a structured HTTP error response +// type HTTPError struct { +// Message string `json:"message"` +// StatusCode int `json:"-"` +//} +// +//// NewHTTPError creates a new HTTPError +// func NewHTTPError(message string, statusCode int) *HTTPError { +// return &HTTPError{ +// Message: message, +// StatusCode: statusCode, +// } +//} +// +//// WriteHTTPError writes the HTTPError to the response writer +// func WriteHTTPError(w http.ResponseWriter, err *HTTPError) { +// w.Header().Set("Content-Type", "application/json") +// w.WriteHeader(err.StatusCode) +// json.NewEncoder(w).Encode(err) +//} + func (h *Handler) CreateLayout(_ http.ResponseWriter, r *http.Request, title string, data templ.Component) templ.Component { var user *models.UserSession diff --git a/app/handlers/locations.go b/app/handlers/locations.go index e70df2f..8b422c6 100644 --- a/app/handlers/locations.go +++ b/app/handlers/locations.go @@ -3,10 +3,10 @@ package handlers import ( "context" "errors" - "log" "net/http" "strconv" + httperror "github.com/FACorreiaa/Aviation-tracker/app/errors" "github.com/FACorreiaa/Aviation-tracker/app/models" svg2 "github.com/FACorreiaa/Aviation-tracker/app/static/svg" "github.com/FACorreiaa/Aviation-tracker/app/view/locations" @@ -62,10 +62,9 @@ func (h *Handler) getCities(_ http.ResponseWriter, r *http.Request) (int, []mode return page, c, nil } -func (h *Handler) getCityDetails(_ http.ResponseWriter, r *http.Request) (models.City, error) { +func (h *Handler) getCityDetails(w http.ResponseWriter, r *http.Request) (models.City, error) { vars := mux.Vars(r) idStr, ok := vars["city_id"] - log.Printf("Vars: %+v", vars) if !ok { err := errors.New("city_id not found in path") @@ -75,12 +74,14 @@ func (h *Handler) getCityDetails(_ http.ResponseWriter, r *http.Request) (models id, err := strconv.Atoi(idStr) if err != nil { + httperror.ErrInternalServer.WriteError(w) HandleError(err, "Error converting city_id to integer") return models.City{}, err } c, err := h.service.GetCityByID(context.Background(), id) if err != nil { + httperror.ErrInvalidID.WriteError(w) HandleError(err, "Error fetching city details") return models.City{}, err } @@ -104,7 +105,6 @@ func (h *Handler) renderCityTable(w http.ResponseWriter, r *http.Request) (templ sortAux = ASC } - // columnNames := []models.ColumnItems{ {Title: "City Name", Icon: svg2.ArrowOrderIcon(), SortParam: sortAux}, {Title: "Country Name", Icon: svg2.ArrowOrderIcon(), SortParam: sortAux}, @@ -127,6 +127,7 @@ func (h *Handler) renderCityTable(w http.ResponseWriter, r *http.Request) (templ lastPage, err := h.service.GetAllCities() if err != nil { + httperror.ErrNotFound.WriteError(w) HandleError(err, "Error fetching cities") return nil, err } @@ -153,6 +154,7 @@ func (h *Handler) CityMainPage(w http.ResponseWriter, r *http.Request) error { table, err := h.renderCityTable(w, r) sidebar := h.renderLocationsBar() if err != nil { + httperror.ErrInternalServer.WriteError(w) HandleError(err, "Error rendering table") return err } @@ -164,6 +166,7 @@ func (h *Handler) CityLocationsPage(w http.ResponseWriter, r *http.Request) erro sidebar := h.renderLocationsBar() c, err := h.service.GetCityLocations() if err != nil { + httperror.ErrNotFound.WriteError(w) HandleError(err, "Error fetching locations") return err } @@ -175,6 +178,7 @@ func (h *Handler) CityDetailsPage(w http.ResponseWriter, r *http.Request) error c, err := h.getCityDetails(w, r) sidebar := h.renderLocationsBar() if err != nil { + httperror.ErrInternalServer.WriteError(w) HandleError(err, "Error fetching city details page") return err } @@ -206,7 +210,7 @@ func (h *Handler) getCountries(_ http.ResponseWriter, r *http.Request) (int, []m return page, c, nil } -func (h *Handler) getCountryDetails(_ http.ResponseWriter, r *http.Request) (models.Country, error) { +func (h *Handler) getCountryDetails(w http.ResponseWriter, r *http.Request) (models.Country, error) { vars := mux.Vars(r) country, ok := vars["country_name"] if !ok { @@ -217,6 +221,7 @@ func (h *Handler) getCountryDetails(_ http.ResponseWriter, r *http.Request) (mod c, err := h.service.GetCountryByName(context.Background(), country) if err != nil { + httperror.ErrInvalidID.WriteError(w) HandleError(err, "Error fetching country details") return models.Country{}, err } @@ -264,6 +269,7 @@ func (h *Handler) renderCountryTable(w http.ResponseWriter, r *http.Request) (te lastPage, err := h.service.GetAllCountries() if err != nil { + httperror.ErrInternalServer.WriteError(w) return nil, err } @@ -289,15 +295,16 @@ func (h *Handler) renderCountryTable(w http.ResponseWriter, r *http.Request) (te func (h *Handler) CountryMainPage(w http.ResponseWriter, r *http.Request) error { taxTable, err := h.renderCountryTable(w, r) if err != nil { + httperror.ErrInternalServer.WriteError(w) HandleError(err, "Error rendering table") return err } country, err := h.service.GetCountryLocations() if err != nil { + httperror.ErrNotFound.WriteError(w) HandleError(err, "Error rendering country locations") return err } - sidebar := h.renderLocationsBar() c := locations.CountryLayoutPage("Countries", "Check countries of the world", taxTable, sidebar, country) @@ -308,6 +315,7 @@ func (h *Handler) CountryLocationPage(w http.ResponseWriter, r *http.Request) er sidebar := h.renderLocationsBar() c, err := h.service.GetCountryLocations() if err != nil { + httperror.ErrNotFound.WriteError(w) HandleError(err, "Error fetching countries") return err } @@ -321,6 +329,7 @@ func (h *Handler) CountryDetailsPage(w http.ResponseWriter, r *http.Request) err c, err := h.getCountryDetails(w, r) sidebar := h.renderLocationsBar() if err != nil { + httperror.ErrInternalServer.WriteError(w) HandleError(err, "Error fetching country details page") return err } diff --git a/app/static/css/output.css b/app/static/css/output.css index b091408..0518146 100644 --- a/app/static/css/output.css +++ b/app/static/css/output.css @@ -4442,6 +4442,10 @@ details.collapse summary::-webkit-details-marker { margin-left: auto; margin-right: auto; } +.my-0 { + margin-top: 0px; + margin-bottom: 0px; +} .my-12 { margin-top: 3rem; margin-bottom: 3rem; @@ -4664,6 +4668,9 @@ details.collapse summary::-webkit-details-marker { .w-6 { width: 1.5rem; } +.w-7 { + width: 1.75rem; +} .w-8 { width: 2rem; } @@ -4679,6 +4686,9 @@ details.collapse summary::-webkit-details-marker { .w-full { width: 100%; } +.max-w-3xl { + max-width: 48rem; +} .max-w-7xl { max-width: 80rem; } @@ -4971,12 +4981,18 @@ details.collapse summary::-webkit-details-marker { .p-10 { padding: 2.5rem; } +.p-16 { + padding: 4rem; +} .p-2 { padding: 0.5rem; } .p-2\.5 { padding: 0.625rem; } +.p-24 { + padding: 6rem; +} .p-3 { padding: 0.75rem; } @@ -4995,6 +5011,10 @@ details.collapse summary::-webkit-details-marker { padding-left: 3rem; padding-right: 3rem; } +.px-16 { + padding-left: 4rem; + padding-right: 4rem; +} .px-2 { padding-left: 0.5rem; padding-right: 0.5rem; diff --git a/app/static/icons/testing-copy.jpg b/app/static/icons/testing-copy.jpg deleted file mode 100644 index a9cdc3d..0000000 Binary files a/app/static/icons/testing-copy.jpg and /dev/null differ diff --git a/app/view/flights/FlightsResume.templ b/app/view/flights/FlightsResume.templ index a526aa3..a7a6820 100644 --- a/app/view/flights/FlightsResume.templ +++ b/app/view/flights/FlightsResume.templ @@ -7,7 +7,6 @@ import ( templ FlightsResume(resumes []models.LiveFlightsResume) {
diff --git a/app/view/flights/FlightsResumeByStatus_templ.go b/app/view/flights/FlightsResumeByStatus_templ.go index 2529dfc..7b38290 100644 --- a/app/view/flights/FlightsResumeByStatus_templ.go +++ b/app/view/flights/FlightsResumeByStatus_templ.go @@ -28,58 +28,45 @@ func FlightsResumeByStatus(flightStatus models.FlightStatus, airline string, cou templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("