diff --git a/internal/domain/config.go b/internal/domain/config.go index 3779ea8..0bea79f 100644 --- a/internal/domain/config.go +++ b/internal/domain/config.go @@ -15,5 +15,6 @@ type ( PayPal string `env:"PAYPAL"` Liberapay string `env:"LIBERAPAY"` YooMoney string `env:"YOOMONEY"` + Kofi string `env:"KOFI"` } ) diff --git a/web/static/styles.css b/web/static/styles.css index 8c5a95a..43482fd 100644 --- a/web/static/styles.css +++ b/web/static/styles.css @@ -99,6 +99,12 @@ button[href*='yoomoney.ru'] { --color: hsl(0, 0%, 100%); } +.button[href*='ko-fi.com'], +button[href*='ko-fi.com'] { + --background: hsl(199, 100%, 42%); + --color: hsl(0, 0%, 100%); +} + .with-icon .icon, .button .icon, .button svg, diff --git a/web/template/template.qtpl b/web/template/template.qtpl index 60ca6ef..0a1214b 100644 --- a/web/template/template.qtpl +++ b/web/template/template.qtpl @@ -139,6 +139,20 @@ func NewContext(processors domain.ConfigProcessors, lang language.Tag, amount ui {% endif %} + {% if ctx.processors.Kofi != "" %} +
  • + + + {%= icon("kofi") %} + Ko-fi + +
  • + {% endif %} {% endfunc %} @@ -229,6 +243,27 @@ func NewContext(processors domain.ConfigProcessors, lang language.Tag, amount ui + {% case "kofi" %} + {% endswitch %} {% endfunc %} {% endstripspace %} diff --git a/web/template/template.qtpl.go b/web/template/template.qtpl.go index da8089e..d6acd6f 100644 --- a/web/template/template.qtpl.go +++ b/web/template/template.qtpl.go @@ -384,107 +384,74 @@ func (ctx Context) streambody(qw422016 *qt422016.Writer) { qw422016.N().S(`ЮMoney`) //line web/template/template.qtpl:141 } -//line web/template/template.qtpl:141 - qw422016.N().S(``) -//line web/template/template.qtpl:143 -} - -//line web/template/template.qtpl:143 -func (ctx Context) writebody(qq422016 qtio422016.Writer) { -//line web/template/template.qtpl:143 - qw422016 := qt422016.AcquireWriter(qq422016) -//line web/template/template.qtpl:143 - ctx.streambody(qw422016) -//line web/template/template.qtpl:143 - qt422016.ReleaseWriter(qw422016) -//line web/template/template.qtpl:143 -} - -//line web/template/template.qtpl:143 -func (ctx Context) body() string { -//line web/template/template.qtpl:143 - qb422016 := qt422016.AcquireByteBuffer() -//line web/template/template.qtpl:143 - ctx.writebody(qb422016) -//line web/template/template.qtpl:143 - qs422016 := string(qb422016.B) -//line web/template/template.qtpl:143 - qt422016.ReleaseByteBuffer(qb422016) -//line web/template/template.qtpl:143 - return qs422016 -//line web/template/template.qtpl:143 -} - +//line web/template/template.qtpl:142 + if ctx.processors.Kofi != "" { +//line web/template/template.qtpl:142 + qw422016.N().S(`
  • `) //line web/template/template.qtpl:151 - } -//line web/template/template.qtpl:152 -} - -//line web/template/template.qtpl:152 -func (ctx Context) writedir(qq422016 qtio422016.Writer) { -//line web/template/template.qtpl:152 - qw422016 := qt422016.AcquireWriter(qq422016) -//line web/template/template.qtpl:152 - ctx.streamdir(qw422016) -//line web/template/template.qtpl:152 - qt422016.ReleaseWriter(qw422016) -//line web/template/template.qtpl:152 -} - -//line web/template/template.qtpl:152 -func (ctx Context) dir() string { -//line web/template/template.qtpl:152 - qb422016 := qt422016.AcquireByteBuffer() -//line web/template/template.qtpl:152 - ctx.writedir(qb422016) -//line web/template/template.qtpl:152 - qs422016 := string(qb422016.B) -//line web/template/template.qtpl:152 - qt422016.ReleaseByteBuffer(qb422016) -//line web/template/template.qtpl:152 - return qs422016 -//line web/template/template.qtpl:152 -} - -//line web/template/template.qtpl:154 -func (ctx Context) streamlang(qw422016 *qt422016.Writer) { + streamicon(qw422016, "kofi") +//line web/template/template.qtpl:151 + qw422016.N().S(`Ko-fi
  • `) //line web/template/template.qtpl:155 - base, _ := ctx.language.Base() - -//line web/template/template.qtpl:156 - qw422016.E().S(base.String()) + } +//line web/template/template.qtpl:155 + qw422016.N().S(``) //line web/template/template.qtpl:157 } //line web/template/template.qtpl:157 -func (ctx Context) writelang(qq422016 qtio422016.Writer) { +func (ctx Context) writebody(qq422016 qtio422016.Writer) { //line web/template/template.qtpl:157 qw422016 := qt422016.AcquireWriter(qq422016) //line web/template/template.qtpl:157 - ctx.streamlang(qw422016) + ctx.streambody(qw422016) //line web/template/template.qtpl:157 qt422016.ReleaseWriter(qw422016) //line web/template/template.qtpl:157 } //line web/template/template.qtpl:157 -func (ctx Context) lang() string { +func (ctx Context) body() string { //line web/template/template.qtpl:157 qb422016 := qt422016.AcquireByteBuffer() //line web/template/template.qtpl:157 - ctx.writelang(qb422016) + ctx.writebody(qb422016) //line web/template/template.qtpl:157 qs422016 := string(qb422016.B) //line web/template/template.qtpl:157 @@ -495,245 +462,352 @@ func (ctx Context) lang() string { } //line web/template/template.qtpl:159 -func (ctx Context) streamt(qw422016 *qt422016.Writer, format message.Reference, v ...any) { +func (ctx Context) streamdir(qw422016 *qt422016.Writer) { //line web/template/template.qtpl:160 - qw422016.E().S(ctx.printer.Sprintf(format, v...)) + switch ctx.language { //line web/template/template.qtpl:161 -} - + default: //line web/template/template.qtpl:161 -func (ctx Context) writet(qq422016 qtio422016.Writer, format message.Reference, v ...any) { -//line web/template/template.qtpl:161 - qw422016 := qt422016.AcquireWriter(qq422016) -//line web/template/template.qtpl:161 - ctx.streamt(qw422016, format, v...) -//line web/template/template.qtpl:161 - qt422016.ReleaseWriter(qw422016) -//line web/template/template.qtpl:161 -} - -//line web/template/template.qtpl:161 -func (ctx Context) t(format message.Reference, v ...any) string { -//line web/template/template.qtpl:161 - qb422016 := qt422016.AcquireByteBuffer() -//line web/template/template.qtpl:161 - ctx.writet(qb422016, format, v...) -//line web/template/template.qtpl:161 - qs422016 := string(qb422016.B) -//line web/template/template.qtpl:161 - qt422016.ReleaseByteBuffer(qb422016) -//line web/template/template.qtpl:161 - return qs422016 -//line web/template/template.qtpl:161 -} - + qw422016.N().S(`ltr`) //line web/template/template.qtpl:163 -func (ctx Context) streamtitle(qw422016 *qt422016.Writer) { + case language.Arabic, language.Persian, language.Hebrew, language.Urdu: //line web/template/template.qtpl:163 - qw422016.N().S(`NotDotPay`) + qw422016.N().S(`rtl`) //line web/template/template.qtpl:165 -} - -//line web/template/template.qtpl:165 -func (ctx Context) writetitle(qq422016 qtio422016.Writer) { -//line web/template/template.qtpl:165 - qw422016 := qt422016.AcquireWriter(qq422016) -//line web/template/template.qtpl:165 - ctx.streamtitle(qw422016) -//line web/template/template.qtpl:165 - qt422016.ReleaseWriter(qw422016) -//line web/template/template.qtpl:165 -} - -//line web/template/template.qtpl:165 -func (ctx Context) title() string { -//line web/template/template.qtpl:165 - qb422016 := qt422016.AcquireByteBuffer() -//line web/template/template.qtpl:165 - ctx.writetitle(qb422016) -//line web/template/template.qtpl:165 - qs422016 := string(qb422016.B) -//line web/template/template.qtpl:165 - qt422016.ReleaseByteBuffer(qb422016) -//line web/template/template.qtpl:165 - return qs422016 -//line web/template/template.qtpl:165 -} - -//line web/template/template.qtpl:167 -func StreamTemplate(qw422016 *qt422016.Writer, p Page) { -//line web/template/template.qtpl:167 - qw422016.N().S(`NotDotPay`) -//line web/template/template.qtpl:177 - p.streamhead(qw422016) -//line web/template/template.qtpl:177 - qw422016.N().S(``) -//line web/template/template.qtpl:181 - p.streambody(qw422016) -//line web/template/template.qtpl:181 - qw422016.N().S(``) -//line web/template/template.qtpl:189 -} - -//line web/template/template.qtpl:189 -func WriteTemplate(qq422016 qtio422016.Writer, p Page) { -//line web/template/template.qtpl:189 - qw422016 := qt422016.AcquireWriter(qq422016) -//line web/template/template.qtpl:189 - StreamTemplate(qw422016, p) -//line web/template/template.qtpl:189 - qt422016.ReleaseWriter(qw422016) -//line web/template/template.qtpl:189 -} - -//line web/template/template.qtpl:189 -func Template(p Page) string { -//line web/template/template.qtpl:189 - qb422016 := qt422016.AcquireByteBuffer() -//line web/template/template.qtpl:189 - WriteTemplate(qb422016, p) -//line web/template/template.qtpl:189 - qs422016 := string(qb422016.B) -//line web/template/template.qtpl:189 - qt422016.ReleaseByteBuffer(qb422016) -//line web/template/template.qtpl:189 - return qs422016 -//line web/template/template.qtpl:189 -} - -//line web/template/template.qtpl:191 -func streamicon(qw422016 *qt422016.Writer, id string) { -//line web/template/template.qtpl:192 - switch id { -//line web/template/template.qtpl:193 - case "liberapay": -//line web/template/template.qtpl:193 - qw422016.N().S(``) -//line web/template/template.qtpl:204 - case "paypal": -//line web/template/template.qtpl:204 - qw422016.N().S(``) -//line web/template/template.qtpl:213 - qw422016.N().S(``) -//line web/template/template.qtpl:215 - qw422016.N().S(``) -//line web/template/template.qtpl:217 - qw422016.N().S(``) -//line web/template/template.qtpl:220 - case "yoomoney": -//line web/template/template.qtpl:220 - qw422016.N().S(``) -//line web/template/template.qtpl:232 } -//line web/template/template.qtpl:233 +//line web/template/template.qtpl:166 } -//line web/template/template.qtpl:233 -func writeicon(qq422016 qtio422016.Writer, id string) { -//line web/template/template.qtpl:233 +//line web/template/template.qtpl:166 +func (ctx Context) writedir(qq422016 qtio422016.Writer) { +//line web/template/template.qtpl:166 qw422016 := qt422016.AcquireWriter(qq422016) -//line web/template/template.qtpl:233 - streamicon(qw422016, id) -//line web/template/template.qtpl:233 +//line web/template/template.qtpl:166 + ctx.streamdir(qw422016) +//line web/template/template.qtpl:166 qt422016.ReleaseWriter(qw422016) -//line web/template/template.qtpl:233 +//line web/template/template.qtpl:166 } -//line web/template/template.qtpl:233 -func icon(id string) string { -//line web/template/template.qtpl:233 +//line web/template/template.qtpl:166 +func (ctx Context) dir() string { +//line web/template/template.qtpl:166 qb422016 := qt422016.AcquireByteBuffer() -//line web/template/template.qtpl:233 - writeicon(qb422016, id) -//line web/template/template.qtpl:233 +//line web/template/template.qtpl:166 + ctx.writedir(qb422016) +//line web/template/template.qtpl:166 qs422016 := string(qb422016.B) -//line web/template/template.qtpl:233 +//line web/template/template.qtpl:166 qt422016.ReleaseByteBuffer(qb422016) -//line web/template/template.qtpl:233 +//line web/template/template.qtpl:166 return qs422016 -//line web/template/template.qtpl:233 +//line web/template/template.qtpl:166 +} + +//line web/template/template.qtpl:168 +func (ctx Context) streamlang(qw422016 *qt422016.Writer) { +//line web/template/template.qtpl:169 + base, _ := ctx.language.Base() + +//line web/template/template.qtpl:170 + qw422016.E().S(base.String()) +//line web/template/template.qtpl:171 +} + +//line web/template/template.qtpl:171 +func (ctx Context) writelang(qq422016 qtio422016.Writer) { +//line web/template/template.qtpl:171 + qw422016 := qt422016.AcquireWriter(qq422016) +//line web/template/template.qtpl:171 + ctx.streamlang(qw422016) +//line web/template/template.qtpl:171 + qt422016.ReleaseWriter(qw422016) +//line web/template/template.qtpl:171 +} + +//line web/template/template.qtpl:171 +func (ctx Context) lang() string { +//line web/template/template.qtpl:171 + qb422016 := qt422016.AcquireByteBuffer() +//line web/template/template.qtpl:171 + ctx.writelang(qb422016) +//line web/template/template.qtpl:171 + qs422016 := string(qb422016.B) +//line web/template/template.qtpl:171 + qt422016.ReleaseByteBuffer(qb422016) +//line web/template/template.qtpl:171 + return qs422016 +//line web/template/template.qtpl:171 +} + +//line web/template/template.qtpl:173 +func (ctx Context) streamt(qw422016 *qt422016.Writer, format message.Reference, v ...any) { +//line web/template/template.qtpl:174 + qw422016.E().S(ctx.printer.Sprintf(format, v...)) +//line web/template/template.qtpl:175 +} + +//line web/template/template.qtpl:175 +func (ctx Context) writet(qq422016 qtio422016.Writer, format message.Reference, v ...any) { +//line web/template/template.qtpl:175 + qw422016 := qt422016.AcquireWriter(qq422016) +//line web/template/template.qtpl:175 + ctx.streamt(qw422016, format, v...) +//line web/template/template.qtpl:175 + qt422016.ReleaseWriter(qw422016) +//line web/template/template.qtpl:175 +} + +//line web/template/template.qtpl:175 +func (ctx Context) t(format message.Reference, v ...any) string { +//line web/template/template.qtpl:175 + qb422016 := qt422016.AcquireByteBuffer() +//line web/template/template.qtpl:175 + ctx.writet(qb422016, format, v...) +//line web/template/template.qtpl:175 + qs422016 := string(qb422016.B) +//line web/template/template.qtpl:175 + qt422016.ReleaseByteBuffer(qb422016) +//line web/template/template.qtpl:175 + return qs422016 +//line web/template/template.qtpl:175 +} + +//line web/template/template.qtpl:177 +func (ctx Context) streamtitle(qw422016 *qt422016.Writer) { +//line web/template/template.qtpl:177 + qw422016.N().S(`NotDotPay`) +//line web/template/template.qtpl:179 +} + +//line web/template/template.qtpl:179 +func (ctx Context) writetitle(qq422016 qtio422016.Writer) { +//line web/template/template.qtpl:179 + qw422016 := qt422016.AcquireWriter(qq422016) +//line web/template/template.qtpl:179 + ctx.streamtitle(qw422016) +//line web/template/template.qtpl:179 + qt422016.ReleaseWriter(qw422016) +//line web/template/template.qtpl:179 +} + +//line web/template/template.qtpl:179 +func (ctx Context) title() string { +//line web/template/template.qtpl:179 + qb422016 := qt422016.AcquireByteBuffer() +//line web/template/template.qtpl:179 + ctx.writetitle(qb422016) +//line web/template/template.qtpl:179 + qs422016 := string(qb422016.B) +//line web/template/template.qtpl:179 + qt422016.ReleaseByteBuffer(qb422016) +//line web/template/template.qtpl:179 + return qs422016 +//line web/template/template.qtpl:179 +} + +//line web/template/template.qtpl:181 +func StreamTemplate(qw422016 *qt422016.Writer, p Page) { +//line web/template/template.qtpl:181 + qw422016.N().S(`NotDotPay`) +//line web/template/template.qtpl:191 + p.streamhead(qw422016) +//line web/template/template.qtpl:191 + qw422016.N().S(``) +//line web/template/template.qtpl:195 + p.streambody(qw422016) +//line web/template/template.qtpl:195 + qw422016.N().S(``) +//line web/template/template.qtpl:203 +} + +//line web/template/template.qtpl:203 +func WriteTemplate(qq422016 qtio422016.Writer, p Page) { +//line web/template/template.qtpl:203 + qw422016 := qt422016.AcquireWriter(qq422016) +//line web/template/template.qtpl:203 + StreamTemplate(qw422016, p) +//line web/template/template.qtpl:203 + qt422016.ReleaseWriter(qw422016) +//line web/template/template.qtpl:203 +} + +//line web/template/template.qtpl:203 +func Template(p Page) string { +//line web/template/template.qtpl:203 + qb422016 := qt422016.AcquireByteBuffer() +//line web/template/template.qtpl:203 + WriteTemplate(qb422016, p) +//line web/template/template.qtpl:203 + qs422016 := string(qb422016.B) +//line web/template/template.qtpl:203 + qt422016.ReleaseByteBuffer(qb422016) +//line web/template/template.qtpl:203 + return qs422016 +//line web/template/template.qtpl:203 +} + +//line web/template/template.qtpl:205 +func streamicon(qw422016 *qt422016.Writer, id string) { +//line web/template/template.qtpl:206 + switch id { +//line web/template/template.qtpl:207 + case "liberapay": +//line web/template/template.qtpl:207 + qw422016.N().S(``) +//line web/template/template.qtpl:218 + case "paypal": +//line web/template/template.qtpl:218 + qw422016.N().S(``) +//line web/template/template.qtpl:227 + qw422016.N().S(``) +//line web/template/template.qtpl:229 + qw422016.N().S(``) +//line web/template/template.qtpl:231 + qw422016.N().S(``) +//line web/template/template.qtpl:234 + case "yoomoney": +//line web/template/template.qtpl:234 + qw422016.N().S(``) +//line web/template/template.qtpl:246 + case "kofi": +//line web/template/template.qtpl:246 + qw422016.N().S(``) +//line web/template/template.qtpl:267 + } +//line web/template/template.qtpl:268 +} + +//line web/template/template.qtpl:268 +func writeicon(qq422016 qtio422016.Writer, id string) { +//line web/template/template.qtpl:268 + qw422016 := qt422016.AcquireWriter(qq422016) +//line web/template/template.qtpl:268 + streamicon(qw422016, id) +//line web/template/template.qtpl:268 + qt422016.ReleaseWriter(qw422016) +//line web/template/template.qtpl:268 +} + +//line web/template/template.qtpl:268 +func icon(id string) string { +//line web/template/template.qtpl:268 + qb422016 := qt422016.AcquireByteBuffer() +//line web/template/template.qtpl:268 + writeicon(qb422016, id) +//line web/template/template.qtpl:268 + qs422016 := string(qb422016.B) +//line web/template/template.qtpl:268 + qt422016.ReleaseByteBuffer(qb422016) +//line web/template/template.qtpl:268 + return qs422016 +//line web/template/template.qtpl:268 }