Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove conflicting CSS rules on notifications, improve notifications table #23565

Merged
merged 4 commits into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions templates/user/notification/notification_div.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,26 @@
{{$issue := .Issue}}
{{$repo := .Repository}}
<tr id="notification_{{.ID}}">
<td class="collapsing" data-href="{{.Link}}">
<td class="collapsing gt-pl-4" data-href="{{.Link}}">
{{if eq .Status 3}}
<span class="blue">{{svg "octicon-pin"}}</span>
{{svg "octicon-pin" 16 "text blue"}}
{{else if not $issue}}
<span class="gray">{{svg "octicon-repo"}}</span>
{{svg "octicon-repo" 16 "text grey"}}
{{else if $issue.IsPull}}
{{if $issue.IsClosed}}
{{if $issue.GetPullRequest.HasMerged}}
<span class="purple">{{svg "octicon-git-merge"}}</span>
{{svg "octicon-git-merge" 16 "text purple"}}
{{else}}
<span class="red">{{svg "octicon-git-pull-request"}}</span>
{{svg "octicon-git-pull-request" 16 "text red"}}
{{end}}
{{else}}
<span class="green">{{svg "octicon-git-pull-request"}}</span>
{{svg "octicon-git-pull-request" 16 "text green"}}
{{end}}
{{else}}
{{if $issue.IsClosed}}
<span class="red">{{svg "octicon-issue-closed"}}</span>
{{svg "octicon-issue-closed" 16 "text red"}}
{{else}}
<span class="green">{{svg "octicon-issue-opened"}}</span>
{{svg "octicon-issue-opened" 16 "text green"}}
{{end}}
{{end}}
</td>
Expand Down
30 changes: 9 additions & 21 deletions web_src/css/user.css
Original file line number Diff line number Diff line change
Expand Up @@ -90,27 +90,6 @@
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 {
float: left;
margin-left: 7px;
Expand Down Expand Up @@ -175,4 +154,13 @@

#notification_div .tab.segment {
overflow-x: auto;
padding: 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made a comment on the backport PR, forward it here.

#23621 (comment)

The padding: 0 breaks the UI when there is no notification.

Copy link
Member Author

@silverwind silverwind Mar 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't call it "break" but yes the "No items" div needs a bit more styling now that padding is removed.

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, sorry I only know some English words. What do you think it should be called? I will follow your wording.

}

#notification_div .menu .active.item {
background: var(--color-box-body);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the background should be set separately?

I guess all Dropdown menu items should share the same styles across the whole Gitea?

Copy link
Member Author

@silverwind silverwind Mar 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropdown? This is a tab directly attached on top of the table, quite unique I'd say.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought I do guess we could go for pull-style tabs here as well, like on the Releases/Tags page.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you only want to modify the "tab menu" styles, I think it's better to do #notification_div .tabular.menu

Otherwise, if there is a dropdown inside, its style is affected by .menu .active.item

}

#notification_table {
border: none;
}