Show user id on profile pages to moderators and admins
This commit is contained in:
parent
f5095fe3bd
commit
caf49bb25d
3 changed files with 7 additions and 0 deletions
|
@ -131,6 +131,10 @@
|
|||
<% end -%>
|
||||
</dd>
|
||||
<% end -%>
|
||||
<% if current_user&.moderator? || current_user&.administrator? %>
|
||||
<dt class="list-inline-item m-0"><%= t ".uid" %></dt>
|
||||
<dd class="list-inline-item"><%= link_to @user.id, api_user_path(:id => @user.id) %></dd>
|
||||
<% end -%>
|
||||
</dl>
|
||||
</small>
|
||||
</div>
|
||||
|
|
|
@ -2697,6 +2697,7 @@ en:
|
|||
remove as friend: Unfriend
|
||||
add as friend: Add Friend
|
||||
mapper since: "Mapper since:"
|
||||
uid: "User id:"
|
||||
ct status: "Contributor terms:"
|
||||
ct undecided: Undecided
|
||||
ct declined: Declined
|
||||
|
|
|
@ -495,6 +495,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
|
|||
assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/blocks']", 0
|
||||
assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/blocks_by']", 0
|
||||
assert_select "a[href='/blocks/new/#{ERB::Util.u(user.display_name)}']", 0
|
||||
assert_select "a[href='/api/0.6/user/#{ERB::Util.u(user.id)}']", 0
|
||||
end
|
||||
|
||||
# Login as a moderator
|
||||
|
@ -512,6 +513,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
|
|||
assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/blocks']", 0
|
||||
assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/blocks_by']", 0
|
||||
assert_select "a[href='/blocks/new/#{ERB::Util.u(user.display_name)}']", 1
|
||||
assert_select "a[href='/api/0.6/user/#{ERB::Util.u(user.id)}']", 1
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue