swh.web.alter.templatetags.alter_extras module#
- swh.web.alter.templatetags.alter_extras.status_badge(category: str, label: str) → SafeString[source]#
- swh.web.alter.templatetags.alter_extras.outcome_badge(outcome: str, label: str) → SafeString[source]#
- swh.web.alter.templatetags.alter_extras.absolute_url(context: dict, location: str, *args, **kwargs) → str[source]#
- Build a _real_ absolute url to location (including host & port). - Location could be a relative url or a view name (as in urls.py) which would then be reverse with args & kwargs. - Usage:
- ` {% absolute_url 'my-route' pk=12345 %} {% absolute_url obj.get_absolute_url %} `
 - Parameters:
- context – a django template context 
- location – a view name 
- *args – args passed to reverse 
- **kwargs – keyword args passed to reverse 
 
- Returns:
- an absolute url to location 
 
- swh.web.alter.templatetags.alter_extras.bootstrap_field_submit(field: Field, button_label: str) → str[source]#
- A wrapper around django_bs5.bootstrap_field to make a field + submit addon. - Parameters:
- field – a Form field 
- button_label – submit button label 
 
- Returns:
- A form input group with a field and an appended submit button