mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-26 17:24:23 -04:00
Use service model for the copy page
The view here is rebuilding a pseudo-service object. Now that service objects have templates it’s cleaner to use the actual service object. Requires a small change to the `templates_by_type` method so that it can filter by one or many template types (a user should be able to copy any template whose type is enabled for their service, and the service they’re copying from).
This commit is contained in:
@@ -13,13 +13,14 @@
|
||||
</div>
|
||||
<nav>
|
||||
{% for service in services %}
|
||||
{% if service.templates and services|length > 1 %}
|
||||
{% set templates = service.templates_by_type(current_service.permissions) %}
|
||||
{% if templates and services|length > 1 %}
|
||||
<h2 class="">
|
||||
{{ service.name }}
|
||||
</h2>
|
||||
<div class="left-gutter-4-3 bottom-gutter-3-2">
|
||||
{% endif %}
|
||||
{% for template in service.templates %}
|
||||
{% for template in templates %}
|
||||
<h2 class="message-name">
|
||||
<a href="{{ url_for('.copy_template', service_id=current_service.id, template_id=template.id, from_service=service.id) }}">{{ template.name }}</a>
|
||||
</h2>
|
||||
@@ -27,7 +28,7 @@
|
||||
{{ message_count_label(1, template.template_type, suffix='')|capitalize }} template
|
||||
</p>
|
||||
{% endfor %}
|
||||
{% if service.templates %}
|
||||
{% if templates %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user