Utopian.rocks - Category filtering, moderator comments feed

in utopian-rocks •  6 years ago  (edited)


Credit to @podanrj
https://utopian.rocks/

Repository

https://github.com/amosbastian/utopian.rocks

Pull request

https://github.com/amosbastian/utopian.rocks/pull/25

Since I'm really only interested in contributions from the best category, also known as the development category, I've added a way to filter the contributions by a specific category. I've also added a new page that shows all the comments made by moderators that are waiting to be upvoted, which should also be useful for community managers wanting to check the comments made by moderators in their category.

Filtering by category

filtering_categories.gif

I'm very new to actually using JavaScript, so this took way longer than it should've. It can also probably be done in a better way, but I'm still learning and it does work, so bear with me. The implementation is as simple as you would expect: if you click on a category's icon it removes the class "show" from each contribution that isn't part of that category. It also removes the "category--inactive" class from the icon, so its colour is set to the category's colour when clicked. Simple, but effective!

Moderator comment feed

moderator_comment.gif

This took a little while to implement as well. Before this update the contributions in my database didn't include the actual review date (only the day, not the time), nor the URL of the moderator's comment. Once this was added I needed a way to figure out when a moderator's comment is upvoted. Luckily enough the way the bot behaves is pretty simple: if it reaches 99.75% then it upvotes the oldest pending contribution and the oldest pending moderator comment if it is older than 2 days. This means that there are many more comments waiting to be upvoted than contributions, and so it's impossible to estimate the upvote time of some comments. To remedy this I simply use the same code as last time, but user itertool's zip_longest to zip the comments along the contributions, and assign the vote time to the comment if the contribution exists, and otherwise set it as TBD (to be determined).

for comment, contribution in zip_longest(comments, contributions):
        if contribution:
            comment["vote_time"] = contribution["vote_time"]
        else:
            comment["vote_time"] = "TBD"

I also decided to add the comment permlink to the contributions in the database, so it's easy for people to quickly navigate to the moderator's comment. Of course also all of the other URLs that would normally link to contributors have now been changed to link to the moderator's respective pages, and the red/green bar on the side shows if a moderator's comment is eligible for an upvote.


This will more than likely be the final thing I add to Utopian.rocks for a while, because I have run out of ideas and want to focus on other projects for now! However, if there is really is something cool you need to see added, then don't hesitate to create an issue here. Thanks!

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Great news! I have started liking the new interface. :)

After the filtering on categories, contribution count stays the same. Maybe recalculating and updating it for the corresponding category would be better.


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Thank you for your review, @emrebeyler!

So far this week you've reviewed 5 contributions. Keep up the good work!

Great post and very nice addition!

It's also very practical for utopian curators ;)

Thanks and good point, I didn't really think of that!

Hi @amosbastian!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hey, @amosbastian!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!