Import environments macro with context so you don't need to pass perms
This commit is contained in:
@@ -6,9 +6,7 @@
|
|||||||
{% macro EnvironmentManagementTemplate(
|
{% macro EnvironmentManagementTemplate(
|
||||||
application,
|
application,
|
||||||
environments_obj,
|
environments_obj,
|
||||||
new_env_form,
|
new_env_form) %}
|
||||||
user_can_create_environment
|
|
||||||
) %}
|
|
||||||
|
|
||||||
<h3>{{ "portfolios.applications.settings.environments" | translate }}</h3>
|
<h3>{{ "portfolios.applications.settings.environments" | translate }}</h3>
|
||||||
<section class="panel" id="application-environments">
|
<section class="panel" id="application-environments">
|
||||||
@@ -94,7 +92,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{% if user_can_create_environment -%}
|
{% if user_can(permissions.CREATE_ENVIRONMENT) -%}
|
||||||
{% include "applications/fragments/add_new_environment.html" %}
|
{% include "applications/fragments/add_new_environment.html" %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
</section>
|
</section>
|
||||||
|
@@ -57,9 +57,7 @@
|
|||||||
{{ EnvironmentManagementTemplate(
|
{{ EnvironmentManagementTemplate(
|
||||||
application,
|
application,
|
||||||
environments_obj,
|
environments_obj,
|
||||||
new_env_form,
|
new_env_form) }}
|
||||||
user_can_create_environment=user_can(permissions.CREATE_ENVIRONMENT)
|
|
||||||
) }}
|
|
||||||
|
|
||||||
{% if user_can(permissions.DELETE_APPLICATION) %}
|
{% if user_can(permissions.DELETE_APPLICATION) %}
|
||||||
{% set env_count = application.environments | length %}
|
{% set env_count = application.environments | length %}
|
||||||
|
Reference in New Issue
Block a user