Skip to content

Commit 22c952a

Browse files
Make dashboard newsfeed list length a configurable item (#12469)
Co-authored-by: John Olheiser <[email protected]>
1 parent 73b155d commit 22c952a

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

custom/conf/app.example.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ EXPLORE_PAGING_NUM = 20
164164
ISSUE_PAGING_NUM = 10
165165
; Number of maximum commits displayed in one activity feed
166166
FEED_MAX_COMMIT_NUM = 5
167+
; Number of items that are displayed in home feed
168+
FEED_PAGING_NUM = 20
167169
; Number of maximum commits displayed in commit graph.
168170
GRAPH_MAX_COMMIT_NUM = 100
169171
; Number of line of codes shown for a code comment

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
127127
- `ISSUE_PAGING_NUM`: **10**: Number of issues that are shown in one page (for all pages that list issues).
128128
- `MEMBERS_PAGING_NUM`: **20**: Number of members that are shown in organization members.
129129
- `FEED_MAX_COMMIT_NUM`: **5**: Number of maximum commits shown in one activity feed.
130+
- `FEED_PAGING_NUM`: **20**: Number of items that are displayed in home feed.
130131
- `GRAPH_MAX_COMMIT_NUM`: **100**: Number of maximum commits shown in the commit graph.
131132
- `DEFAULT_THEME`: **gitea**: \[gitea, arc-green\]: Set the default theme for the Gitea install.
132133
- `THEMES`: **gitea,arc-green**: All available themes. Allow users select personalized themes

models/action.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,9 @@ func GetFeeds(opts GetFeedsOptions) ([]*Action, error) {
339339
cond = cond.And(builder.Eq{"is_deleted": false})
340340
}
341341

342-
actions := make([]*Action, 0, 20)
342+
actions := make([]*Action, 0, setting.UI.FeedPagingNum)
343343

344-
if err := x.Limit(20).Desc("id").Where(cond).Find(&actions); err != nil {
344+
if err := x.Limit(setting.UI.FeedPagingNum).Desc("id").Where(cond).Find(&actions); err != nil {
345345
return nil, fmt.Errorf("Find: %v", err)
346346
}
347347

modules/setting/setting.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ var (
166166
RepoSearchPagingNum int
167167
MembersPagingNum int
168168
FeedMaxCommitNum int
169+
FeedPagingNum int
169170
GraphMaxCommitNum int
170171
CodeCommentLines int
171172
ReactionMaxUserNum int
@@ -207,6 +208,7 @@ var (
207208
RepoSearchPagingNum: 10,
208209
MembersPagingNum: 20,
209210
FeedMaxCommitNum: 5,
211+
FeedPagingNum: 20,
210212
GraphMaxCommitNum: 100,
211213
CodeCommentLines: 4,
212214
ReactionMaxUserNum: 10,

0 commit comments

Comments
 (0)