Impressum hinzugefügt
All checks were successful
release-tag / release-image (push) Successful in 2m42s
All checks were successful
release-tag / release-image (push) Successful in 2m42s
This commit is contained in:
26
main.go
26
main.go
@@ -31,10 +31,12 @@ func Enabled(k string, def bool) bool {
|
||||
}
|
||||
|
||||
var (
|
||||
username = GetENV("KT_USERNAME", "root")
|
||||
password = GetENV("KT_PASSWORD", "root")
|
||||
membername = GetENV("KT_MEMBER", "demo")
|
||||
productive = Enabled("KT_PRODUCTIVE", false)
|
||||
username = GetENV("KT_USERNAME", "root")
|
||||
password = GetENV("KT_PASSWORD", "root")
|
||||
membername = GetENV("KT_MEMBER", "demo")
|
||||
productive = Enabled("KT_PRODUCTIVE", false)
|
||||
hasimpressum = false
|
||||
impressum = GetENV("KT_IMPRESSUM", "")
|
||||
)
|
||||
|
||||
type Entry struct {
|
||||
@@ -329,6 +331,13 @@ func main() {
|
||||
abteilungen[i].WertOffen = (abteilungen[i].Anteil / 100) * offeneSumme
|
||||
}
|
||||
|
||||
if impressum == "" {
|
||||
hasimpressum = false
|
||||
impressum = ""
|
||||
} else {
|
||||
hasimpressum = true
|
||||
}
|
||||
|
||||
tmpl.Execute(w, struct {
|
||||
Entries []Entry
|
||||
Summe float64
|
||||
@@ -337,6 +346,8 @@ func main() {
|
||||
Monatsstatistik []Monatsstatistik
|
||||
LoggedIn bool
|
||||
Member string
|
||||
HasImpressum bool
|
||||
Impressum string
|
||||
}{
|
||||
Entries: eintraege,
|
||||
Summe: summe,
|
||||
@@ -345,6 +356,8 @@ func main() {
|
||||
Monatsstatistik: monatsStat,
|
||||
LoggedIn: isAuthenticated(r),
|
||||
Member: membername,
|
||||
HasImpressum: hasimpressum,
|
||||
Impressum: impressum,
|
||||
})
|
||||
})
|
||||
|
||||
@@ -635,6 +648,11 @@ const htmlTemplate = `
|
||||
<button type="submit" class="btn btn-outline-danger mt-3">Alle Einträge löschen</button>
|
||||
</form>
|
||||
{{end}}
|
||||
{{if .HasImpressum}}
|
||||
<div class="alert alert-light">
|
||||
<strong><a href="{{.Impressum}}">Impressum</a></strong>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<script src="/static/js/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
|
Reference in New Issue
Block a user