small updates
This commit is contained in:
parent
439f819989
commit
59c6ce9da6
|
@ -231,7 +231,7 @@ func (h *ApplicationHandler) AgendaSubscribeEvent(w http.ResponseWriter, r *http
|
|||
"subscribed_by": map[string]any{
|
||||
"user": map[string]any{
|
||||
"id": current_user_token.Subject,
|
||||
"display_name": current_user_claims["display_name"],
|
||||
"display_name": fmt.Sprintf("%s %s", current_user_claims["first_name"], current_user_claims["last_name"]),
|
||||
},
|
||||
"group": map[string]any{
|
||||
"id": current_group.ID,
|
||||
|
|
|
@ -269,7 +269,7 @@ func (h *ApplicationHandler) BeneficiaryDocuments(w http.ResponseWriter, r *http
|
|||
beneficiaryID := vars["beneficiaryid"]
|
||||
|
||||
//r.ParseForm()
|
||||
r.ParseMultipartForm(10 * 1024 * 1024)
|
||||
r.ParseMultipartForm(100 * 1024 * 1024)
|
||||
|
||||
document_type := r.FormValue("type")
|
||||
document_name := r.FormValue("name")
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
package renderer
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"html/template"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"gitlab.scity.coop/maas/navitia-golang/types"
|
||||
|
@ -67,6 +69,22 @@ func JSON(v any) template.JS {
|
|||
return template.JS(result)
|
||||
}
|
||||
|
||||
func RawJSON(v any) string {
|
||||
buf := new(bytes.Buffer)
|
||||
enc := json.NewEncoder(buf)
|
||||
enc.SetEscapeHTML(false)
|
||||
err := enc.Encode(&v)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
return strings.TrimSuffix(buf.String(), "\n")
|
||||
|
||||
}
|
||||
|
||||
func UnescapeHTML(s string) template.HTML {
|
||||
return template.HTML(s)
|
||||
}
|
||||
|
||||
func Dict(v ...interface{}) map[string]interface{} {
|
||||
dict := map[string]interface{}{}
|
||||
lenv := len(v)
|
||||
|
|
|
@ -55,6 +55,8 @@ func (renderer *Renderer) Render(name string, w http.ResponseWriter, r *http.Req
|
|||
"genderISO5218": GenderISO5218,
|
||||
"dict": Dict,
|
||||
"json": JSON,
|
||||
"rawjson": RawJSON,
|
||||
"unescapeHTML": UnescapeHTML,
|
||||
"walkingLength": WalkingLength,
|
||||
"divideFloat64": Divide[float64],
|
||||
"divideInt": Divide[int],
|
||||
|
@ -83,6 +85,8 @@ func (renderer *Renderer) RenderNoLayout(name string, w http.ResponseWriter, r *
|
|||
"genderISO5218": GenderISO5218,
|
||||
"dict": Dict,
|
||||
"json": JSON,
|
||||
"rawjson": RawJSON,
|
||||
"unsescapeHTML": UnescapeHTML,
|
||||
"divideFloat64": Divide[float64],
|
||||
"divideInt": Divide[int],
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue