Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A way to see who reacted #42

Open
daath opened this issue Feb 26, 2019 · 5 comments
Open

A way to see who reacted #42

daath opened this issue Feb 26, 2019 · 5 comments

Comments

@daath
Copy link

daath commented Feb 26, 2019

My users have requested a way to see who has reacted - Doing mouse-over reveals a couple of names, but not the rest - Clicking it just reacts - Holding LMB on the icon reveals the same couple of names...

Thanks! :)

@IwishIcanFLighT
Copy link

IwishIcanFLighT commented Mar 20, 2019

Hi!

I would also be very interested for the same reasons as @daath stated. 👍

EDIT: Looking at the code, it seems like the modification should be done in the sentence() function Line 23:

https://github.com/gdpelican/retort/blob/798535fd3ffb179833d9c23a5d82793b2bf9e645/assets/javascripts/discourse/widgets/templates/retort-toggle.js.es6

  sentence() {
    let usernames = this.state.usernames
    switch(usernames.length) {
      case 1:  return `${usernames[0]} reacted with :${this.state.emoji}:`
      case 2:  return `${usernames[0]} and ${usernames[1]} reacted with :${this.state.emoji}:`
      default: return `${usernames[0]}, ${usernames[1]}, and ${usernames.length - 2} others reacted with :${this.state.emoji}:`
    }
}

Replacing default case by a loop inside usernames should be fairly simple to do

@wolftune
Copy link

Would be clearer if title were edited to say "all who reacted"

@GokulNC
Copy link

GokulNC commented May 4, 2020

@IwishIcanFLighT Can you please make a pull request with the changes you said?

@IwishIcanFLighT
Copy link

@GokulNC Sorry I never got the time to actually make this change and no longer need it for my discourse instance.

In the meantime from what I found it looks like my previous suggestion cannot be applied anymore as the plugin seems to support different locales now:
https://github.com/gdpelican/retort/blob/7fd191b7e47a9612163436556e14ed1cd1b313ac/config/locales/client.en.yml

en:
  js:
    retort:
      title: 'add an emoji reaction to this post'
      reactions:
        one_person:  "%{first} reacted with :%{emoji}:"
        two_people:  "%{first} and %{second} reacted with :%{emoji}:"
        many_people: "%{first}, %{second}, and %{count} others reacted with :%{emoji}:"

I suppose you'd also need to modify the code in this file as well:
https://github.com/gdpelican/retort/blob/8d582c512ae89427c6e0520f9f256e91c05aa07b/assets/javascripts/discourse/widgets/retort-toggle.js.es6

  sentence({ usernames, emoji }) {
    let key
    switch(usernames.length) {
      case 1: key = 'retort.reactions.one_person'; break
      case 2: key = 'retort.reactions.two_people'; break
      default: key = 'retort.reactions.many_people'; break
    }

@crsh
Copy link

crsh commented Jul 21, 2021

Hi there, thanks for this wonderful plugin! My community has also expressed an interest in this feature. To me it would be ideal if this worked similarly to the built-in like button: Always display a number alongside the reaction and show the reacters underneath the reactions when the number is clicked. I think the relevant Discourse code can be found here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants