3
1

I want to customize existing badges AND I want to create a new badge.

Can you explain how I would do this and where? I think if you give me an example of 1 of each, I can figure out the rest. And yes, I know I can adjust the settings for some badges in the settings/badges are.

  1. How would I rename the badge "Nice Question" to "Awesome Question"? I understand that I can change the thresholds for many badges in the Admin panel.
  2. How would I create a new badge called "Forum Ninja" which is awarded when a person reaches 5000 karma?
  3. How would I create a new badge called "Amazing Question" after it's received 100 up votes?

From those examples, I think I should be able to customize everything else.

asked 12 May '11, 15:07

Orbits's gravatar image

Orbits
61238
accept rate: 0%

retagged 13 May '11, 10:30

tootie_ma's gravatar image

tootie_ma
356311

testing the slash command

(13 May '11, 17:22) Orbits

I can't give you exact examples anwsering straight to your questions right now but:

1) You've got translation marked string on osqa/forum_modules/default_badges/settings.py@58

class NiceQuestion(QuestionScoreBadge):
    expected_score = settings.NICE_QUESTION_VOTES_UP
    name = _("Nice Question")

There should be some simple thresholds settings in admin.

3) You can create "Amazing Question Badge" based on some badge which inherit from "QuestionScoreBadge" like the NiceQuestion badge mentioned above in osqa/forum_modules/default_badges/badges.py

2) "Forum Ninja" would need to get into badges most. Sorry for somekind of fuzzy anwser in advance.

  • You will need to create ForumNinjaBadge in osqa/forum_modules/default_badges/badges.py which inherits from intermidiate badge layers like QuestionScoreBadge mentioned above or straight from base Badge class called AbstractBadge. Look into other classes there for some idea how it works.
  • Add settings in osqa/forum_modules/default_badges/badges.py for your badge
  • Tie badge to some action propably Karma points save at some point in OSQA to trigger badge awarding.

There is also similiar question if you look for more badges customization (if you haven't already visited it yet).

link

answered 13 May '11, 08:40

tootie_ma's gravatar image

tootie_ma
356311
accept rate: 57%

edited 13 May '11, 10:26

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×61
×44
×12
×4

Asked: 12 May '11, 15:07

Seen: 768 times

Last updated: 13 May '11, 17:22

powered by OSQA