package auth

import (
	"gitea.com/macaron/binding"
	"gitea.com/macaron/macaron"
)

// CreateDatasetForm form for dataset page
type CreateDatasetForm struct {
	Title       string `binding:"Required"`
	Category    string `binding:"Required"`
	Description string `binding:"Required;MaxSize(254)"`
	License     string `binding:"Required;MaxSize(64)"`
	Task        string `binding:"Required;MaxSize(64)"`
	ReleaseID   int64  `xorm:"INDEX"`
	Private     bool
	Files       []string
}

func (f *CreateDatasetForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
	return validate(errs, ctx.Data, f, ctx.Locale)
}

type EditDatasetForm struct {
	ID          int64  `binding:"Required"`
	Title       string `binding:"Required"`
	Category    string `binding:"Required"`
	Description string `binding:"Required;MaxSize(254)"`
	License     string `binding:"Required;MaxSize(64)"`
	Task        string `binding:"Required;MaxSize(64)"`
	Private     bool
	ReleaseID   int64 `xorm:"INDEX"`
	Files       []string
	Type        string  `binding:"Required"`
}
