Make checkboxes work

This commit is contained in:
leigh-mil
2019-09-12 15:10:47 -04:00
parent 1fd2d9f496
commit ab102470bf
6 changed files with 147 additions and 64 deletions

View File

@@ -10,6 +10,10 @@
{% from "components/save_button.html" import SaveButton %}
{% from "components/text_input.html" import TextInput %}
{% from "components/toggle_list.html" import ToggleButton, ToggleSection %}
{% from "components/icon.html" import Icon %}
{% from "components/text_input.html" import TextInput %}
{% from "components/checkbox_input.html" import CheckboxInput %}
{% from "components/phone_input.html" import PhoneInput %}
{% set secondary_breadcrumb = 'portfolios.applications.existing_application_title' | translate({ "application_name": application.name }) %}
@@ -87,11 +91,11 @@
</a>
{{ MultiStepModalForm(
name=new_member_modal_name,
form=new_member_form,
form=member.form,
form_action=url_for("applications.create_member", application_id=application.id),
steps=[
member_steps.MemberStepOne(new_member_form),
member_steps.MemberStepTwo(new_member_form, application)
member_steps.MemberStepOne(member.form),
member_steps.MemberStepTwo(member.form, application)
],
) }}
{% endif %}
@@ -126,12 +130,62 @@
</thead>
<tbody>
{% for member in members %}
{% import "fragments/applications/new_member_modal_content.html" as member_steps %}
{% set modal_name = "edit_member-{}".format(loop.index) %}
{% call Modal(modal_name, dismissable=True) %}
<form id='{{ modal_name }}'>
<h4>{{ "portfolios.applications.members.form.project_perms" | translate }}</h4>
<div class="application-perms">
{% set team_mgmt = "perms_team_mgmt-{}".format(member.role_id) %}
{% set env_mgmt = "perms_env_mgmt-{}".format(member.role_id) %}
{% set del_env = "perms_del_env-{}".format(member.role_id) %}
{{ CheckboxInput(member.form.permission_sets.perms_team_mgmt, classes="input__inline-fields", key=team_mgmt, id=team_mgmt) }}
{{ CheckboxInput(member.form.permission_sets.perms_env_mgmt, classes="input__inline-fields", key=env_mgmt, id=env_mgmt) }}
{{ CheckboxInput(member.form.permission_sets.perms_del_env, classes="input__inline-fields", key=del_env, id=del_env) }}
</div>
<div class="environment-roles-new">
<h4>{{ "portfolios.applications.members.form.env_access" | translate }}</h4>
<hr>
{% for environment_data in member.form.environment_roles %}
<optionsinput inline-template
v-bind:initial-value="'{{ environment_data.role.data | string }}'"
v-bind:name="'{{ environment_data.name | string }}'"
v-bind:optional="true"
>
<div class="usa-input">
<fieldset data-ally-disabled="true" class="usa-input__choices">
<div class="form-row">
<div class="form-col form-col--two-thirds">
<legend>
<div v-bind:class='["usa-input__title-inline", {"environment-name--gray": value === "None" }]'>
{{ environment_data.environment_name.data }}
</div>
</legend>
</div>
<div class="form-col form-col--third">
{{ environment_data.role(**{"v-model": "value"}) }}
</div>
</div>
</fieldset>
</div>
</optionsinput>
{{ environment_data.environment_id() }}
<hr>
{% endfor %}
</div>
</form>
{% endcall %}
<tr>
<td>
{{ member.user_name }}<br>
{{ member.user_name }}
<a class="icon-link" v-on:click="openModal('{{ modal_name }}')">
{{ Icon('edit') }}
</a>
<br>
{% if member.role_status == 'pending' %}
<span class='label label--purple'>INVITE PENDING</span>
{% endif %}
</td>
<td>