|
This question will be filled out with information on how to customize badges as part of the OSQA customization guide. How do you customize badges or create new badges?
Modifying constants associated with badges should be a matter of modifying the contants in Creating new badges:
Note: the
This question is marked "community wiki".
|
|
A badge in OSQA is represented by a class inheriting from AbstractBadge, that you can find under forum/badges/base.py. Besides the AbstractBadges class there are a couple of helper subclasses:
The default_badges folder is a module that contains the default badges implementations, you don't even need to use that module, you can create your own implementations in a separate module, or as an addition to the defaults. Now is all I have time for, but I'll come back a bit latter and edit this with more details and some concrete examples. PS: That sql file (and the entire sql scripts folder can just be ignored, they we're forgotten there on git, but they are gone on svn).
link
This answer is marked "community wiki".
Presumably these custom badges aren't accessible via the admin console? (i.e. You need to jump into the python to tweak their settings)
(22 Oct '10, 10:09)
camassey
@Camassey, those are accessible through the admin as well.
(22 Oct '10, 10:23)
Hernani Cerq... ♦♦
@Hernâni Hmmm... That's odd, because there seem to be about 10 badges that don't show up in the Admin for ASK.SQLServerCentral.com - Does it make a difference if they were created for the StackExchange import, or is this just a bug?
(22 Oct '10, 12:47)
camassey
@Camassey, some badges don't have any type of configuration. For example, the autobiographer badge, or all the badges that are "first something". In fact, ask.ssc has only the default set of badges, which happen to be contained in a module, so they are just like any other custom badges.
(23 Oct '10, 10:59)
Hernani Cerq... ♦♦
|
Nice start, Parand! I will try to make sure to go over this with Hernani to confirm the steps. It might be a good idea to grant you editing privileges on the wiki, too.
Just to tell that this is not forgotten, I'll try to finish this tonight after migrating all our sites to the new codebase.