Skip to content
keokilee edited this page Sep 23, 2011 · 3 revisions

The text of a few notifications are 'hard-coded' into Makahiki's source. As the number of notification types increases, this is not ideal because wording changes have to be done in the source code. We would like instead to have admins create a template for these notices. The NoticeTemplates model in components.makahiki_notifications provides a way for admins to define templates for certain events. These templates use the Django template language, so all of the Django template tags and filters (https://docs.djangoproject.com/en/1.3/ref/templates/builtins/) will work. After that, the template is rendered using Markdown (http://daringfireball.net/projects/markdown/syntax).

Template types and variables

Depending on the type of the template, there are additional template variables available for you. To insert a variable, use {{VARIABLE_NAME}} in the template.

Round Transition

This template is to be used when a new round starts. The following variables are available for this template:

  • PREVIOUS_ROUND - The name of the previous round (i.e. Round 1 or Round 2).
  • CURRENT_ROUND - The name of the current round (i.e. Round 2 or Overall).

Raffle Winner

This template is to be used when a user is awarded a raffle prize. The PRIZE template variable is the raffle prize object that is ready. To get the name of the prize, you can use {{PRIZE.name}}.

Canopy Elevation

This template is to be used when a user is elevated to the canopy. For now, there are no template variables.

Commitment Ready

This template is to be used when a user's commitment is ready for redemption. The COMMITMENT template variable is the commitment object that is ready. Note that to create a url, you will need to use the built-in url template tag. For example, for a commitment with slug 'foo', the template tag {% url activity_task 'commitment' COMMITMENT.slug %} will return /activities/commitment/foo.