Skip to content

Commit

Permalink
add create buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
leedrum committed Dec 10, 2024
1 parent 5bcb803 commit 067b2bd
Show file tree
Hide file tree
Showing 8 changed files with 314 additions and 181 deletions.
10 changes: 10 additions & 0 deletions views/admin/list_hotels.templ
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,22 @@ import (
"github.com/leedrum/ikarus_travel/model"
"github.com/leedrum/ikarus_travel/views/components"
"github.com/leedrum/ikarus_travel/locales"
"github.com/leedrum/ikarus_travel/views/icons"
)

templ ListHotels(hotels []model.Hotel) {
@components.AdminLayout("List Hotels"){
<div class="w-full">
<div class="mx-auto w-full">
if ctx.Value("user").(model.User).Role == model.RoleAdmin {
<div class="flex justify-between items-center">
<a href={ templ.SafeURL("/admin/hotels/new") }
class="btn primary flex items-center text-black-700 border border-black-700 hover:bg-border-0 font-medium rounded-lg text-sm p-2.5 text-center inline-flex items-center me-2" type="button">
@icons.Hotel()
+
</a>
</div>
}
<div class="w-full my-2" id="error-area"></div>
<div class="w-full my-2" id="success-area"></div>
<table class="w-full">
Expand Down
120 changes: 74 additions & 46 deletions views/admin/list_hotels_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions views/admin/list_reservations.templ
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,22 @@ import (
"github.com/leedrum/ikarus_travel/model"
"github.com/leedrum/ikarus_travel/views/components"
"github.com/leedrum/ikarus_travel/locales"
"github.com/leedrum/ikarus_travel/views/icons"
)

templ ListReservations(reservations []model.Reservation) {
@components.AdminLayout("List Hotels"){
<div class="w-full">
<div class="mx-auto w-full">
if ctx.Value("user").(model.User).Role == model.RoleAdmin {
<div class="flex justify-between items-center">
<a href={ templ.SafeURL("/admin/hotels/new") }
class="btn primary flex items-center text-black-700 border border-black-700 hover:bg-border-0 font-medium rounded-lg text-sm p-2.5 text-center inline-flex items-center me-2" type="button">
@icons.Reservation()
+
</a>
</div>
}
<div class="w-full my-2" id="error-area"></div>
<div class="w-full my-2" id="success-area"></div>
<table class="w-full">
Expand Down
Loading

0 comments on commit 067b2bd

Please sign in to comment.