-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
layout_templ.go
112 lines (107 loc) · 9.76 KB
/
layout_templ.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.543
package components
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import "context"
import "io"
import "bytes"
import "github.com/dmitrymomot/mailer/template/utils"
import "braces.dev/errtrace"
func Layout(lang, subject, previewText string) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!doctype html><html lang=\"")
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(lang))
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\"><head><meta charset=\"utf-8\"><meta http-equiv=\"x-ua-compatible\" content=\"ie=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><meta name=\"x-apple-disable-message-reformatting\"><title>")
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(subject)
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ.Error{Err: templ_7745c5c3_Err, FileName: `template/components/layout.templ`, Line: 12, Col: 19})
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</title><!--[if mso]>\n <xml>\n <o:OfficeDocumentSettings>\n <o:PixelsPerInch>96</o:PixelsPerInch>\n </o:OfficeDocumentSettings>\n </xml>\n <style>\n table {border-collapse: collapse;}\n .spacer,.divider {mso-line-height-rule: exactly;}\n td,th,div,p,a {font-size: 16px; line-height: 25px;}\n td,th,div,p,a,h1,h2,h3,h4,h5,h6 {font-family:\"Segoe UI\",Helvetica,Arial,sans-serif;}\n </style>\n <![endif]--><style type=\"text/css\">\n\n @import url('https://fonts.googleapis.com/css?family=Merriweather|Open+Sans');\n\n img {border: 0; line-height: 100%; vertical-align: middle;}\n .col {font-size: 16px; line-height: 25px; vertical-align: top;}\n\n @media screen {\n .col, td, th, div, p {font-family: -apple-system,system-ui,BlinkMacSystemFont,\"Segoe UI\",\"Roboto\",\"Helvetica Neue\",Arial,sans-serif;}\n .sans-serif {font-family: 'Open Sans', Arial, sans-serif;}\n .serif {font-family: 'Merriweather', Georgia, serif;}\n img {max-width: 100%;}\n }\n\n @media (max-width: 632px) {\n .container {width: 100%!important;}\n }\n\n @media (max-width: 480px) {\n .col {\n display: inline-block!important;\n line-height: 23px;\n width: 100%!important;\n }\n\n .col-sm-1 {max-width: 25%;}\n .col-sm-2 {max-width: 50%;}\n .col-sm-3 {max-width: 75%;}\n .col-sm-third {max-width: 33.33333%;}\n\n .col-sm-push-1 {margin-left: 25%;}\n .col-sm-push-2 {margin-left: 50%;}\n .col-sm-push-3 {margin-left: 75%;}\n .col-sm-push-third {margin-left: 33.33333%;}\n\n .full-width-sm {display: table!important; width: 100%!important;}\n .stack-sm-first {display: table-header-group!important;}\n .stack-sm-last {display: table-footer-group!important;}\n .stack-sm-top {display: table-caption!important; max-width: 100%; padding-left: 0!important;}\n\n .toggle-content {\n max-height: 0;\n overflow: auto;\n transition: max-height .4s linear;\n -webkit-transition: max-height .4s linear;\n }\n .toggle-trigger:hover + .toggle-content,\n .toggle-content:hover {max-height: 999px!important;}\n\n .show-sm {\n display: inherit!important;\n font-size: inherit!important;\n line-height: inherit!important;\n max-height: none!important;\n }\n .hide-sm {display: none!important;}\n\n .align-sm-center {\n display: table!important;\n float: none;\n margin-left: auto!important;\n margin-right: auto!important;\n }\n .align-sm-left {float: left;}\n .align-sm-right {float: right;}\n\n .text-sm-center {text-align: center!important;}\n .text-sm-left {text-align: left!important;}\n .text-sm-right {text-align: right!important;}\n\n .borderless-sm {border: none!important;}\n .nav-sm-vertical .nav-item {display: block;}\n .nav-sm-vertical .nav-item a {display: inline-block; padding: 4px 0!important;}\n\n .spacer {height: 0;}\n\n .p-sm-0 {padding: 0!important;}\n .p-sm-8 {padding: 8px!important;}\n .p-sm-16 {padding: 16px!important;}\n .p-sm-24 {padding: 24px!important;}\n .pt-sm-0 {padding-top: 0!important;}\n .pt-sm-8 {padding-top: 8px!important;}\n .pt-sm-16 {padding-top: 16px!important;}\n .pt-sm-24 {padding-top: 24px!important;}\n .pr-sm-0 {padding-right: 0!important;}\n .pr-sm-8 {padding-right: 8px!important;}\n .pr-sm-16 {padding-right: 16px!important;}\n .pr-sm-24 {padding-right: 24px!important;}\n .pb-sm-0 {padding-bottom: 0!important;}\n .pb-sm-8 {padding-bottom: 8px!important;}\n .pb-sm-16 {padding-bottom: 16px!important;}\n .pb-sm-24 {padding-bottom: 24px!important;}\n .pl-sm-0 {padding-left: 0!important;}\n .pl-sm-8 {padding-left: 8px!important;}\n .pl-sm-16 {padding-left: 16px!important;}\n .pl-sm-24 {padding-left: 24px!important;}\n .px-sm-0 {padding-right: 0!important; padding-left: 0!important;}\n .px-sm-8 {padding-right: 8px!important; padding-left: 8px!important;}\n .px-sm-16 {padding-right: 16px!important; padding-left: 16px!important;}\n .px-sm-24 {padding-right: 24px!important; padding-left: 24px!important;}\n .py-sm-0 {padding-top: 0!important; padding-bottom: 0!important;}\n .py-sm-8 {padding-top: 8px!important; padding-bottom: 8px!important;}\n .py-sm-16 {padding-top: 16px!important; padding-bottom: 16px!important;}\n .py-sm-24 {padding-top: 24px!important; padding-bottom: 24px!important;}\n }\n </style></head><body style=\"margin:0;padding:0;width:100%;word-break:break-word;-webkit-font-smoothing:antialiased;background-color:#f3f4f6;\"><div lang=\"")
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(lang))
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" style=\"display:none;\">")
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(previewText)
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ.Error{Err: templ_7745c5c3_Err, FileName: `template/components/layout.templ`, Line: 135, Col: 17})
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><table lang=\"")
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(lang))
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" bgcolor=\"")
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(utils.BgGray100.String()))
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" cellpadding=\"16\" cellspacing=\"0\" role=\"presentation\" width=\"100%\"><tr><td align=\"center\"><table class=\"container\" bgcolor=\"")
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(utils.Transparent.String()))
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"550\"><tr><td align=\"left\">")
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td></tr></table></td></tr></table></body></html>")
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return errtrace.Wrap(templ_7745c5c3_Err)
})
}