Files
notifications-admin/app/templates/components/current-service-link.html
Chris Hill-Scott 46a4e1c612 Add a macro for generating current service links
This is a convenient way of being able to link into pages of the the app
from guidance. It handles the case where the current service is not
known, either because the user hasn’t chosen one, or because they’re not
signed in.

This commit also cleans up some unused Jinja imports.
2020-02-19 08:22:45 +00:00

8 lines
302 B
HTML

{% macro current_service_link(endpoint, link_text) %}
{% if current_service %}
<a class="govuk-link" href="{{ url_for(endpoint, service_id=current_service.id) }}">{{ link_text }}</a>
{% else %}
<b class="govuk-!-font-weight-bold">{{ link_text|capitalize }}</b>
{% endif %}
{% endmacro %}