Use common "View" for translations

-also pipe translate in injected html for a flash
This commit is contained in:
Montana 2019-05-13 09:28:47 -04:00
parent 39a0716028
commit 74422c57aa
4 changed files with 17 additions and 11 deletions

View File

@ -14,29 +14,35 @@ class PermissionsForm(BaseForm):
perms_app_mgmt = SelectField( perms_app_mgmt = SelectField(
translate("forms.new_member.app_mgmt"), translate("forms.new_member.app_mgmt"),
choices=[ choices=[
(PermissionSets.VIEW_PORTFOLIO_APPLICATION_MANAGEMENT, "View"), (
(PermissionSets.EDIT_PORTFOLIO_APPLICATION_MANAGEMENT, "Edit"), PermissionSets.VIEW_PORTFOLIO_APPLICATION_MANAGEMENT,
translate("common.view"),
),
(
PermissionSets.EDIT_PORTFOLIO_APPLICATION_MANAGEMENT,
translate("common.edit"),
),
], ],
) )
perms_funding = SelectField( perms_funding = SelectField(
translate("forms.new_member.funding"), translate("forms.new_member.funding"),
choices=[ choices=[
(PermissionSets.VIEW_PORTFOLIO_FUNDING, "View"), (PermissionSets.VIEW_PORTFOLIO_FUNDING, translate("common.view")),
(PermissionSets.EDIT_PORTFOLIO_FUNDING, "Edit"), (PermissionSets.EDIT_PORTFOLIO_FUNDING, translate("common.edit")),
], ],
) )
perms_reporting = SelectField( perms_reporting = SelectField(
translate("forms.new_member.reporting"), translate("forms.new_member.reporting"),
choices=[ choices=[
(PermissionSets.VIEW_PORTFOLIO_REPORTS, "View"), (PermissionSets.VIEW_PORTFOLIO_REPORTS, translate("common.view")),
(PermissionSets.EDIT_PORTFOLIO_REPORTS, "Edit"), (PermissionSets.EDIT_PORTFOLIO_REPORTS, translate("common.edit")),
], ],
) )
perms_portfolio_mgmt = SelectField( perms_portfolio_mgmt = SelectField(
translate("forms.new_member.portfolio_mgmt"), translate("forms.new_member.portfolio_mgmt"),
choices=[ choices=[
(PermissionSets.VIEW_PORTFOLIO_ADMIN, "View"), (PermissionSets.VIEW_PORTFOLIO_ADMIN, translate("common.view")),
(PermissionSets.EDIT_PORTFOLIO_ADMIN, "Edit"), (PermissionSets.EDIT_PORTFOLIO_ADMIN, translate("common.edit")),
], ],
) )

View File

@ -160,7 +160,7 @@ MESSAGES = {
"title_template": translate("flash.success"), "title_template": translate("flash.success"),
"message_template": """ "message_template": """
{{ "flash.application.deleted" | translate({"application_name": application_name}) }} {{ "flash.application.deleted" | translate({"application_name": application_name}) }}
<a href="#">translate("common.undo")</a> <a href="#">{{ "common.undo" | translate }}</a>
""", """,
"category": "success", "category": "success",
}, },

View File

@ -18,7 +18,7 @@
{% if dict(access.choices).get(access.data) == ('portfolios.members.permissions.edit_access' | translate) %} {% if dict(access.choices).get(access.data) == ('portfolios.members.permissions.edit_access' | translate) %}
<td class='green'>{{ 'portfolios.members.permissions.edit_access' | translate }}</td> <td class='green'>{{ 'portfolios.members.permissions.edit_access' | translate }}</td>
{% else %} {% else %}
<td>{{ 'portfolios.members.permissions.view_only' | translate }}</td> <td>{{ 'common.view' | translate }}</td>
{% endif %} {% endif %}
{% endfor %} {% endfor %}

View File

@ -39,6 +39,7 @@ common:
show: Show show: Show
sign: Sign sign: Sign
undo: Undo undo: Undo
view: View
resource_names: resource_names:
environments: Environments environments: Environments
choose_role: Choose a role choose_role: Choose a role
@ -473,7 +474,6 @@ portfolios:
name: Name name: Name
portfolio_mgmt: Portfolio management portfolio_mgmt: Portfolio management
reporting: Reporting reporting: Reporting
view_only: View
task_orders: task_orders:
available_budget_help_description: The available budget shown includes the available budget of all active task orders available_budget_help_description: The available budget shown includes the available budget of all active task orders
requests: requests: