Improve the look and implementation of trophies.
Review Request #8324 — Created Aug. 12, 2016 and submitted
This change makes a small handful of improvements to our trophies,
covering the implementation ofTrophyType
subclasses, the presentation
of trophies, and the look of our standard trophies.On an implementation level,
TrophyType
subclasses no longer need to
override__init__
, as the metadata for the trophy is now stored in class
attributes. Older subclasses can install provide these through the
constructor, but will get deprecation warnings.Trophy registration is now based on a standard registry. The existing
methods remain for compatibility, but will show deprecation warnings.All methods and attributes are now properly documented as well.
On a presentational level, rendering problems with showing multiple
trophies or when there's an unknown trophy have been fixed. Trophies are
also no longer bound to a specific width and height (previously, this
would result in some weird problems with the positioning of the trophy).Trophies can also provide multiple images for different resolution
levels, allowing for @2x, @3x, etc. trophy images.The default trophies (fish and sparkly) have been updated with slightly
improved (crisper) visuals and support for Retina images. The sparkly
trophy is now more sparkly, and the fish trophy has a better base and
eye.
Unit tests pass.
Tested that trophies are still properly being calculated and assigned.
Tested that unregistered trophies previously assigned to a review request
no longer breaks the trophy banner.Tested that multiple trophies renders correctly.
Tested that new-style and legacy trophy subclasses work.
Tested the new trophy images on Retina and non-Retina displays.
Description | From | Last Updated |
---|---|---|
Typo in description: "ALl methods" |
david | |
In your description, "presentational" isn't a word. |
david | |
'six' imported but unused |
reviewbot | |
'logging' imported but unused |
reviewbot | |
undefined name 'AlreadyRegisteredError' |
reviewbot | |
undefined name 'six' |
reviewbot | |
undefined name 'six' |
reviewbot | |
Since there are so many items here, can we put one per line? |
david | |
Don't need the "like" in here. Trophies are achievements. |
david | |
perhaps "registered trophy type"? |
david | |
Can you clarify in this comment what type this should be? It's not clear from the field name or description. |
david | |
We don't need the .yay class anymore, right? |
david |
- Change Summary:
-
Fixed some import issues.
- Commit:
-
33c11793849709cd453a0c629a6937aef4882c3fb7875faf88397e524aa8901d32632a28a38cfd83
- Diff:
-
Revision 2 (+409 -100)
-
Tool: Pyflakes Processed Files: reviewboard/accounts/managers.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/accounts/models.py reviewboard/accounts/trophies.py Ignored Files: reviewboard/static/rb/images/trophies/sparkly@2x.png reviewboard/static/rb/images/trophies/fish@2x.png reviewboard/static/rb/images/trophies/fish.png reviewboard/static/rb/css/ui/boxes.less reviewboard/static/rb/images/trophy.png reviewboard/static/rb/images/fish-trophy.png reviewboard/templates/reviews/trophy_box.html reviewboard/static/rb/images/trophies/sparkly.png Tool: PEP8 Style Checker Processed Files: reviewboard/accounts/managers.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/accounts/models.py reviewboard/accounts/trophies.py Ignored Files: reviewboard/static/rb/images/trophies/sparkly@2x.png reviewboard/static/rb/images/trophies/fish@2x.png reviewboard/static/rb/images/trophies/fish.png reviewboard/static/rb/css/ui/boxes.less reviewboard/static/rb/images/trophy.png reviewboard/static/rb/images/fish-trophy.png reviewboard/templates/reviews/trophy_box.html reviewboard/static/rb/images/trophies/sparkly.png
- Change Summary:
-
- Fixed a typo in the description.
- Split up a bulky list of imports to be one per line.
- Clarified some docs.
- Removed the old
yay
CSS class.
- Description:
-
This change makes a small handful of improvements to our trophies,
covering the implementation of TrophyType
subclasses, the presentationof trophies, and the look of our standard trophies. On an implementation level,
TrophyType
subclasses no longer need tooverride __init__
, as the metadata for the trophy is now stored in classattributes. Older subclasses can install provide these through the constructor, but will get deprecation warnings. Trophy registration is now based on a standard registry. The existing
methods remain for compatibility, but will show deprecation warnings. ~ ALl methods and attributes are now properly documented as well.
~ All methods and attributes are now properly documented as well.
On a presentational level, rendering problems with showing multiple
trophies or when there's an unknown trophy have been fixed. Trophies are also no longer bound to a specific width and height (previously, this would result in some weird problems with the positioning of the trophy). Trophies can also provide multiple images for different resolution
levels, allowing for @2x, @3x, etc. trophy images. The default trophies (fish and sparkly) have been updated with slightly
improved (crisper) visuals and support for Retina images. The sparkly trophy is now more sparkly, and the fish trophy has a better base and eye. - Commit:
-
b7875faf88397e524aa8901d32632a28a38cfd8399fa7161de422749226c4eaa4a864fc3c3a6bc4d
- Diff:
-
Revision 3 (+412 -104)
-
Tool: Pyflakes Processed Files: reviewboard/accounts/managers.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/accounts/models.py reviewboard/accounts/trophies.py Ignored Files: reviewboard/static/rb/images/trophies/sparkly@2x.png reviewboard/static/rb/images/trophies/fish@2x.png reviewboard/static/rb/css/ie_hacks.css reviewboard/static/rb/images/trophies/fish.png reviewboard/static/rb/css/ui/boxes.less reviewboard/static/rb/images/trophy.png reviewboard/static/rb/images/fish-trophy.png reviewboard/templates/reviews/trophy_box.html reviewboard/static/rb/images/trophies/sparkly.png Tool: PEP8 Style Checker Processed Files: reviewboard/accounts/managers.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/accounts/models.py reviewboard/accounts/trophies.py Ignored Files: reviewboard/static/rb/images/trophies/sparkly@2x.png reviewboard/static/rb/images/trophies/fish@2x.png reviewboard/static/rb/css/ie_hacks.css reviewboard/static/rb/images/trophies/fish.png reviewboard/static/rb/css/ui/boxes.less reviewboard/static/rb/images/trophy.png reviewboard/static/rb/images/fish-trophy.png reviewboard/templates/reviews/trophy_box.html reviewboard/static/rb/images/trophies/sparkly.png