You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

label.go 748 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package repo
  2. import (
  3. "code.gitea.io/gitea/models"
  4. "code.gitea.io/gitea/modules/base"
  5. "code.gitea.io/gitea/modules/context"
  6. "code.gitea.io/gitea/modules/log"
  7. )
  8. const (
  9. tplLabelIndex base.TplName = "repo/datasets/label/index"
  10. )
  11. func LabelIndex(ctx *context.Context) {
  12. log.Info("Go Here LabelIndex.")
  13. uuid := ctx.Params("uuid")
  14. attach, err := models.GetAttachmentByUUID(uuid)
  15. if err != nil {
  16. log.Info("query attach error")
  17. } else {
  18. dataset, err := models.GetDatasetByID(attach.DatasetID)
  19. if err != nil {
  20. log.Info("query dataset error")
  21. } else {
  22. ctx.Data["repoId"] = dataset.RepoID
  23. }
  24. }
  25. attachments := QueryDataSet(ctx)
  26. ctx.Data["uuid"] = uuid
  27. ctx.Data["Attachments"] = attachments
  28. ctx.HTML(200, tplLabelIndex)
  29. }