Add edit template with dropdown selectors
This commit is contained in:
43
templates/fragments/applications/edit_team.html
Normal file
43
templates/fragments/applications/edit_team.html
Normal file
@@ -0,0 +1,43 @@
|
||||
{% from "components/options_input.html" import OptionsInput %}
|
||||
|
||||
{% for member_form in team_form.members %}
|
||||
{% set environment_roles_form = member_form.environment_roles %}
|
||||
{% set permissions_form = member_form.permission_sets %}
|
||||
|
||||
<toggler inline-template>
|
||||
<li class="accordion-table__item">
|
||||
<div class="accordion-table__item-content row">
|
||||
<div class="col col--grow">{{ member_form.user_name.data }}</div>
|
||||
<div class="col col--grow">{{ OptionsInput(permissions_form.perms_team_mgmt, label=False) }}</div>
|
||||
<div class="col col--grow">{{ OptionsInput(permissions_form.perms_env_mgmt, label=False) }}</div>
|
||||
<div class="col col--grow">{{ OptionsInput(permissions_form.perms_del_env, label=False) }}</div>
|
||||
<div class="col col--grow icon-link icon-link--large accordion-table__item__toggler">
|
||||
{% set open_html %}
|
||||
{{ "portfolios.applications.team_settings.environments" | translate }} ({{ environment_roles_form | length }}) {{ Icon('caret_down') }}
|
||||
{% endset %}
|
||||
|
||||
{% set close_html %}
|
||||
{{ "portfolios.applications.team_settings.environments" | translate }} ({{ environment_roles_form | length }}) {{ Icon('caret_up') }}
|
||||
{% endset %}
|
||||
|
||||
{{
|
||||
ToggleButton(
|
||||
open_html=open_html,
|
||||
close_html=close_html,
|
||||
section_name="environments"
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
{% call ToggleSection(section_name="environments") %}
|
||||
<ul>
|
||||
{% for environment_form in environment_roles_form %}
|
||||
<li class="accordion-table__item__expanded">
|
||||
{{ environment_form.environment_name.data }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endcall %}
|
||||
</li>
|
||||
</toggler>
|
||||
{% endfor %}
|
@@ -3,34 +3,34 @@
|
||||
{% set user_info = environment_users[user.id] %}
|
||||
{% set user_permissions = user_info["permissions"] %}
|
||||
|
||||
{% macro PermissionField(value) %}
|
||||
<div class="col col--grow user-permission{% if "Edit" in value %} green{% endif %}">{{ value }}</div>
|
||||
{% endmacro %}
|
||||
{% macro PermissionField(value) %}
|
||||
<div class="col col--grow user-permission{% if "Edit" in value %} green{% endif %}">{{ value }}</div>
|
||||
{% endmacro %}
|
||||
|
||||
<toggler inline-template>
|
||||
<li class="accordion-table__item">
|
||||
<div class="accordion-table__item-content row">
|
||||
<div class="col col--grow">{{ user.full_name }}</div>
|
||||
{{ PermissionField(user_permissions["delete_access"]) }}
|
||||
{{ PermissionField(user_permissions["environment_management"]) }}
|
||||
{{ PermissionField(user_permissions["team_management"]) }}
|
||||
<div class="col col--grow icon-link icon-link--large accordion-table__item__toggler">
|
||||
{% set open_html %}
|
||||
{{ "portfolios.applications.team_settings.environments" | translate }} ({{ user_info['environments'] | length }}) {{ Icon('caret_down') }}
|
||||
{% endset %}
|
||||
<toggler inline-template>
|
||||
<li class="accordion-table__item">
|
||||
<div class="accordion-table__item-content row">
|
||||
<div class="col col--grow">{{ user.full_name }}</div>
|
||||
{{ PermissionField(user_permissions["delete_access"]) }}
|
||||
{{ PermissionField(user_permissions["environment_management"]) }}
|
||||
{{ PermissionField(user_permissions["team_management"]) }}
|
||||
<div class="col col--grow icon-link icon-link--large accordion-table__item__toggler">
|
||||
{% set open_html %}
|
||||
{{ "portfolios.applications.team_settings.environments" | translate }} ({{ user_info['environments'] | length }}) {{ Icon('caret_down') }}
|
||||
{% endset %}
|
||||
|
||||
{% set close_html %}
|
||||
{{ "portfolios.applications.team_settings.environments" | translate }} ({{ user_info['environments'] | length }}) {{ Icon('caret_up') }}
|
||||
{% endset %}
|
||||
{% set close_html %}
|
||||
{{ "portfolios.applications.team_settings.environments" | translate }} ({{ user_info['environments'] | length }}) {{ Icon('caret_up') }}
|
||||
{% endset %}
|
||||
|
||||
{{
|
||||
ToggleButton(
|
||||
open_html=open_html,
|
||||
close_html=close_html,
|
||||
section_name="environments"
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
{{
|
||||
ToggleButton(
|
||||
open_html=open_html,
|
||||
close_html=close_html,
|
||||
section_name="environments"
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
{% call ToggleSection(section_name="environments") %}
|
||||
<ul>
|
||||
|
@@ -62,8 +62,7 @@
|
||||
</div>
|
||||
<ul class="accordion-table__items">
|
||||
{% if user_can(permissions.EDIT_APPLICATION_MEMBER) %}
|
||||
{# edit version goes here #}
|
||||
{% include "fragments/applications/read_only_team.html" %}
|
||||
{% include "fragments/applications/edit_team.html" %}
|
||||
{% elif user_can(permissions.VIEW_APPLICATION_MEMBER) %}
|
||||
{% include "fragments/applications/read_only_team.html" %}
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user