mirror of
https://github.com/Theodor-Springmann-Stiftung/kgpz_web.git
synced 2025-10-29 17:15:31 +00:00
better orte
This commit is contained in:
@@ -3,6 +3,7 @@ package app
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/Theodor-Springmann-Stiftung/kgpz_web/controllers"
|
||||
@@ -212,6 +213,14 @@ func (k *KGPZ) Funcs() map[string]interface{} {
|
||||
e["GetGND"] = k.GND.Person
|
||||
e["GetGeonames"] = k.Geonames.Place
|
||||
|
||||
// Math functions
|
||||
e["sub"] = func(a, b int) int { return a - b }
|
||||
e["add"] = func(a, b int) int { return a + b }
|
||||
|
||||
// String functions
|
||||
e["contains"] = func(s, substr string) bool { return strings.Contains(s, substr) }
|
||||
e["lower"] = func(s string) string { return strings.ToLower(s) }
|
||||
|
||||
e["LookupPieces"] = k.Library.Pieces.ReverseLookup
|
||||
e["LookupWorks"] = k.Library.Works.ReverseLookup
|
||||
e["LookupIssues"] = k.Library.Issues.ReverseLookup
|
||||
|
||||
Reference in New Issue
Block a user