Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // Copyright 2014 The Gogs Authors. All rights reserved.
  2. // Copyright 2019 The Gitea Authors. All rights reserved.
  3. // Use of this source code is governed by a MIT-style
  4. // license that can be found in the LICENSE file.
  5. package auth
  6. import (
  7. "code.gitea.io/gitea/models"
  8. "code.gitea.io/gitea/modules/structs"
  9. "gitea.com/macaron/binding"
  10. "gitea.com/macaron/macaron"
  11. )
  12. // ________ .__ __ .__
  13. // \_____ \_______ _________ ____ |__|____________ _/ |_|__| ____ ____
  14. // / | \_ __ \/ ___\__ \ / \| \___ /\__ \\ __\ |/ _ \ / \
  15. // / | \ | \/ /_/ > __ \| | \ |/ / / __ \| | | ( <_> ) | \
  16. // \_______ /__| \___ (____ /___| /__/_____ \(____ /__| |__|\____/|___| /
  17. // \/ /_____/ \/ \/ \/ \/ \/
  18. // CreateOrgForm form for creating organization
  19. type CreateOrgForm struct {
  20. OrgName string `binding:"Required;AlphaDashDot;MaxSize(40)" locale:"org.org_name_holder"`
  21. Visibility structs.VisibleType
  22. RepoAdminChangeTeamAccess bool
  23. }
  24. // Validate validates the fields
  25. func (f *CreateOrgForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
  26. return validate(errs, ctx.Data, f, ctx.Locale)
  27. }
  28. // UpdateOrgSettingForm form for updating organization settings
  29. type UpdateOrgSettingForm struct {
  30. Name string `binding:"Required;AlphaDashDot;MaxSize(40)" locale:"org.org_name_holder"`
  31. FullName string `binding:"MaxSize(100)"`
  32. Description string `binding:"MaxSize(255)"`
  33. Website string `binding:"ValidUrl;MaxSize(255)"`
  34. Location string `binding:"MaxSize(50)"`
  35. Visibility structs.VisibleType
  36. MaxRepoCreation int
  37. RepoAdminChangeTeamAccess bool
  38. }
  39. // Validate validates the fields
  40. func (f *UpdateOrgSettingForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
  41. return validate(errs, ctx.Data, f, ctx.Locale)
  42. }
  43. // ___________
  44. // \__ ___/___ _____ _____
  45. // | |_/ __ \\__ \ / \
  46. // | |\ ___/ / __ \| Y Y \
  47. // |____| \___ >____ /__|_| /
  48. // \/ \/ \/
  49. // CreateTeamForm form for creating team
  50. type CreateTeamForm struct {
  51. TeamName string `binding:"Required;AlphaDashDot;MaxSize(30)"`
  52. Description string `binding:"MaxSize(255)"`
  53. Permission string
  54. Units []models.UnitType
  55. }
  56. // Validate validates the fields
  57. func (f *CreateTeamForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
  58. return validate(errs, ctx.Data, f, ctx.Locale)
  59. }