Improve the look and implementation of trophies.

Review Request #8324 — Created Aug. 12, 2016 and submitted

Information

Review Board
release-3.0.x
99fa716...

Reviewers

This change makes a small handful of improvements to our trophies,
covering the implementation of TrophyType 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"

daviddavid

In your description, "presentational" isn't a word.

daviddavid

'six' imported but unused

reviewbotreviewbot

'logging' imported but unused

reviewbotreviewbot

undefined name 'AlreadyRegisteredError'

reviewbotreviewbot

undefined name 'six'

reviewbotreviewbot

undefined name 'six'

reviewbotreviewbot

Since there are so many items here, can we put one per line?

daviddavid

Don't need the "like" in here. Trophies are achievements.

daviddavid

perhaps "registered trophy type"?

daviddavid

Can you clarify in this comment what type this should be? It's not clear from the field name or description.

daviddavid

We don't need the .yay class anymore, right?

daviddavid
reviewbot
  1. 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
    
    
  2. reviewboard/accounts/managers.py (Diff revision 1)
     
     
    Show all issues
     'six' imported but unused
    
  3. reviewboard/accounts/trophies.py (Diff revision 1)
     
     
    Show all issues
     'logging' imported but unused
    
  4. reviewboard/accounts/trophies.py (Diff revision 1)
     
     
    Show all issues
     undefined name 'AlreadyRegisteredError'
    
  5. reviewboard/accounts/trophies.py (Diff revision 1)
     
     
    Show all issues
     undefined name 'six'
    
  6. reviewboard/accounts/trophies.py (Diff revision 1)
     
     
    Show all issues
     undefined name 'six'
    
  7. 
      
chipx86
reviewbot
  1. 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
    
    
  2. 
      
david
  1. 
      
  2. Show all issues

    Typo in description: "ALl methods"

  3. Show all issues

    In your description, "presentational" isn't a word.

    1. Sure it is.

      http://www.dictionary.com/browse/presentational

  4. reviewboard/accounts/trophies.py (Diff revision 2)
     
     
     
     
     
     
    Show all issues

    Since there are so many items here, can we put one per line?

  5. reviewboard/accounts/trophies.py (Diff revision 2)
     
     
    Show all issues

    Don't need the "like" in here. Trophies are achievements.

  6. reviewboard/accounts/trophies.py (Diff revision 2)
     
     
    Show all issues

    perhaps "registered trophy type"?

  7. reviewboard/accounts/trophies.py (Diff revision 2)
     
     
    Show all issues

    Can you clarify in this comment what type this should be? It's not clear from the field name or description.

  8. reviewboard/static/rb/css/ui/boxes.less (Diff revision 2)
     
     
    Show all issues

    We don't need the .yay class anymore, right?

    1. Probably not. Wasn't sure if anything else used it.

  9. 
      
chipx86
reviewbot
  1. 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
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-3.0.x (613b09f)