Skip to content

Conversation

@TheodorKitzenmaier
Copy link
Contributor

Adds support for a new type of awards, "medals".

Medals can be granted for first, second or third place, and are tied to the name of an event on the dojo. Medals are granted by admins of any dojo which has the grant_awards permission. There is support for granting, revoking, and pruning event awards.

They are displayed alongside normal emoji awards, however if a user has multiple medals of the same tier, they will be foldered. In practice, this means that only a single medal will show, however the description shown when hovering over the award will show all events that tier of medal was won in.

This feature is part of my Capstone project at ASU to support competitive events on the dojo infrastructure.

Added a new "medals" group to the Emojis database.

Added a utility method to grant a medal to a user.
Added Event Emoji cases to `get_viewable_emojis`.
Popups now have a custom message for event medals.
Granting of event awards is now at API/dojo/<dojo>/event/grant.
- Takes a POST request, with `user_id`, `event_name`, and `place` as arguments.

Added a `dojo_gives_awards` decorator.
- Requires the dojo to have `grant_awards` as part of its *permissions*.
Found at `API/dojo/<dojo>/event/revoke`
- Takes in `user_id` and `event_name` as JSON arguments.
Added fixtures for an event dojo and random event name.
- Admin creates a dojo and a sql update adds grant_awards to its permissions.

Added a dojo YML for an event/medal dojo.
Test granting, revoking, and pruning.

Test error handling.
Logged "error" entry in response json for failing tests.
Added expiration to emojis, and added foldering to normal emojis.
- Partially removed Medals.
Grant medals in the emoji table.
- Follow the normal emoji format.
Updated the Medal API to take an expiration date, and removed prune/revoke options.
Removed an old placeholder event testing API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant