Compare commits

..

2 Commits

Author SHA1 Message Date
Giteabot
9dfdfe2389
Remove conflicting CSS rules on notifications, improve notifications table (#23565) (#23621)
Backport #23565 by @silverwind

Dropdowns on `/notifications/subscriptions` before and after:

<img width="157" alt="Screenshot 2023-03-18 at 20 37 12"
src="https://user-images.githubusercontent.com/115237/226133906-e4ad6a0a-de24-4324-8e1d-94081d23fe85.png">
<img width="152" alt="Screenshot 2023-03-18 at 20 41 29"
src="https://user-images.githubusercontent.com/115237/226134038-c3946c32-a424-4b92-ad15-890e1036cafe.png">

These selectors are meant to target the notification list which I
improved:

<img width="1145" alt="Screenshot 2023-03-19 at 01 52 11"
src="https://user-images.githubusercontent.com/115237/226147907-1c35736a-4bc9-4698-9813-21a20a1d2106.png">
<img width="1148" alt="Screenshot 2023-03-19 at 01 54 17"
src="https://user-images.githubusercontent.com/115237/226147920-626dbd84-11d3-48db-a177-6d808e3212c0.png">
2023-03-21 17:04:01 -04:00
Giteabot
4439a68911
Fix pagination on /notifications/watching (#23564) (#23603)
Backport #23564 by @silverwind

The `q` parameter was not rendered in pagination links because
`context.Pagination:AddParam` checks for existance of the parameter in
`ctx.Data` where it was absent. Added the parameter there to fix it.

Co-authored-by: silverwind <me@silverwind.io>
2023-03-21 16:10:47 -04:00
3 changed files with 21 additions and 30 deletions

View File

@ -344,6 +344,9 @@ func NotificationWatching(ctx *context.Context) {
page = 1 page = 1
} }
keyword := ctx.FormTrim("q")
ctx.Data["Keyword"] = keyword
var orderBy db.SearchOrderBy var orderBy db.SearchOrderBy
ctx.Data["SortType"] = ctx.FormString("sort") ctx.Data["SortType"] = ctx.FormString("sort")
switch ctx.FormString("sort") { switch ctx.FormString("sort") {
@ -378,7 +381,7 @@ func NotificationWatching(ctx *context.Context) {
Page: page, Page: page,
}, },
Actor: ctx.Doer, Actor: ctx.Doer,
Keyword: ctx.FormTrim("q"), Keyword: keyword,
OrderBy: orderBy, OrderBy: orderBy,
Private: ctx.IsSigned, Private: ctx.IsSigned,
WatchedByID: ctx.Doer.ID, WatchedByID: ctx.Doer.ID,

View File

@ -35,26 +35,26 @@
{{$issue := .Issue}} {{$issue := .Issue}}
{{$repo := .Repository}} {{$repo := .Repository}}
<tr id="notification_{{.ID}}"> <tr id="notification_{{.ID}}">
<td class="collapsing" data-href="{{.Link}}"> <td class="collapsing gt-pl-4" data-href="{{.Link}}">
{{if eq .Status 3}} {{if eq .Status 3}}
<span class="blue">{{svg "octicon-pin"}}</span> {{svg "octicon-pin" 16 "text blue"}}
{{else if not $issue}} {{else if not $issue}}
<span class="gray">{{svg "octicon-repo"}}</span> {{svg "octicon-repo" 16 "text grey"}}
{{else if $issue.IsPull}} {{else if $issue.IsPull}}
{{if $issue.IsClosed}} {{if $issue.IsClosed}}
{{if $issue.GetPullRequest.HasMerged}} {{if $issue.GetPullRequest.HasMerged}}
<span class="purple">{{svg "octicon-git-merge"}}</span> {{svg "octicon-git-merge" 16 "text purple"}}
{{else}} {{else}}
<span class="red">{{svg "octicon-git-pull-request"}}</span> {{svg "octicon-git-pull-request" 16 "text red"}}
{{end}} {{end}}
{{else}} {{else}}
<span class="green">{{svg "octicon-git-pull-request"}}</span> {{svg "octicon-git-pull-request" 16 "text green"}}
{{end}} {{end}}
{{else}} {{else}}
{{if $issue.IsClosed}} {{if $issue.IsClosed}}
<span class="red">{{svg "octicon-issue-closed"}}</span> {{svg "octicon-issue-closed" 16 "text red"}}
{{else}} {{else}}
<span class="green">{{svg "octicon-issue-opened"}}</span> {{svg "octicon-issue-opened" 16 "text green"}}
{{end}} {{end}}
{{end}} {{end}}
</td> </td>

View File

@ -85,27 +85,6 @@
padding: 8px 15px; padding: 8px 15px;
} }
.user.notification .svg {
float: left;
font-size: 2em;
}
.user.notification .svg.green {
color: var(--color-green);
}
.user.notification .svg.red {
color: var(--color-red);
}
.user.notification .svg.purple {
color: var(--color-purple);
}
.user.notification .svg.blue {
color: var(--color-blue);
}
.user.notification .content { .user.notification .content {
float: left; float: left;
margin-left: 7px; margin-left: 7px;
@ -170,4 +149,13 @@
#notification_div .tab.segment { #notification_div .tab.segment {
overflow-x: auto; overflow-x: auto;
padding: 0;
}
#notification_div .menu .active.item {
background: var(--color-box-body);
}
#notification_table {
border: none;
} }