Admin badge on posts & moderator group on profile


#1

Hello. I’m using Discourse/w tests-passed for my forum. I have two bugs with my installation, which kinda annoy me.

1 . Admin badge is not visible on posts

I have a temporary workaround. I granted myself Moderator status and changed “This user is a moderator” text to “This user is part of the staff” and it appears, but here comes the other issue:

2 . Moderator group appears on profile.

Isn’t it supposed to be hidden?

I’m not really sure what caused it. Can you help me? Thanks in advance!


(cpradio) #2

Item 1, is intentional, so is item 2, so neither of these seem to be bugs.

For handling item 1, you did it right, you are supposed to grant Moderator status too to the Admin for the shield to show up.

For item 2, you can hide it using CSS.

a.group-link[href*=moderators] {
  display: none;
}

Just realize if there are multiple groups assigned to the user, it may be awkward.


#3
  1. That is wrong. When i migrated the forum to Discourse - It used to be a phpBB3 forum i had a badge saying “This user is administrator”. I wasn’t on the moderators group. After some updates it disappeared from posts, but it still shows on my profile as seen on the picture.

  2. I tried this before, but it doesn’t hides “group”.


(cpradio) #4

No, it isn’t. It was altered to behave this way intentionally, it is expected behavior at this point.

shrug, works for me… :confused: (or are you wanting to hide the word group too?)


#5

Yes. That’s what i meant, but only for “moderators” because i have two other groups which i want to appear.


(cpradio) #6

Okay, try this

.about .secondary dl dt:last-of-type { display: none !important; }
.about .secondary dl dd.groups { display: none !important; }

#7

This only half solves my issue, since it hides these two groups i mentioned, which i want to appear not just the moderator one. I’m sorry for being a pain.


(cpradio) #8

Then you will want to go back to this one.

a.group-link[href*=moderators] {
  display: none !important;
}

Again, it is going to leave the comma, but there isn’t anything I can do about that.

I’m a bit confused by what you are trying to do though, as earlier you wanted to remove the word groups, and now it seems you need it since there will be other groups listed…

Maybe provide a screenshot of what it looks like now and another of what you want it to look like.


#9

I will just keep them hidden then.


(Mittineague) #10

If I’m understanding, the problem isn’t that a Group is being shown, but which group is being shown.
eg. as an Admin you want that to be shown as the group rather than Moderator

I know the “double shield” thing has been fixed, and IMHO the Badges that display on the User Cards are well chosen from the larger set of Badges.

But I don’t know how it is decided which Group gets displayed on a Profile.
Maybe by Id ?

I need to go out for a while but I’ll look into it a bit ASAP

EDIT
I had a look around and the decision looks fairly hard-coded in AFAICT

templates/user/user.hbs has

{{#if model.displayGroups}}
  <dt>{{i18n 'groups.title' count=model.displayGroups.length}}</dt>
  <dd class='groups'>
    {{#each group in model.displayGroups}}
      <span>{{#link-to 'group' group class="group-link"}}{{group.name}}{{/link-to}}</span>
    {{/each}}
  </dd>
{{/if}}

and models/user.js.es6 has

@computed("groups.@each")
displayGroups() {
  const groups = this.get('groups');
  const filtered = groups.filter(group => {
    return !group.automatic || group.name === "moderators";
  });
  return filtered.length === 0 ? null : filtered;
},

All of the 9 default groups are “automatic true”, so moderators it is.