mirror of
https://github.com/gogs/gogs.git
synced 2026-07-06 07:18:08 +02:00
* admin can remove observers from the repository (#5782) * admin can remove observers from the repository (#5782) * admin can remove observers from the repository (#5782) * admin can remove observers from the repository (#5782) * admin can remove observers from the repository (#5782)
This commit is contained in:
committed by
Jiahua Chen
parent
0852e83eec
commit
209569a035
@@ -235,7 +235,13 @@ func Action(c *context.Context) {
|
||||
case "watch":
|
||||
err = models.WatchRepo(c.User.ID, c.Repo.Repository.ID, true)
|
||||
case "unwatch":
|
||||
err = models.WatchRepo(c.User.ID, c.Repo.Repository.ID, false)
|
||||
if userID := c.QueryInt64("user_id"); userID != 0 {
|
||||
if c.User.IsAdmin {
|
||||
err = models.WatchRepo(userID, c.Repo.Repository.ID, false)
|
||||
}
|
||||
} else {
|
||||
err = models.WatchRepo(c.User.ID, c.Repo.Repository.ID, false)
|
||||
}
|
||||
case "star":
|
||||
err = models.StarRepo(c.User.ID, c.Repo.Repository.ID, true)
|
||||
case "unstar":
|
||||
|
||||
@@ -19,6 +19,16 @@
|
||||
<span class="octicon octicon-clock"></span> {{$.i18n.Tr "user.join_on"}} {{DateFmtShort .Created}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{if $.IsAdmin}}
|
||||
<form class="display inline" action="{{$.RepoLink}}/action/unwatch?redirect_to={{$.Link}}" method="POST">
|
||||
{{$.CSRFTokenHTML}}
|
||||
<input type="hidden" name="user_id" value="{{.ID}}">
|
||||
<div class="ui labeled button" tabindex="0">
|
||||
<button class="ui red small button">{{$.i18n.Tr "repo.unwatch"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
{{end}}
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user