Files
notifications-admin/app/templates/views/dashboard/dashboard.html
Chris Hill-Scott fa01c1bc5c Make a macro for the AJAX update module
This is less repetitive than typing out the HTML with all its attributes
every time.

It also lets us wrap up the idea of ‘finished’ as a parameter, so the
AJAX code will only be initiated when it’s needed, eg if a job is still
processing.
2016-06-28 11:56:02 +01:00

75 lines
2.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "withnav_template.html" %}
{% from "components/big-number.html" import big_number, big_number_with_status %}
{% from "components/show-more.html" import show_more %}
{% from "components/message-count-label.html" import message_count_label %}
{% from "components/table.html" import list_table, field, right_aligned_field_heading, hidden_field_heading %}
{% from "components/ajax-block.html" import ajax_block %}
{% block page_title %}
{{ current_service.name }} GOV.UK Notify
{% endblock %}
{% block maincolumn_content %}
<div class="dashboard">
<h1 class="visuallyhidden">Dashboard</h1>
{% if current_user.has_permissions([
'manage_templates', 'manage_api_keys', 'manage_users', 'manage_settings
'], any_=True, admin_override=True) %}
{% if current_service.restricted %}
{% include 'views/dashboard/trial-mode-banner.html' %}
{% endif %}
{% elif not current_user.has_permissions(['send_texts', 'send_emails', 'send_letters'], any_=True) %}
{% include 'views/dashboard/no-permissions-banner.html' %}
{% endif %}
<h2 class="heading-medium">
In the last 7 days
</h2>
{% call ajax_block(updates_url, 'totals') %}
{% include 'views/dashboard/_totals.html' %}
{% endcall %}
{{ show_more(
url_for('.weekly', service_id=current_service.id),
'Compare to previous weeks'
) }}
{% if template_statistics|length %}
{% call ajax_block(updates_url, 'template-statistics') %}
{% include 'views/dashboard/template-statistics.html' %}
{% endcall %}
{{ show_more(
url_for('.template_history', service_id=current_service.id),
'See all templates used this year'
) }}
{% endif %}
{% if jobs %}
{% call ajax_block(updates_url, 'jobs') %}
{% include 'views/dashboard/_jobs.html' %}
{% endcall %}
{{ show_more(
url_for('.view_jobs', service_id=current_service.id),
'See all uploaded files'
) }}
{% endif %}
{% if current_user.has_permissions(['manage_settings'], admin_override=True) %}
<h2 class='heading-medium'>This year</h2>
{% call ajax_block(updates_url, 'usage') %}
{% include 'views/dashboard/_usage.html' %}
{% endcall %}
{{ show_more(
url_for(".usage", service_id=current_service['id']),
'See usage breakdown'
) }}
{% endif %}
</div>
{% endblock %}