Disable form fields for PPoC
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{% from "components/icon.html" import Icon %}
|
||||
{% from "components/tooltip.html" import Tooltip %}
|
||||
|
||||
{% macro OptionsInput(field, tooltip, inline=False, label=True) -%}
|
||||
{% macro OptionsInput(field, tooltip, inline=False, label=True, disabled=False) -%}
|
||||
<optionsinput
|
||||
name='{{ field.name }}'
|
||||
inline-template
|
||||
@@ -29,7 +29,7 @@
|
||||
</legend>
|
||||
{% endif %}
|
||||
|
||||
{{ field() }}
|
||||
{{ field(disabled=disabled) }}
|
||||
|
||||
<template v-if='showError'>
|
||||
<span class='usa-input__message' v-html='validationError'></span>
|
||||
|
@@ -2,10 +2,11 @@
|
||||
|
||||
{% for subform in member_perms_form.members_permissions %}
|
||||
{% set modal_id = "portfolio_id_{}_user_id_{}".format(portfolio.id, subform.user_id.data) %}
|
||||
{% set ppoc = subform.user_id.data == portfolio.owner.id %}
|
||||
|
||||
<tr>
|
||||
<tr {% if ppoc %}class="members-table-ppoc"{% endif %}>
|
||||
<td class='name'>{{ subform.member.data }}
|
||||
{% if subform.member.data == user.full_name %}
|
||||
{% if subform.user_id.data == user.id %}
|
||||
<span class='you'>(<span class='green'>you</span>)</span>
|
||||
{% set archive_button_class = 'usa-button-disabled' %}
|
||||
{% else %}
|
||||
@@ -13,16 +14,18 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
|
||||
<td>{{ OptionsInput(subform.perms_app_mgmt, label=False) }}</td>
|
||||
<td>{{ OptionsInput(subform.perms_funding, label=False) }}</td>
|
||||
<td>{{ OptionsInput(subform.perms_reporting, label=False) }}</td>
|
||||
<td>{{ OptionsInput(subform.perms_portfolio_mgmt, label=False) }}</td>
|
||||
<td>{{ OptionsInput(subform.perms_app_mgmt, label=False, disabled=ppoc) }}</td>
|
||||
<td>{{ OptionsInput(subform.perms_funding, label=False, disabled=ppoc) }}</td>
|
||||
<td>{{ OptionsInput(subform.perms_reporting, label=False, disabled=ppoc) }}</td>
|
||||
<td>{{ OptionsInput(subform.perms_portfolio_mgmt, label=False, disabled=ppoc) }}</td>
|
||||
|
||||
<td>
|
||||
<a v-on:click="openModal('{{ modal_id }}')" class='usa-button {{ archive_button_class }}'>
|
||||
{{ "portfolios.members.archive_button" | translate }}
|
||||
</a>
|
||||
</td>
|
||||
{{ subform.user_id() }}
|
||||
{% if not ppoc %}
|
||||
{{ subform.user_id() }}
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
Reference in New Issue
Block a user