mozilla/kitsune — pull request #1592 by willkg (2013-08-29 20:51:37+00:00)
Title: Badges 896137

BADGES!!!!

Here's the message from the second commit which covers the status of this:

* adds kbadge django app which will centralize badge-related things
* adds notification for badge awarding which will email the awardee
* adds an "award list" page and an "award details" page
* adds some really basic tests

At this point, you can:

1. create a badge in the admin
2. award a badge to someone in the admin
3. see the list of recently awarded badges (/awards/)
4. see the details for a specific award
(/badge//awards//)

To test:

1. migrate your db
2. run the tests
3. do `./manage.py runserver`
4. go to the admin
5. see the new django badger related models
6. create a badge in the Badge section
7. award the badge to someone in the Award section
8. notice the email that got sent in your console log
9. check out http://localhost:8000/awards/ to see recently awarded badges--links should work
10. do `./manage.py extract` and verify that django-badger strings show up in .pot file

Some questions you might be asking:

1. Why "kbadge"? I originally put the badge code in the `sumo` app, but then moved it to `kbadge` because I think it'll grow over time. I think we'll want to use "badge" in a bunch of places (we already use it as a model factory in the tests). "badger" seems tied to "django-badger" (maybe we'll switch libs some day). We have a "kadmin". Figured I'd follow suit. I'm game for changing the app name.
2. WTF is up with the template directories? We're using the django-badger views so we need to use its template paths.
3. WTF is up with the view names? We're using the django-badger views, but I didn't want to use *all* the views in the django-badger urls.py, so I'm just using the routes I was interested in.
4. Why did it take you weeks to do this? A lot of the work was in django-badger, documentation and a couple of false starts on architecting things.

That's the gist of it. I need to write up bugs for a bunch of outstanding things:

1. restyling the recent awards page
2. restyling the award details page
3. creating a badge page
4. adding badges to user profiles
5. restyling award notification emails
6. figuring out interaction between SUMO and badge backpack
7. figure out l10n issues with badge title and description (probably need to extract these strings from the db to localize them)

r?