1UP : Code refractoring + trail modification and deletion
Repository
https://github.com/therealFlauwy/1UP
Following this post from @flauwy, I've been tasked to start the creation of the new 1UP.
As a reminder, @utopian-1UP was an Utopian bot front-runner in which members of the community would decide which are the best posts to vote for. the @utopian-1up would then vote for the best post every 2.4 hours, followed by hundreds of curators in the trail.
What s new?
Code refractoring
The code started to become quite heavy so I thought it was time for some refractoring, putting the routes in different files according to their use : for communities, for trails, etc.The functions are defined in utils.js
and can be called from any of those routes.
Lots of work has been done on the getSession
function that allows to get information about the user.
Indeed, users can be related to a community in many different ways, and we need this information. For each user we need to get :
- Which communities the user is either an admin, moderator or owner.
- Which communities the user is trailing
- Which community the user is acting as a trail tail (if any)
For reminder, what I call the trail tail, is the last account voting on the trail, the community whale.
Updating and deleting the trail
Whether being a normal trailing account or the trail tail, users can edit or remove their participation to the trail from the View page.
New PATCH and DELETE routes have been created for both the Trail and TrailTail objects.
The CSS will soon be added by @flauwy.
Administrators can also remove the trail tail from the Edit page.
Future work
- Fetch the posts the post corresponding to the community criteria
- Display these posts and allow 1UP votes on it
- Vote on the best post of the period
Live Demo
As a demonstration speaks more than lots of words, I ve put back online the old Utopian1UP website. You can try by yourself and create a community and link a trail to it for testing purposes.
No votes will be casted do not worry, but it's an offline token so, for safety reasons, I would recommend using a test account.
Pull Request
GitHub Account
![Meet me at SteemFest 2018 in Kraków](https://steemitimages.com/640x0/https://files.steempeak.com/file/steempeak/rubencress/TdasrV2W-steemfest-round-corner.png)
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, @helo!
So far this week you've reviewed 4 contributions. Keep up the good work!
Very nice
That is amazing!!............
Nice, the settings are done. Next step: 1UP-pping! :P
Interesting - great to hear about the progress :D
Hi @stoodkev!
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