mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-08 10:28:57 -04:00
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.
8 lines
302 B
HTML
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 %}
|