Attribuer en masse un badge à un groupe d'utilisateurs

Les badges sont un excellent moyen de reconnaître quelqu’un qui fait du bon travail. Discourse permet désormais d’attribuer un badge à un ensemble d’utilisateurs.

Si vous accédez à la section des badges dans le panneau d’administration, vous remarquerez qu’un nouveau bouton appelé « Attribution en masse » est maintenant disponible à côté du bouton « Nouveau » :

Screen Shot 2020-01-15 at 11.34.31

Après avoir cliqué dessus, vous serez invité à sélectionner un badge et à commencer :

Sélectionnez le badge que vous souhaitez attribuer et téléchargez un fichier CSV contenant une liste d’adresses e-mail ou de noms d’utilisateur (un par ligne)

Ensuite, vous recevrez ce message :

Discourse trouvera les utilisateurs correspondants, leur attribuera le badge et leur enverra une notification.

48 « J'aime »

This is cool.

I propose changing this language to “awarding a badge to a set of users”, as group has a specific meaning in Discourse and a bunch of random email addresses in a CSV isn’t it :wink:.

23 « J'aime »

Very nice, This will be useful :slight_smile:

5 « J'aime »

Awww Yiss, that’s very handy. Thanks :slight_smile:.

3 « J'aime »

This is great, thanks for the feature :slight_smile:

5 « J'aime »

Selecting them from a user list could be easier if possible. Good feature anyway.

5 « J'aime »

Yes that’s my ideal idea. :grin:

Just press on users you want to award too.

2 « J'aime »

Sorry, but I’m not 100% clear on this. Terminology I’m familiar with is:

enclosure, delimiter (the separator) and terminator

enclosure is often quotation marks
delimiter is often a comma
terminator is often a newline

eg.

"1", "Bob", "rkelly@gmail.com", "CA" 
"2", "Carol", "counselor@hotmail.com", "CA" 
"2", "Ted", "tman@yahoo.com", "FL" 

I doubt you mean

rkelly@gmail.com 
, 
counselor@hotmail.com 
, 
tman@yahoo.com 
1 « J'aime »

What I meant was:

rkelly@gmail.com,
counselor@hotmail.com, 
tman@yahoo.com

I edited the post.

6 « J'aime »

When bulk-adding users to a group, the system expects a list of user names. When bulk-adding users to a badge, the system expects a .csv file with e-mail addresses.

Personally I prefer the list of usernames, as it’s a lot easier to get those from the forums without jumping through admin-y hoops, and I’ve got some Excel tricks that can spit out a copy-and-pastable list. I used to bulk-assign badges by bulk-adding a list to a temporary group, then changing the badge query to assign to that whole group. When ‘award a badge to a set of users’ popped up I’d hoped to cut out a step…

Is there any way to make the list-of-users method a valid alternative way to bulk-assign badges?

8 « J'aime »

I agree we should be supporting both.

If the first item in the list has an “@”, then import by email, otherwise, import by username.

Also, we could be a little more lenient when it comes to the format of that list.

We could just require the emails/usernames to be on their own line and then do a split("\n"), remove any empty lines, remove any trailing “,” and remove any pair of single/double quotes (eg. gsub(/^['"]|['"]$/, "")).

9 « J'aime »

I know it’s hard and starts to risk mission-creep, but I wonder if over time the admin UI could aim towards more consistency across all Admin bulk operations? For example when:

  1. Awarding Badges in bulk: Select badge then upload a CSV of users’ email addresses

  2. Adding users to a Group in bulk: Select group then paste a list of usernames or emails, one per line

  3. Inviting users to Discourse in bulk: Upload a CSV containing users’ email addresses (optionally specifying groups(s) to add them to and the initial post to show them)

Clearly these have areas of commonality but also areas of definite disparity where they are not doing the same thing. So how easy it is to work towards a consistent UI paradigm for all Admin bulk actions, I don’t know. But I thought I’d raise the issue here since it is being discussed.

Of all three variants, I’d say the nicest at the moment is the Bulk Add To Group ‘Paste a list of usernames or emails, one per line’.

Quite often I want to Invite several users (say 5-10) and the one-by-one invite method is a bit irritatingly slow, but the CSV invite method is a bit faffy and requires me to fire up another program, or edit CSV manually. Even if the CSV upload was kept for the really BIG bulk invites, it would be great to have an Invite Users dialog like the Bulk Add To Group one. Of course it could only accept email addresses, one per line, but this would be fine.

8 « J'aime »

Thanks everyone for the feedback! :slight_smile:

We added username support here:

13 « J'aime »

Though still not as simply as pasting a list of usernames into a box, that’s a great step forward from needing e-mails! Are there any plans to unify the bulk handling of adding users to groups or badges? I’m not a programmer, but that sounds like re-usable code to me :slight_smile:

2 « J'aime »

Est-il possible d’attribuer plusieurs fois un badge à un utilisateur avec cette fonctionnalité ? Selon mes propres tests, cela semble ne pas être pris en charge.

L’attribution en masse d’un badge à une liste d’utilisateurs n’accorde pas un deuxième badge à ceux qui en possèdent déjà un.

1 « J'aime »

Si la case « Peut être attribué plusieurs fois » du badge est cochée (située dans la section inférieure de la page d’administration des badges), vous devriez pouvoir attribuer le badge plusieurs fois de cette manière.

3 « J'aime »

Je l’ai activé, mais avec une importation CSV (même une simple liste de noms d’utilisateurs qui possèdent déjà le badge), cela ne le réattribue pas. Je dois attribuer manuellement le badge à l’utilisateur avant qu’il ne s’affiche comme étant attribué plusieurs fois.

2 « J'aime »

Pouvez-vous attribuer un badge à une ou deux personnes manuellement plutôt qu’en téléchargeant un fichier CSV ?

Pour une raison quelconque, le badge « enthousiaste », qui s’obtient en se connectant pendant 10 jours consécutifs, ne fonctionne pas pour une personne qui s’est connectée pendant 12 jours consécutifs.

1 « J'aime »

Je pense que ce badge est assez fiable, mais parfois la différence entre les fuseaux horaires et l’UTC peut lui donner une apparence trompeuse.

Je ne pense pas que vous puissiez attribuer ce badge manuellement actuellement, mais créer un fichier CSV avec le(s) nom(s) d’utilisateur(s) ne prend qu’une seconde ou deux. Je viens de faire un essai en utilisant Google Sheets sur mon téléphone, et c’était très rapide. :+1:

6 « J'aime »

Je souligne juste ce message, car il n’était pas très clair dans le premier message comment formater correctement le csv.

3 « J'aime »