mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-10 05:24:18 +09:00
Adds per-event watch options, so a user can choose which repository notifications they receive. The watch button is now a menu with four modes: participating and mentions (the unwatched state, as on GitHub), all activity, ignore, and custom, which opens a dialog to pick issues, pull requests and releases. The same dialog is reachable from the gear icon on the watched repository list. Options apply to UI notifications and to mail. The watcher, star and fork counts moved inside their buttons, so all three share one shape, and the links to those lists moved to the repository sidebar. Assignees and requested reviewers now also receive UI notifications without having commented first. Buttons and dropdown: <img width="688" height="398" alt="image" src="https://github.com/user-attachments/assets/889b567d-086f-4a06-ac67-3a4205fc63b2" /> Modal: <img width="841" height="327" alt="Screenshot 2026-08-07 at 21 10 59" src="https://github.com/user-attachments/assets/3bedbff5-9011-4f1b-91a9-e8f5c212fb5d" /> New entries in sidebar: <img width="170" height="207" alt="Screenshot 2026-08-07 at 21 13 28" src="https://github.com/user-attachments/assets/5f5150cd-f42d-4543-bd0b-7334cf4aab0e" /> Fixes: https://github.com/go-gitea/gitea/issues/17238 Ref: https://github.com/go-gitea/gitea/issues/35492 --------- Co-authored-by: bircni <bircni@icloud.com> Co-authored-by: silverwind <me@silverwind.io>
89 lines
3.6 KiB
Handlebars
89 lines
3.6 KiB
Handlebars
<div class="flex-divided-list items-with-main">
|
|
{{range .Repos}}
|
|
<div class="item">
|
|
<div class="item-leading">
|
|
{{if $.ShowRepoOwnerAvatar}}
|
|
{{ctx.AvatarUtils.Avatar .Owner 24}}
|
|
{{else}}
|
|
{{template "repo/icon" .}}
|
|
{{end}}
|
|
</div>
|
|
<div class="item-main">
|
|
<div class="item-header">
|
|
<div class="item-title">
|
|
{{if and $.ShowRepoOwnerOnList .Owner}}
|
|
<a class="tw-text-primary name" href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a>/
|
|
{{end}}
|
|
<a class="tw-text-primary name" href="{{.Link}}">{{.Name}}</a>
|
|
<span class="label-list">
|
|
{{if .IsArchived}}
|
|
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.archived"}}</span>
|
|
{{end}}
|
|
{{if .IsPrivate}}
|
|
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private"}}</span>
|
|
{{else}}
|
|
{{if .Owner.Visibility.IsPrivate}}
|
|
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal"}}</span>
|
|
{{end}}
|
|
{{end}}
|
|
{{if .IsTemplate}}
|
|
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.template"}}</span>
|
|
{{end}}
|
|
{{if eq .ObjectFormatName "sha256"}}
|
|
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.sha256"}}</span>
|
|
{{end}}
|
|
</span>
|
|
</div>
|
|
<div class="item-trailing muted-links">
|
|
{{if .PrimaryLanguage}}
|
|
<a class="flex-text-block" href="?q={{$.Keyword}}&sort={{$.SortType}}&language={{.PrimaryLanguage.Language}}{{if $.TabName}}&tab={{$.TabName}}{{end}}">
|
|
<i class="color-icon" style="background-color: {{.PrimaryLanguage.Color}}"></i>
|
|
{{.PrimaryLanguage.Language}}
|
|
</a>
|
|
{{end}}
|
|
{{if not $.DisableStars}}
|
|
<a class="flex-text-inline" href="{{.Link}}/stars">
|
|
<span class="tw-contents" aria-label="{{ctx.Locale.Tr "repo.stars"}}">{{svg "octicon-star" 16}}</span>
|
|
<span {{if ge .NumStars 1000}}data-tooltip-content="{{.NumStars}}"{{end}}>{{CountFmt .NumStars}}</span>
|
|
</a>
|
|
{{end}}
|
|
<a class="flex-text-inline" href="{{.Link}}/pulls">
|
|
<span class="tw-contents" aria-label="{{ctx.Locale.Tr "repo.pulls"}}">{{svg "octicon-git-pull-request" 16}}</span>
|
|
<span {{if ge .NumOpenPulls 1000}}data-tooltip-content="{{.NumOpenPulls}}"{{end}}>{{CountFmt .NumOpenPulls}}</span>
|
|
</a>
|
|
<a class="flex-text-inline" href="{{.Link}}/forks">
|
|
<span class="tw-contents" aria-label="{{ctx.Locale.Tr "repo.forks"}}">{{svg "octicon-repo-forked" 16}}</span>
|
|
<span {{if ge .NumForks 1000}}data-tooltip-content="{{.NumForks}}"{{end}}>{{CountFmt .NumForks}}</span>
|
|
</a>
|
|
{{$watch := and $.Watches (index $.Watches .ID)}}
|
|
{{if $watch}}
|
|
<button class="btn flex-text-inline" data-global-click="onRepoWatchOptionsClick"
|
|
data-url="{{.Link}}/action/watch/options"
|
|
data-issues="{{$watch.Issues}}" data-pull-requests="{{$watch.PullRequests}}" data-releases="{{$watch.Releases}}"
|
|
data-tooltip-content="{{ctx.Locale.Tr "notifications"}}"
|
|
>{{svg "octicon-gear" 16}}</button>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
{{$description := .DescriptionHTML ctx}}
|
|
{{if $description}}
|
|
<div class="item-body">{{$description}}</div>
|
|
{{end}}
|
|
{{if .Topics}}
|
|
<div class="label-list">
|
|
{{range .Topics}}
|
|
{{if ne . ""}}<a class="ui label" href="{{AppSubUrl}}/explore/repos?q={{.}}&topic=1">{{.}}</a>{{end}}
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
<div class="item-body">{{ctx.Locale.Tr "org.repo_updated"}} {{DateUtils.TimeSince .UpdatedUnix}}</div>
|
|
</div>
|
|
</div>
|
|
{{else}}
|
|
<div>
|
|
{{ctx.Locale.Tr "search.no_results"}}
|
|
</div>
|
|
{{end}}
|
|
{{if $.Watches}}{{template "repo/watch_options_modal"}}{{end}}
|
|
</div>
|