// DisplayResource shows the page for the resource func (controller *Repository) DisplayResource() { resourceID := controller.Ctx.Input.Param(":resource") repo := controller.GetRepository() resource, errResource := wisply.GetRecordByID(resourceID) if errResource != nil { controller.Abort("show-database-error") } else { moduleID := wisply.DetectModule(resource.Identifier) module, err := repository.NewModule(strconv.Itoa(moduleID)) if err == nil { controller.Data["module"] = module controller.Data["resourcesSuggested"] = wisply.SuggestResourcesForModule(module.GetID()) } controller.Data["repository"] = repo controller.Data["institution"] = repo.GetInstitution() controller.Data["resource"] = resource controller.LoadTemplate("resource") } }
// Display shows the public page for a module func (controller *Module) Display() { module := controller.GetModule() controller.LoadTemplate("module") controller.Data["resourcesSuggested"] = wisply.SuggestResourcesForModule(module.GetID()) controller.Data["moduleAnalyses"] = analyse.GetModuleAnalysersByModule(module.GetID()) }