diff --git a/routers/web/repo/star.go b/routers/web/repo/star.go index 8cfbfefdf14..c93c877d636 100644 --- a/routers/web/repo/star.go +++ b/routers/web/repo/star.go @@ -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") diff --git a/routers/web/repo/watch.go b/routers/web/repo/watch.go index a7fbfc168be..616e1ee89c7 100644 --- a/routers/web/repo/watch.go +++ b/routers/web/repo/watch.go @@ -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") diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 9ed74d50bc0..9fbe6a9a114 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -57,59 +57,12 @@ {{svg "octicon-rss" 16}} {{end}} - {{template "repo/watch_unwatch" $}} + {{template "repo/header/watch" $}} {{if not $.DisableStars}} - {{template "repo/star_unstar" $}} + {{template "repo/header/star" $}} {{end}} {{if and (not .IsEmpty) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}} -
-