Просмотр исходного кода

Merge branch 'gomodule' of ssh://gogs.carducci-dante.gov.it:10022/karmen/core into gomodule

Andrea Fazzi 5 лет назад
Родитель
Сommit
9c5d1ca4e1

+ 3 - 3
compose/karmen/docker-compose.yml

@@ -25,9 +25,9 @@ services:
   ldap_server:
     restart: always
     build: ./ldap
-    # command: --loglevel debug
-    domainname: foo.org
-    hostname: foo.org
+    command: --loglevel debug
+    # domainname: foo.org
+    # hostname: foo.org
     ports:
       - 389:389
     environment:

+ 2 - 2
compose/karmen/ldap/Dockerfile

@@ -1,9 +1,9 @@
-FROM osixia/openldap:latest
+FROM osixia/openldap:1.3.0
 MAINTAINER Andrea fazzi <andrea.fazzi@carducci-dante.gov.it>
 
 ADD bootstrap /container/service/slapd/assets/config/bootstrap
 RUN rm /container/service/slapd/assets/config/bootstrap/schema/mmc/mail.schema
 
 # ADD certs /container/service/slapd/assets/certs
-#ADD environment /container/environment/01-custom
+# ADD environment /container/environment/01-custom
 

+ 6 - 26
compose/karmen/ldap/bootstrap/ldif/foo.org.ldif

@@ -6,6 +6,12 @@ objectclass: organizationalUnit
 objectclass: top
 ou: Groups
 
+dn: ou=People,dc=foo,dc=org
+changetype: add
+objectclass: organizationalUnit
+objectclass: top
+ou: People
+
 ## Mailing lists
 
 dn: ou=Mailing Lists,ou=Groups,dc=foo,dc=org
@@ -85,26 +91,6 @@ gidNumber: 6001
 objectclass: posixGroup
 objectclass: top
 
-dn: ou=Segreterie,ou=Groups,dc=foo,dc=org
-changetype: add
-ou: Segreterie
-objectclass: organizationalUnit
-objectclass: top
-
-dn: cn=Segreteria del personale,ou=Segreterie,ou=Groups,dc=foo,dc=org
-changetype: add
-cn: Segreteria del personale
-gidNumber: 6015
-objectclass: posixGroup
-objectclass: top
-
-dn: cn=Segreteria didattica,ou=Segreterie,ou=Groups,dc=foo,dc=org
-changetype: add
-cn: Segreteria didattica
-gidNumber: 6016
-objectclass: posixGroup
-objectclass: top
-
 dn: ou=Dipartimenti,ou=Groups,dc=foo,dc=org
 changetype: add
 ou: Dipartimenti
@@ -127,12 +113,6 @@ objectclass: top
 
 ## People
 
-dn: ou=People,dc=foo,dc=org
-changetype: add
-objectclass: organizationalUnit
-objectclass: top
-ou: People
-
 dn: ou=Teachers,ou=People,dc=foo,dc=org
 changetype: add
 objectclass: organizationalUnit

+ 0 - 14
handlers/handlers.go

@@ -92,10 +92,6 @@ func generateHandler(r *mux.Router, model interface{}) {
 
 		apiPatterns []PathPattern
 
-		// executePatterns []PathPattern = []PathPattern{
-		// 	PathPattern{"/%s/{id}/execute", "", []string{"GET"}},
-		// }
-
 		filePatterns []PathPattern = []PathPattern{
 			PathPattern{"/%s/{id}/files/{filename}", "", []string{"GET"}},
 		}
@@ -110,27 +106,17 @@ func generateHandler(r *mux.Router, model interface{}) {
 	// Install standard paths
 
 	for _, pattern := range patterns {
-		log.Printf("Register handler %s", pattern.Path(pluralizedModelName(model)))
 		r.Handle(pattern.Path(pluralizedModelName(model)), jwtCookie.Handler(recoverHandler(modelHandler(pluralizedModelName(model), pattern)))).Methods(pattern.Methods...)
 	}
 
 	// Install API paths
 
 	for _, pattern := range apiPatterns {
-		log.Printf("Register handler %s", pattern.Path(pluralizedModelName(model)))
 		r.Handle(pattern.Path(pluralizedModelName(model)), jwtHeader.Handler(recoverHandler(modelHandler(pluralizedModelName(model), pattern)))).Methods(pattern.Methods...)
 	}
 
-	// if model == "documents" {
-	// 	for _, pattern := range executePatterns {
-	// 		log.Printf("Register handler %s", pattern.Path(pluralizedModelName(model)))
-	// 		r.Handle(pattern.Path(pluralizedModelName(model)), jwtCookie.Handler(recoverHandler(modelHandler(pluralizedModelName(model), pattern)))).Methods(pattern.Methods...)
-	// 	}
-	// }
-
 	if modelName(model) == "Job" {
 		for _, pattern := range filePatterns {
-			log.Printf("Register handler %s", pattern.Path(pluralizedModelName(model)))
 			r.Handle(pattern.Path(pluralizedModelName(model)), jwtCookie.Handler(recoverHandler(modelHandler(pluralizedModelName(model), pattern)))).Methods(pattern.Methods...)
 		}
 	}

+ 4 - 2
templates/activities_add_update.html.tpl

@@ -9,8 +9,10 @@
   {{else}}
   {{template "breadcrumb" toSlice "Attività" (all "Activity") "Aggiungi" "current"}}
   {{end}}
-  
-  {{template "add_update_header" dict "update" $update "addTitle" "Crea nuova attività" "updateTitle" (printf "Aggiorna attività %s" (.Data|string))}}
+
+  {{$updateTitle := ""}}
+  {{if $update}}{{$updateTitle = (printf "Aggiorna attività %s" (.Data|string))}}{{end}}
+  {{template "add_update_header" dict "update" $update "addTitle" "Crea nuova attività" "updateTitle" $updateTitle}}
 
   {{$form := "form_activities_add_update"}}
   <form

+ 2 - 2
templates/classes_show.html.tpl

@@ -10,13 +10,13 @@
   <p>Questa classe appartiene all'indirizzo <strong>{{.Data.Field}}</strong>.</p>
 
   {{if .Data.Coordinator}}
-  <p>Il coordinatore è il docente {{(.Data.Coordinator.ID|show "Teacher")|anchor (.Data.Coordinator|string)}}.
+  <p>Il <strong>coordinatore</strong> è il docente {{(.Data.Coordinator.ID|show "Teacher")|anchor (.Data.Coordinator|string)}}.
     {{else}}
   <p>Alla classe non è associato nessun coordinatore. Clicca {{(.Data.ID|update "Class")|anchor "qui"}} per associare un coordinatore alla classe.</p>
   {{end}}
 
   {{if .Data.Minuter}}
-  <p>Il verbalizzante è il docente {{(.Data.Minuter.ID|show "Teacher")|anchor (.Data.Minuter|string)}}.
+  <p>Il <strong>verbalizzante</strong> è il docente {{(.Data.Minuter.ID|show "Teacher")|anchor (.Data.Minuter|string)}}.
     {{else}}
   <p>Alla classe non è associato nessun verbalizzante. Clicca {{(.Data.ID|update "Class")|anchor "qui"}} per associare un verbalizzante alla classe.</p>
   {{end}}