fix: restructure env handling for better testing capabillities #181
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 47s
Build and Push Docker Image / Explore-Gitea-Actions (push) Successful in 55s

This commit was merged in pull request #195.
This commit is contained in:
2024-09-29 23:51:23 +02:00
parent 25e82be339
commit a70138f2f7
15 changed files with 191 additions and 152 deletions

View File

@@ -1,8 +1,6 @@
package template
import "me-fit/utils"
templ Layout(slot templ.Component, user templ.Component) {
templ Layout(slot templ.Component, user templ.Component, environment string) {
<!DOCTYPE html>
<html lang="en">
<head>
@@ -11,7 +9,7 @@ templ Layout(slot templ.Component, user templ.Component) {
<link rel="icon" href="/static/favicon.svg"/>
<link rel="stylesheet" href="/static/css/tailwind.css"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
if utils.Environment == "prod" {
if environment == "prod" {
<script defer src="https://umami.me-fit.eu/script.js" data-website-id="3c8efb09-44e4-4372-8a1e-c3bc675cd89a"></script>
}
<script src="/static/js/htmx.min.js"></script>

View File

@@ -1,11 +1,8 @@
package mail;
import (
"me-fit/utils"
"net/url"
)
import "net/url"
templ Register(token string) {
templ Register(baseUrl string, token string) {
<!DOCTYPE html>
<html lang="en">
<head>
@@ -15,7 +12,7 @@ templ Register(token string) {
</head>
<body>
<h4>Thank you for Sign Up!</h4>
<p>Click <a href={ templ.URL(utils.BaseUrl + "/auth/verify-email?token=" + url.QueryEscape(token)) }>here</a> to verify your account.</p>
<p>Click <a href={ templ.URL(baseUrl + "/auth/verify-email?token=" + url.QueryEscape(token)) }>here</a> to verify your account.</p>
<p>Kind regards</p>
</body>
</html>

View File

@@ -1,11 +1,8 @@
package mail;
import (
"me-fit/utils"
"net/url"
)
import "net/url"
templ ResetPassword(token string) {
templ ResetPassword(baseUrl string, token string) {
<!DOCTYPE html>
<html lang="en">
<head>
@@ -15,7 +12,7 @@ templ ResetPassword(token string) {
</head>
<body>
<h4>Reset your password</h4>
<p>Click <a href={ templ.URL(utils.BaseUrl + "/auth/change-password?token=" + url.QueryEscape(token)) }>here</a> to change your password.</p>
<p>Click <a href={ templ.URL(baseUrl + "/auth/change-password?token=" + url.QueryEscape(token)) }>here</a> to change your password.</p>
<p>Kind regards</p>
</body>
</html>