Fix inconsistent disabled styling on logged-out repo header buttons (#37406)
Make the watch, star, and fork buttons in the repo header consistent for logged-out users: - Apply the same look to all three buttons (number labels included), instead of only the action button being grayed. - Clicking any of them while logged out now leads to the login page (with a redirect back) instead of being inert. - Split the per-button markup out of `header.tmpl` into a dedicated `templates/repo/header/` folder (`fork.tmpl`, `star.tmpl`, `watch.tmpl`). --------- Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
"code.gitea.io/gitea/services/context"
|
||||
)
|
||||
|
||||
const tplStarUnstar templates.TplName = "repo/star_unstar"
|
||||
const tplStarUnstar templates.TplName = "repo/header/star"
|
||||
|
||||
func ActionStar(ctx *context.Context) {
|
||||
err := repo_model.StarRepo(ctx, ctx.Doer, ctx.Repo.Repository, ctx.PathParam("action") == "star")
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"code.gitea.io/gitea/services/context"
|
||||
)
|
||||
|
||||
const tplWatchUnwatch templates.TplName = "repo/watch_unwatch"
|
||||
const tplWatchUnwatch templates.TplName = "repo/header/watch"
|
||||
|
||||
func ActionWatch(ctx *context.Context) {
|
||||
err := repo_model.WatchRepo(ctx, ctx.Doer, ctx.Repo.Repository, ctx.PathParam("action") == "watch")
|
||||
|
||||
Reference in New Issue
Block a user