mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-26 06:16:56 +09:00
feat: add release reactions and a GitHub-like reaction bar (#38415)
Adds emoji reactions to releases and moves the reaction picker of issues, comments and releases into a GitHub-like reaction bar. - Releases omit 👎 or 😕 - Drafts and tags can't be reacted to - Moved menu to tippy - Added keyboard navigation Fixes: https://github.com/go-gitea/gitea/issues/34268 Fixes: https://github.com/go-gitea/gitea/issues/16676 Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
42 files changed
+508
-313
No files matched your search
@@ -148,16 +148,26 @@ func (b *Base) PlainText(status int, text string) {
|
||||
|
||||
// Redirect redirects the request
|
||||
func (b *Base) Redirect(location string, status ...int) {
|
||||
code := util.OptionalArg(status, http.StatusSeeOther)
|
||||
// In case the request is made by "fetch-action" module, make JS redirect to the new location
|
||||
// Otherwise, the JS fetch will follow the redirection and read a "login" page, embed it to the current page, which is not expected.
|
||||
if httplib.IsGiteaFetchActionRequest(b.Req) {
|
||||
b.JSON(http.StatusOK, map[string]any{"redirect": location})
|
||||
return
|
||||
}
|
||||
code := util.OptionalArg(status, http.StatusSeeOther)
|
||||
http.Redirect(b.Resp, b.Req, location, code)
|
||||
}
|
||||
|
||||
func (b *Base) RedirectForLogin(location string) {
|
||||
if httplib.IsGiteaFetchActionRequest(b.Req) {
|
||||
// let fetch-action handles the redirect automatically
|
||||
b.JSON(http.StatusUnauthorized, map[string]any{"redirect": location})
|
||||
} else {
|
||||
// keep the old behaivor, use 303 to redirect to login page
|
||||
http.Redirect(b.Resp, b.Req, location, http.StatusSeeOther)
|
||||
}
|
||||
}
|
||||
|
||||
type ServeHeaderOptions = httplib.ServeHeaderOptions
|
||||
|
||||
func (b *Base) SetServeHeaders(opts ServeHeaderOptions) {
|
||||
|
||||
@@ -104,6 +104,7 @@ type uploadOptions struct {
|
||||
|
||||
// AddUploadContext renders template values for dropzone
|
||||
func AddUploadContext(ctx *context.Context, uploadType string) {
|
||||
ctx.Data["IsAttachmentEnabled"] = setting.Attachment.Enabled
|
||||
switch uploadType {
|
||||
case "release":
|
||||
ctx.Data["UploadOptions"] = uploadOptions{
|
||||
|
||||
Reference in new issue
Block a user