2
0
Files
logikonline 36f5d77c9f
Some checks failed
Build and Release / Lint (push) Failing after 5m36s
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Has been skipped
Build and Release / Build Binaries (amd64, darwin, macos) (push) Has been skipped
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Has been skipped
Build and Release / Build Binaries (arm64, darwin, macos) (push) Has been skipped
Build and Release / Build Binary (linux/arm64) (push) Has been skipped
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 2m37s
Build and Release / Create Release (push) Has been skipped
Build and Release / Unit Tests (push) Successful in 3m39s
feat(wishlist): add wishlist feature for feature requests
Implements comprehensive wishlist/feature request system for repositories. Includes categories with colors, voting system, importance ratings (1-5 stars), status tracking (open/planned/in-progress/completed/declined), threaded comments with reactions, and release linking. Adds v2 API endpoints for CRUD operations. Includes repository settings toggle, header tab, and full UI templates for list/view/create. Supports vote counts, importance averages, and comment reactions.
2026-02-02 15:15:56 -05:00

51 lines
1.5 KiB
Go

// Copyright 2026 MarketAlly. All rights reserved.
// SPDX-License-Identifier: MIT
package forms
import (
"net/http"
"code.gitcaddy.com/server/v3/modules/web/middleware"
"code.gitcaddy.com/server/v3/services/context"
"gitea.com/go-chi/binding"
)
// WishlistItemForm is the form for creating wishlist items.
type WishlistItemForm struct {
Title string `binding:"Required;MaxSize(255)"`
Content string `binding:"Required"`
CategoryID int64
}
// Validate validates the fields.
func (f *WishlistItemForm) Validate(req *http.Request, errs binding.Errors) binding.Errors {
ctx := context.GetValidateContext(req)
return middleware.Validate(errs, ctx.Data, f, ctx.Locale)
}
// WishlistCommentForm is the form for adding comments.
type WishlistCommentForm struct {
Content string `binding:"Required"`
}
// Validate validates the fields.
func (f *WishlistCommentForm) Validate(req *http.Request, errs binding.Errors) binding.Errors {
ctx := context.GetValidateContext(req)
return middleware.Validate(errs, ctx.Data, f, ctx.Locale)
}
// WishlistCategoryForm is the form for managing categories.
type WishlistCategoryForm struct {
Name string `binding:"Required;MaxSize(100)"`
Color string `binding:"Required;MaxSize(7)"`
SortOrder int
}
// Validate validates the fields.
func (f *WishlistCategoryForm) Validate(req *http.Request, errs binding.Errors) binding.Errors {
ctx := context.GetValidateContext(req)
return middleware.Validate(errs, ctx.Data, f, ctx.Locale)
}