diff --git a/templates/workspaces/reports/index.html b/templates/workspaces/reports/index.html index 563a7838..18198ea5 100644 --- a/templates/workspaces/reports/index.html +++ b/templates/workspaces/reports/index.html @@ -2,6 +2,7 @@ {% from "components/alert.html" import Alert %} {% from "components/icon.html" import Icon %} +{% from "components/empty_state.html" import EmptyState %} {% block workspace_content %} @@ -102,341 +103,327 @@ {% set two_months_ago_index = two_months_ago.strftime('%m/%Y') %} {% set reports_url = url_for("workspaces.workspace_reports", workspace_id=workspace.id) %} - -
-
-

Cumulative Budget

+ {% if not monthly_totals['environments'] %} -
-
-
-
Monthly Spend
-
Monthly spend visual key
-
+ {% set can_create_projects = user_can(permissions.ADD_APPLICATION_IN_WORKSPACE) %} + {% set message = 'This Workspace has no Cloud Environments setup, hence there is no spending data to report. Create a Project with some Cloud Environments to get started.' + if can_create_projects + else 'This Workspace has no Cloud Environments setup, hence there is no spending data to report. Contact the Workspace Owner to set up some Cloud Environments.' + %} -
-
Accumulated Spend
-
Accumulated spend visual key
-
-
-
-
-
Projected
-
-
Projected monthly spend visual key
-
Projected accumulated spend visual key
-
-
-
-
-
+ {{ EmptyState( + 'Nothing to report', + action_label='Add a New Project' if can_create_projects else None, + action_href=url_for('workspaces.new_project', workspace_id=workspace.id) if can_create_projects else None, + icon='chart', + sub_message=message + ) }} + {% else %} - - - - - - - - - - {# spend/projected budget path lines #} - - - - {# max budget line #} - - - - - {# make this clickable to focus on that month #} - - - - - - - - - - -  |  - - - {# container block #} - - - {# budget bar #} - - - {# projected budget bar #} - - - {# task order expiration line #} - - - {# task order expiration label #} - T.O. Expires - - {# cumulative dot #} - - - {# abbreviated cumulative label #} - - - {# abbreviated spend label #} - - - {# month label #} - - - {# year label #} - - - - - Total Budget - - -
-
- -
-
-

Total spend per month

- - -
- - - - - - - - - - +
+
+

Cumulative Budget

-
- - - - - - - - +
+
+
+
Monthly Spend
+
Monthly spend visual key
+
-
- - - +
+
Accumulated Spend
+
Accumulated spend visual key
+
+ +
+
+
Projected
+
+
Projected monthly spend visual key
+
Projected accumulated spend visual key
+
+
+
+ + - + - - - + + + + + + - - + {# spend/projected budget path lines #} + + - - + {# max budget line #} + - + - + {# make this clickable to focus on that month #} + - + + + + + + - - - + + <span v-html='month.date.month + " " + month.date.year'></span> | <!-- + --><template v-if='month.cumulativeTotal'><!-- + --><template v-if='month.budget && month.budget.spend'>Spend:</template><!-- + --><template v-else>Projected Spend:</template><!-- + --><span v-html='month.spendAmount'></span><!-- + --> | <!-- + --><template v-if='month.budget'>Total:</template><!-- + --><template v-else>Projected Total:</template><!-- + --><span v-html='month.cumulativeAmount'></span><!-- + --></template><!-- - {# {% for project_name, project_totals in monthly_totals['projects'].items() %} - <tbody is='tbody-toggler' class='spend-table__project'> + --><template v-else>No spend for this month</template> + + + {# container block #} + + + {# budget bar #} + + + {# projected budget bar #} + + + {# task order expiration line #} + + + {# task order expiration label #} + T.O. Expires + + {# cumulative dot #} + + + {# abbreviated cumulative label #} + + + {# abbreviated spend label #} + + + {# month label #} + + + {# year label #} + + + + + Total Budget + + + + + +
+
+

Total spend per month

+ + +
+ + +
Spending scope{{ two_months_ago.strftime('%B %Y') }}{{ prev_month.strftime('%B %Y') }}{{ current_month.strftime('%B %Y') }}
Workspace Total{{ workspace_totals.get(two_months_ago_index, 0) | dollars }}{{ workspace_totals.get(prev_month_index, 0) | dollars }}{{ workspace_totals.get(current_month_index, 0) | dollars }} - -
- - - - - - - - - - -
-
-
- - {{ Icon('link') }} - - - - - - - - -
+ + + + + + + + + + + + + + + + + + + - - - + + + + + + - {% for env_name, env_totals in monthly_totals['environments'][project_name].items() %} - - - - - - - - {% endfor %} + + - - - {% endfor %} #} -
Spending scope{{ two_months_ago.strftime('%B %Y') }}{{ prev_month.strftime('%B %Y') }}{{ current_month.strftime('%B %Y') }}
Workspace Total{{ workspace_totals.get(two_months_ago_index, 0) | dollars }}{{ workspace_totals.get(prev_month_index, 0) | dollars }}{{ workspace_totals.get(current_month_index, 0) | dollars }} + +
- {{ project_totals.get(two_months_ago_index, 0) | dollars }}{{ project_totals.get(prev_month_index, 0) | dollars }}{{ project_totals.get(current_month_index, 0) | dollars }} + + + + + + - {{ (100 * (project_totals.get(current_month_index, 0) / workspace_totals.get(current_month_index, 1))) | round | int }}% - + + + + +
+
{{ Icon('link') }} {{ env_name }}{{ env_totals.get(two_months_ago_index, 0) | dollars }}{{ env_totals.get(prev_month_index, 0) | dollars }}{{ env_totals.get(current_month_index, 0) | dollars }}
+ + {{ Icon('link') }} + + +
-
-
+ + + + + + + + + + + + + + + + + + + + {% endif %} {% endblock %}