add whatsapp button to report page

This commit is contained in:
Ruidy 2024-02-28 22:50:12 +01:00
parent ea039dc428
commit 3cf56095b7
No known key found for this signature in database
GPG key ID: E00F51288CB857CC
3 changed files with 17 additions and 16 deletions

View file

@ -15,7 +15,7 @@ Manage your holiday rental
- [ ] Calendar to store new booking in calendar
- [x] Seed the database with the existing data before using the new system with customer data
- [ ] Create a dashboard page with the Host details, bookings and revenue this month
- [ ] Edit campaigns and lines
- [x] Edit campaigns and lines
## Built With

View file

@ -27,6 +27,7 @@ templ ReportSection(report *ReportViewModel) {
<h2>Your report </h2>
<div>
<button class="outline">Create PDF</button>
<a href="https://web.whatsapp.com/" target="_blank" rel="noreferrer noopener"><img src="/static/icons/whatsapp.png" width="20px" style="width: 2rem; margin: 0 1rem"/></a>
</div>
</div>
<div class="overflow-auto">

View file

@ -45,7 +45,7 @@ func ReportSection(report *ReportViewModel) templ.Component {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"grid\"><h2>Your report </h2><div><button class=\"outline\">Create PDF</button></div></div><div class=\"overflow-auto\"><table class=\"striped\"><thead><tr><th scope=\"col\">ID</th><th scope=\"col\">Name</th><th scope=\"col\">From</th><th scope=\"col\">To</th><th scope=\"col\">Revenue (€)</th><th scope=\"col\">Platform</th><th scope=\"col\">Platform Fees (€)</th><th scope=\"col\">Fees (€)</th><th scope=\"col\">Profit (€)</th></tr></thead> <tbody>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"grid\"><h2>Your report </h2><div><button class=\"outline\">Create PDF</button> <a href=\"https://web.whatsapp.com/\" target=\"_blank\" rel=\"noreferrer noopener\"><img src=\"/static/icons/whatsapp.png\" width=\"20px\" style=\"width: 2rem; margin: 0 1rem\"></a></div></div><div class=\"overflow-auto\"><table class=\"striped\"><thead><tr><th scope=\"col\">ID</th><th scope=\"col\">Name</th><th scope=\"col\">From</th><th scope=\"col\">To</th><th scope=\"col\">Revenue (€)</th><th scope=\"col\">Platform</th><th scope=\"col\">Platform Fees (€)</th><th scope=\"col\">Fees (€)</th><th scope=\"col\">Profit (€)</th></tr></thead> <tbody>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@ -66,7 +66,7 @@ func ReportSection(report *ReportViewModel) templ.Component {
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(row.Id)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 51, Col: 16}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 52, Col: 16}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
@ -79,7 +79,7 @@ func ReportSection(report *ReportViewModel) templ.Component {
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(row.CustomerName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 54, Col: 28}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 55, Col: 28}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
@ -92,7 +92,7 @@ func ReportSection(report *ReportViewModel) templ.Component {
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(row.From)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 55, Col: 20}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 56, Col: 20}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
@ -105,7 +105,7 @@ func ReportSection(report *ReportViewModel) templ.Component {
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(row.To)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 56, Col: 18}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 57, Col: 18}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
@ -118,7 +118,7 @@ func ReportSection(report *ReportViewModel) templ.Component {
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(row.Total)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 57, Col: 21}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 58, Col: 21}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
@ -131,7 +131,7 @@ func ReportSection(report *ReportViewModel) templ.Component {
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(row.Platform)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 58, Col: 24}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 59, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
@ -144,7 +144,7 @@ func ReportSection(report *ReportViewModel) templ.Component {
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(row.PlatformFees)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 59, Col: 28}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 60, Col: 28}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
@ -157,7 +157,7 @@ func ReportSection(report *ReportViewModel) templ.Component {
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(row.Fee)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 60, Col: 19}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 61, Col: 19}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
@ -170,7 +170,7 @@ func ReportSection(report *ReportViewModel) templ.Component {
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(row.Profit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 61, Col: 22}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 62, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
@ -188,7 +188,7 @@ func ReportSection(report *ReportViewModel) templ.Component {
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(report.Total)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 71, Col: 23}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 72, Col: 23}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
if templ_7745c5c3_Err != nil {
@ -201,7 +201,7 @@ func ReportSection(report *ReportViewModel) templ.Component {
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(report.PlatformFees)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 73, Col: 30}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 74, Col: 30}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil {
@ -214,7 +214,7 @@ func ReportSection(report *ReportViewModel) templ.Component {
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(report.Fee)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 74, Col: 21}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 75, Col: 21}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil {
@ -227,7 +227,7 @@ func ReportSection(report *ReportViewModel) templ.Component {
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(report.Profit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 75, Col: 24}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 76, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil {
@ -240,7 +240,7 @@ func ReportSection(report *ReportViewModel) templ.Component {
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(report.CardTotal)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 82, Col: 27}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 83, Col: 27}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
if templ_7745c5c3_Err != nil {