The Chicago Boss API is mostly stable, but still might change before 1.0.
Chicago Boss liked Django's templating language so much, he decided to steal it. Template files go in your project's Web/ folder (in subdirectories that end in *_views), and will have access to the variables you pass from your Controller. The template file associated with the function foo_controller:bar will be Web/foo_views/bar.html.
Note: if you use the the extends tag, the file path should be relative to your project's Web/ directory.
Chicago Boss has support for the most common features of the Django Template Language, so many existing Django templates should work out of the box. Your templates will be compiled down to Erlang BEAM code using ErlyDTL to give you the fastest Erlang templates on the planet.
The following Django filters are supported in Chicago Boss. Hopefully this list will grow over time.
| add | Adds a number to the value. |
| addslashes | Adds slashes before quotes. |
| capfirst | Capitalizes the first character of the value. |
| center | Centers the value in a field of a given width. |
| cut | Removes all values of arg from the given string. |
| date | Formats a date according to the given format. |
| default | If value evaluates to false, use given default. |
| default_if_none | If (and only if) value is undefined, use given default. |
| divisibleby | Returns true if the value is divisible by the argument. |
| escapejs | Escapes characters for use in JavaScript strings. |
| filesizeformat | Format the value like a human-readable file size. |
| first | Returns the first item in a list. |
| fix_ampersands | Replaces ampersands with & entities. |
| force_escape | Applies HTML escaping to a string. |
| get_digit | Given a whole number, returns the requested digit, where 1 is the right-most digit. |
| join | Joins a list with a given separator. |
| last | Returns the last item in a list. |
| length | Returns the length of the value. |
| length_is | Returns True iff the value's length is the argument. |
| linebreaksbr | Converts all newlines to HTML line breaks. |
| ljust | Left-aligns the value in a field of a given width. |
| lower | Converts a string into all lowercase. |
| phone2numeric | Converts a phone number (possibly containing letters) to its numerical equivalent. |
| random | Returns a random item from the given list. |
| rjust | Right-aligns the value in a field of a given width. |
| slugify | Converts to lowercase, removes non-word characters (alphanumerics and underscores) and converts spaces to hyphens. |
| title | Converts a string into titlecase. |
| truncatewords | Truncates a string after a certain number of words. |
| upper | Converts a string into all uppercase. |
| urlencode | Escapes a value for use in a URL. |
| wordcount | Returns the number of words. |