Beispiel #1
0
func viewUserProjects(w http.ResponseWriter, r *http.Request) {
	data := setDefaultData(w, r)
	userID := r.URL.Query().Get("id")
	user := user.FindUserById(userID)
	dbRefUser := &mgo.DBRef{Collection: "users", Id: user.Id, Database: "CoAud"}
	postedProjects, projectCount := project.FindProjects(bson.M{"user": dbRefUser}, 0, 500)
	data["user"] = user
	data["postedProjects"] = postedProjects
	data["projectCount"] = projectCount
	display(w, "viewUserProjects", &Page{Title: user.DisplayName, Data: data})
}
Beispiel #2
0
func editAuditionHandler(w http.ResponseWriter, r *http.Request) {
	data := setDefaultData(w, r)
	userID := r.URL.Query().Get("id")
	user := user.FindUserById(userID)
	dbRefUser := &mgo.DBRef{Collection: "users", Id: user.Id, Database: "CoAud"}
	postedRoles, rolesCount := role.FindRoles(bson.M{"user": dbRefUser}, 0, 500)
	data["user"] = user
	data["postedRoles"] = postedRoles
	data["rolesCount"] = rolesCount
	display(w, "editAudition", &Page{Title: user.DisplayName, Data: data})
}