فرق بين أيقونات الدرع للمشرف والمراقب

Given the surprising level of difficulty, maybe we should just leave this be… not like it is broken the way it is.

إعجاب واحد (1)

I know it’s late but I just want to share my solution to display that admin crown ( so far only on topic’s page ) by using CSS and JS. I could also use some help cause for some reason my js code is not working…I can see it in that inline theme js file but still not working ( works well on jsfiddle though )

SSd

CSS

.names span.admin a::after {
content: "";
width: 17px;
height: 14px;
margin-left: 5px;
background-image: url(https://www.dropbox.com/s/0oi0y3ex3rtfvk5/cd-crown.svg?raw=1);
background-repeat: none;
display: inline-block;
position: relative;

}

JS ( to display the title on hover - but as I said is not working when I include it inside )
Working Jsfiddle demo

var cdcrowntitle = document.querySelector(".names .admin a");
cdcrowntitle.setAttribute("title", "Community Admin");
إعجابَين (2)

Got the same feedback from one of our moderators. Any progress/ideas on differentiating the admin/moderator icons in the past 2 years?

إعجاب واحد (1)

didn’t see it anywhere in this topic but i use CSS on my forum to make different colored shields for mods and admins for posts (if admins are members of moderator groups). in my case, mods get gold shields and admins get grey. but one can use any color in those color properties of course.

common css

// * change shield color in posts differentiating admin and mod users* //

span.username {
  &.moderator .d-icon.d-icon-shield-alt {
    color: #d5b907;
  }
  &.admin .d-icon.d-icon-shield-alt {
    color: #969696;
  }
} 

i haven’t bothered to do it for user cards or profiles but i suppose i could figure it out.

you can also change the color of the moderator and admin usernames in posts to distinguish them further:

// *change color of usernames differentiating admins and mods* //

span.username {
  &.moderator a {
    color: #d5b907;
  }
  &.admin a {
    color: #969696;
  }
} 
6 إعجابات

The shield color change didn’t work- it still looked the same grey for both. Has the selector changed since this was posted?

Possibly. A quick inspect of the page can help you determine the class.

إعجابَين (2)

The icon is now named d-icon-shield-halved.

5 إعجابات

yea icon name changed so it should be like this

span.username {
  &.moderator .d-icon.d-icon-shield-halved {
    color: #d5b907;
  }
  &.admin .d-icon.d-icon-shield-halved {
    color: #969696;
  }
}

result

4 إعجابات

Thanks Lilly! And… CocoQuark, however you spell that.

إعجاب واحد (1)

Just wondering if we wanted to swap say the admin icin with the Wizard hat would swap color with display none and then add a line with the .d-icon.d-icon-wizard? (Not sure of the wizard hat fa off hand)

The fa is:
fa-solid fa-hat-wizard
So what would the css be, then? If I wanted to change the admin icon to hat-wizard?

إعجاب واحد (1)

The same CSS.
The class will still be d-icon-shield-halved regardless of the icon you replaced with, if you use this replacement method:

إعجابَين (2)

Easiest way to do this is like with the same code as above, but also icon replacement code in head-tag tab like this:

in

<script type="text/discourse-plugin" version="0.8"> 
  
  api.replaceIcon('shield-halved', 'hat-wizard')

</script>

result:

5 إعجابات

Will it work so admins can have the hat and moderators the shield? Or does it just replace all of them like in the picture, and if so, is there a way around it?

إعجابَين (2)

well you might be able to hack a conditional css or some code in the script there. but that is icon replacement for all.

إعجاب واحد (1)

Actually, not even the wizard icon is working right now. I used the exact code in the head you gave me.
I can try again, maybe it was a glitch or something.

Did you add the wizard hat icon in the SVG icon subset site setting?

إعجاب واحد (1)

This is an OT question, but I would like to keep halfshield for mods. But I would very much like to show the wizard hat with admins [1]

But I can’t replace half shield with the hat, because of moderators.

Oh god…

I really should start reading topics :man_facepalming: Sorry.


  1. I have few middle aged women in my forum, and they are Potter fans; that would annoy them so much :joy: ↩︎

إعجابَين (2)

On my forum it shows only on user card and profiles, but not on topics.

Any idea what I’ve done again?

إعجاب واحد (1)

Shield svgfor revised code.