Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
Qpixel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIP
Answers
Qpixel
Commits
ee183731
Commit
ee183731
authored
5 months ago
by
Monica Cellio
Browse files
Options
Downloads
Patches
Plain Diff
for mods, add number of warnings/suspensions sent (if any) to user profile page
parent
7996b4b3
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/models/community_user.rb
+4
-0
4 additions, 0 deletions
app/models/community_user.rb
app/views/users/show.html.erb
+8
-0
8 additions, 0 deletions
app/views/users/show.html.erb
with
12 additions
and
0 deletions
app/models/community_user.rb
+
4
−
0
View file @
ee183731
...
...
@@ -30,6 +30,10 @@ class CommunityUser < ApplicationRecord
false
end
def
latest_warning
mod_warnings
&
.
order
(
created_at:
'desc'
).
first
.
created_at
end
# Calculation functions for privilege scores
# These are quite expensive, so we'll cache them for a while
def
post_score
...
...
This diff is collapsed.
Click to expand it.
app/views/users/show.html.erb
+
8
−
0
View file @
ee183731
...
...
@@ -20,6 +20,14 @@
</div>
<%
end
%>
<%
if
moderator?
&&
@user
.
community_user
.
mod_warnings
&
.
size
.
positive?
%>
<div
class=
"notice is-info h-m-b-4"
>
<p>
<%=
pluralize
(
@user
.
community_user
.
mod_warnings
.
count
,
'message'
)
%>
sent,
most recent:
<%=
time_ago_in_words
(
@user
.
community_user
.
latest_warning
)
%>
ago
</p>
</div>
<%
end
%>
<div
class=
"grid
<%=
deleted_user?
(
@user
)
?
'deleted-content'
:
''
%>
"
>
<div
class=
"grid--cell is-9-lg is-12"
>
<div
class=
"h-p-0 h-p-t-0"
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment