alexames / DeltaBot

GNU General Public License v3.0
65 stars 18 forks source link

Initial implementation of special flair for monthly top 10 users #56

Closed amorde closed 10 years ago

amorde commented 10 years ago

This is an initial implementation of the feature requested in #18

This uses the flair['top1'] and flair['top10'] values set in the config.json to add a special CSS class to the month's top earner and a different, special CSS class for the month's top 2-10 earners.

This clears last month's CSS flairs as well as this months, so that only 10 users have the special flairs at any given time.

The update_top_ten_css method only modifies the CSS class of the flair, not the actual value.

This HAS NOT BEEN TESTED. Although the tests pass, I have no real way of testing this without access to DeltaBot.

Snorrrlax commented 10 years ago

Thanks for doing this.

We started running it, and there appears to be a bug. DeltaBot is deleting the flair text of some users, or rather when it updates the css class it forgets to re-add the text? I'm not sure...

It also makes the css class "top 1 pholder" and "top ten pholder" instead of just "top 1" and "top 10", was this deliberate?

amorde commented 10 years ago

The CSS classes are supposed to be defined in the JSON, that's where the "placeholder" values come from.

And I thought I only removed occurrences of the special classes from the CSS - I'll review it again

On Apr 15, 2014, at 3:38 PM, Snorrrlax notifications@github.com wrote:

Thanks for doing this.

We started running it, and there appears to be a bug. DeltaBot is deleting the flair text of some users, or rather when it updates the css class it forgets to re-add the text? I'm not sure...

It also makes the css class "top 1 pholder" and "top ten pholder" instead of just "top 1" and "top 10", was this deliberate?

— Reply to this email directly or view it on GitHub.

amorde commented 10 years ago

So I've created a fix and pushed it to my fork, but the main repository is in a state that will not include all of the code if I submit a new pull request.