omeroweb.webgateway.templatetags package¶
Submodules¶
omeroweb.webgateway.templatetags.common_filters module¶
- Formats a datetime.datetime object as time Ago. E.g. ‘3 days 2 hours 10 minutes’ 
- Filter - returns a list containing range made from given value Usage (in template): - <ul>{% for i in 3|get_range %}
- <li>{{ i }}. Do something</li>
 - {% endfor %}</ul> - Results with the HTML: <ul> <li>0. Do something</li> <li>1. Do something</li> <li>2. Do something</li>- </ul> - Instead of 3 one may use the variable set in the views 
- Simple template filter to encode a variable to JSON format 
- Filter - returns the converted value all values are in micrometers 
- Filter - returns th emost suitable length units all values are in micrometers 
- Used for thumbnail versions 
- Subtracts the arg from the value 
- Filter - returns the converted value with units all values are in seconds 
- Truncates a string after a given number of chars Argument: Number of chars to truncate after 
- Truncates a string after a given number of chars Argument: Number of chars to truncate befor 
omeroweb.webgateway.templatetags.common_tags module¶
- Bases: - django.template.base.Node
- Bases: - django.template.base.Node
- Bases: - django.template.base.Node
- Usage: {% plural quantity name_singular name_plural %} - This simple version only works with template variable since we will use blocktrans for strings. 
- Usage: {% plural quantity name_singular name_plural %} - This simple version only works with template variable since we will use blocktrans for strings. 
omeroweb.webgateway.templatetags.defaulttags module¶
- Joins the given path with the STATIC_URL setting. - Usage: - {% static path %} - Examples: - {% static "myapp/css/base.css" %} {% static variable_with_path %}