1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Add setting to hide sections of GitHub module

This commit is contained in:
Matt Murphy
2020-05-23 11:32:40 -04:00
parent 6981b53336
commit b6a666fe59
2 changed files with 18 additions and 6 deletions

View File

@@ -34,12 +34,18 @@ func (widget *Widget) content() (string, string, bool) {
_, _, width, _ := widget.View.GetRect()
str := widget.settings.common.SigilStr(len(widget.GithubRepos), widget.Idx, width) + "\n"
str += fmt.Sprintf(" [%s]Stats[white]\n", widget.settings.common.Colors.Subheading)
str += widget.displayStats(repo)
str += fmt.Sprintf("\n [%s]Open Review Requests[white]\n", widget.settings.common.Colors.Subheading)
str += widget.displayMyReviewRequests(repo, username)
str += fmt.Sprintf("\n [%s]My Pull Requests[white]\n", widget.settings.common.Colors.Subheading)
str += widget.displayMyPullRequests(repo, username)
if widget.settings.showStats {
str += fmt.Sprintf(" [%s]Stats[white]\n", widget.settings.common.Colors.Subheading)
str += widget.displayStats(repo)
}
if widget.settings.showOpenReviewRequests {
str += fmt.Sprintf("\n [%s]Open Review Requests[white]\n", widget.settings.common.Colors.Subheading)
str += widget.displayMyReviewRequests(repo, username)
}
if widget.settings.showMyPullRequests {
str += fmt.Sprintf("\n [%s]My Pull Requests[white]\n", widget.settings.common.Colors.Subheading)
str += widget.displayMyPullRequests(repo, username)
}
for _, customQuery := range widget.settings.customQueries {
str += fmt.Sprintf("\n [%s]%s[white]\n", widget.settings.common.Colors.Subheading, customQuery.title)
str += widget.displayCustomQuery(repo, customQuery.filter, customQuery.perPage)