Exemplo n.º 1
0
func (controller *Controller) loadInstitution() {
	ID := controller.Ctx.Input.Param(":institution")
	institution, err := repository.NewInstitution(ID)
	if err == nil {
		controller.Data["institution"] = institution
		controller.institution = institution
		controller.SetCustomTitle("Admin - " + institution.Name)
	}
}
Exemplo n.º 2
0
func (controller *Controller) loadInstitution() {
	ID := controller.Ctx.Input.Param(":institution")
	institution, err := repository.NewInstitution(ID)
	if err != nil {
		controller.Abort("show-database-error")
	}
	controller.Data["institution"] = institution
	controller.institution = institution
	controller.SetCustomTitle(institution.Name)
}
Exemplo n.º 3
0
// Perform gets the results
func (search ProgramSearch) Perform() {
	programs := search.getFromDB()
	for _, program := range programs {
		institutionID := program.GetInstitution()
		institution, _ := repository.NewInstitution(strconv.Itoa(institutionID))
		result := &Result{
			Title:       program.GetTitle(),
			URL:         search.getURL(program),
			Description: institution.Name,
			Icon:        institution.LogoURL,
			Category:    "Program of study",
			IsVisible:   true,
		}
		search.response.AppendItem(result)
	}
}
Exemplo n.º 4
0
// Perform gets the results
func (search ModuleSearch) Perform() {
	modules := search.getFromDB()
	for _, module := range modules {
		institutionID := module.GetInstitution()
		institution, _ := repository.NewInstitution(strconv.Itoa(institutionID))
		result := &Result{
			Title:       module.GetTitle(),
			URL:         search.getURL(module),
			Description: institution.Name,
			Icon:        institution.LogoURL,
			Category:    "Module",
			IsVisible:   true,
		}
		search.response.AppendItem(result)
	}
}