mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
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.
This commit is contained in:
7
app/templates/components/current-service-link.html
Normal file
7
app/templates/components/current-service-link.html
Normal file
@@ -0,0 +1,7 @@
|
||||
{% 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 %}
|
||||
Reference in New Issue
Block a user