add count of folders visible per user to the team members page

Shows a count of how many folders that user can see - this doesn't do
anything smart with parent folder stuff, it's just "how many checkboxes
are ticked on the edit page".

* doesn't show if service has no folders
* doesn't show if service hasn't got folder permissions enabled
This commit is contained in:
Leo Hemsted
2019-04-04 17:55:37 +01:00
parent 16d1526c46
commit 249b80762a
3 changed files with 98 additions and 0 deletions

View File

@@ -57,6 +57,20 @@
{% endif %}
</div>
{% endif %}
{# only show if the service has folders #}
{% if current_service.has_permission('edit_folder_permissions') and current_service.all_template_folders %}
<div class="tick-cross-list-hint">
{% set folder_count = user.template_folders_for_service(current_service) | length %}
{% if folder_count == 0 %}
Cannot see any folders
{% elif folder_count != current_service.all_template_folders | length %}
Can see {{ folder_count }} folder{% if folder_count > 1 %}s{% endif %}
{% else %}
Can see all folders
{% endif%}
</div>
{% endif %}
</div>
{% if current_user.has_permissions('manage_service') %}
<li class="tick-cross-list-edit-link">