diff --git a/templates/user.html b/templates/user.html index b033688..bb52fa8 100644 --- a/templates/user.html +++ b/templates/user.html @@ -8,34 +8,45 @@

Modifier mon profil

- {{if .Common.ErrorMessage}} -
Impossible d'effectuer la modification. -
{{ .Common.ErrorMessage }}
+{{if .Common.ErrorMessage}} +
Impossible d'effectuer la modification. +
{{ .Common.ErrorMessage }}
+
+{{end}} +{{if .Common.Success}} +
+ Profil enregistré. +
+{{end}} +
+
+
+ +
- {{end}} - {{if .Common.Success}} -
- Profil enregistré. +
+ +
- {{end}} - -
-
- - -
-
- - -
+
+
+
+ {{range $index, $email := .Data.MailValues }} + + + +
+ {{end}} + +
-
- - -
- -{{/* - - - -*/}} -
-
- - -
-
- - -
+ */}} +
+
+ +
+
+ + +
+
-
- - -
- - - -{{end}} +
+ + +
+ + + +{{end}} \ No newline at end of file diff --git a/view-user.go b/view-user.go index fa2eb7a..d30c718 100644 --- a/view-user.go +++ b/view-user.go @@ -10,8 +10,8 @@ import ( ) func handleUserWait(w http.ResponseWriter, r *http.Request) { - templateProfile := getTemplate("user/wait.html") - templateProfile.Execute(w, HomePageData{ + templateUser := getTemplate("user/wait.html") + templateUser.Execute(w, HomePageData{ Common: NestedCommonTplData{ CanAdmin: false, LoggedIn: false, @@ -20,7 +20,7 @@ func handleUserWait(w http.ResponseWriter, r *http.Request) { } func handleUser(w http.ResponseWriter, r *http.Request) { - templateProfile := getTemplate("user.html") + templateUser := getTemplate("user.html") login := checkLogin(w, r) if login == nil { @@ -46,6 +46,7 @@ func handleUser(w http.ResponseWriter, r *http.Request) { data.GivenName = login.UserEntry.GetAttributeValue("givenName") data.Surname = login.UserEntry.GetAttributeValue("sn") data.OtherMailbox = login.UserEntry.GetAttributeValue("carLicense") + data.MailValues = login.UserEntry.GetAttributeValues("mail") // data.Visibility = login.UserEntry.GetAttributeValue(FIELD_NAME_DIRECTORY_VISIBILITY) data.Description = login.UserEntry.GetAttributeValue("description") //data.ProfilePicture = login.UserEntry.GetAttributeValue(FIELD_NAME_PROFILE_PICTURE) @@ -122,5 +123,6 @@ func handleUser(w http.ResponseWriter, r *http.Request) { } - templateProfile.Execute(w, data) + // templateUser.Execute(w, data) + execTemplate(w, templateUser, data.Common, data.Login, *config, data) } diff --git a/view.go b/view.go index c4d8bd4..6cfa892 100644 --- a/view.go +++ b/view.go @@ -190,6 +190,7 @@ type CodeMailFields struct { } type ProfileTplData struct { Mail string + MailValues []string DisplayName string GivenName string Surname string