heliport.core.templatetags package
Submodules
heliport.core.templatetags.bootstrap_utils module
Template tags for integration with Bootstrap.
To use these include this in your template: {% load bootstrap_utils %}
- heliport.core.templatetags.bootstrap_utils.alert_classes_for_maintenance_message_level(level)
Generate Bootstrap alert classes from maintenance message level.
- heliport.core.templatetags.bootstrap_utils.alert_classes_for_message_level(message_level)
Generate Bootstrap alert classes from Django message level.
heliport.core.templatetags.heliport module
HELIPORT template tags.
To use these include this in your template: {% load heliport %}
- heliport.core.templatetags.heliport.as_repr(obj)
Return the repr of something.
- heliport.core.templatetags.heliport.is_digital_object(obj)
Determines if something is a
heliport.core.models.DigitalObject
.
- heliport.core.templatetags.heliport.params_for(resolvable: Resolvable, **other_params)
Construct a URL query string so that
resolve(request.GET)
returns the originalresolvable
(using theheliport.core.digital_object_resolution.resolve()
function) when a view handles the resulting request. You can also useother_parameters
to additionally attach to the query string.
- heliport.core.templatetags.heliport.project_url(url_pattern_name, project_id, *args, **kwargs)
Similar to Django’s url template tag. Generates a URL for the given pattern name. However, this generates a URL for the
heliport.core.views.project.OpenInProjectView
that redirects to the actual URL but first resets the breadcrumbs to the given project. It is expected that the givenurl_pattern
takes theproject_id
as its first argument. Further arguments can be specified using more positional arguments. All keyword arguments are passed as query arguments.
- heliport.core.templatetags.heliport.static_absolute_url(context, static_file_name: str)
Return the absolute URL for a static file.
- heliport.core.templatetags.heliport.type_name(obj)
Return the name of the type of something.
- heliport.core.templatetags.heliport.url_query(*_, **kwargs)
Construct a URL query string from the kwargs that is url encoded.
- heliport.core.templatetags.heliport.zip_dict(iterable, dict_or_single_value)
Same as
zip_lists()
, but the second parameter is a dict mapping indices to additional values. If an index is not provided in the dict,None
is used as value.
- heliport.core.templatetags.heliport.zip_lists(a, b)
Pythons zip function inside templates. This is very useful when you have a list of objects and need some additional computed information for each object to render it.