Disable Stars config option (#14653)
* Add config option to disable stars * Replace "stars" with watched in user profile * Add documentation
This commit is contained in:
parent
af2adb4e35
commit
f44543a1bb
16 changed files with 83 additions and 27 deletions
|
@ -60,6 +60,7 @@ func GetGeneralRepoSettings(ctx *context.APIContext) {
|
|||
MirrorsDisabled: setting.Repository.DisableMirrors,
|
||||
HTTPGitDisabled: setting.Repository.DisableHTTPGit,
|
||||
MigrationsDisabled: setting.Repository.DisableMigrations,
|
||||
StarsDisabled: setting.Repository.DisableStars,
|
||||
TimeTrackingDisabled: !setting.Service.EnableTimetracking,
|
||||
LFSDisabled: !setting.LFS.StartServer,
|
||||
})
|
||||
|
|
|
@ -238,6 +238,27 @@ func Profile(ctx *context.Context) {
|
|||
ctx.ServerError("GetProjects", err)
|
||||
return
|
||||
}
|
||||
case "watching":
|
||||
repos, count, err = models.SearchRepository(&models.SearchRepoOptions{
|
||||
ListOptions: models.ListOptions{
|
||||
PageSize: setting.UI.User.RepoPagingNum,
|
||||
Page: page,
|
||||
},
|
||||
Actor: ctx.User,
|
||||
Keyword: keyword,
|
||||
OrderBy: orderBy,
|
||||
Private: ctx.IsSigned,
|
||||
WatchedByID: ctxUser.ID,
|
||||
Collaborate: util.OptionalBoolFalse,
|
||||
TopicOnly: topicOnly,
|
||||
IncludeDescription: setting.UI.SearchRepoDescription,
|
||||
})
|
||||
if err != nil {
|
||||
ctx.ServerError("SearchRepository", err)
|
||||
return
|
||||
}
|
||||
|
||||
total = int(count)
|
||||
default:
|
||||
repos, count, err = models.SearchRepository(&models.SearchRepoOptions{
|
||||
ListOptions: models.ListOptions{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue