diff --git a/styles/components/_portfolio_layout.scss b/styles/components/_portfolio_layout.scss index 5c48422d..848467dd 100644 --- a/styles/components/_portfolio_layout.scss +++ b/styles/components/_portfolio_layout.scss @@ -322,6 +322,34 @@ input#delete-application { margin-top: $gap * 3; } + + .accordion-table__item-content.form-row { + margin-bottom: 0; + margin-top: 0; + padding-bottom: 0; + } + + li.accordion-table__item__expanded { + height: auto; + } + + .environment-list__item { + position: relative; + height: 7rem; + } + + span.accordion-table__item__toggler.icon-link { + font-size: $small-font-size; + font-weight: $font-normal; + position: absolute; + left: -$gap * 1.25; + bottom: 0; + } + + a.application-list-item__environment__csp_link.icon-link { + font-size: $small-font-size; + font-weight: $font-normal; + } } .activity-log { diff --git a/templates/fragments/applications/add_new_environment.html b/templates/fragments/applications/add_new_environment.html index f1e72e4f..e8190e14 100644 --- a/templates/fragments/applications/add_new_environment.html +++ b/templates/fragments/applications/add_new_environment.html @@ -28,15 +28,9 @@ - - + + {{ Icon('plus') }} + {{ "portfolios.applications.add_environment" | translate }} + - diff --git a/templates/fragments/applications/edit_environment_team_form.html b/templates/fragments/applications/edit_environment_team_form.html deleted file mode 100644 index 88d55f47..00000000 --- a/templates/fragments/applications/edit_environment_team_form.html +++ /dev/null @@ -1,91 +0,0 @@ -{% from "components/icon.html" import Icon %} -{% from "components/save_button.html" import SaveButton %} - - -{% for env_form in members_form.envs %} - {% if env_form.env_id.data == env['id'] %} -
- {{ members_form.csrf_token }} - {{ env_form.env_id() }} - -
-
-

- {{ 'fragments.edit_environment_team_form.unassigned_title' | translate }} -

-

-
    -
    - {{ 'fragments.edit_environment_team_form.no_members' | translate }} -
    -
  • - - - - {{ Icon('edit', classes="icon--medium") }} - -
    -
    -
    -
      -
    • - - -
    • -
    -
    -
    -
    - -
  • -
-
-
- {{ - SaveButton( - text=("common.save" | translate) - ) - }} -
-
-
-
- - {{ "common.cancel" | translate }} - -
-
- {% endif %} -{% endfor %} diff --git a/templates/fragments/applications/edit_environments.html b/templates/fragments/applications/edit_environments.html deleted file mode 100644 index ee3d5377..00000000 --- a/templates/fragments/applications/edit_environments.html +++ /dev/null @@ -1,128 +0,0 @@ -{% from "components/delete_confirmation.html" import DeleteConfirmation %} -{% from "components/icon.html" import Icon %} -{% from "components/modal.html" import Modal %} -{% from "components/options_input.html" import OptionsInput %} -{% from "components/save_button.html" import SaveButton %} -{% from "components/text_input.html" import TextInput %} -{% from "components/toggle_list.html" import ToggleButton, ToggleSection %} - - -
-
-
-
-
{{ 'portfolios.applications.environments_heading' | translate }}
-
- - {{ Icon('info') }} - {{ "portfolios.admin.settings_info" | translate }} - -
-
- -
-
-
{{ "portfolios.applications.environments.name" | translate }}
-
{{ "portfolios.applications.environments.edit_name" | translate }}
-
{{ "common.delete" | translate }}
-
{{ "common.members" | translate }}
-
- - -
-
diff --git a/templates/fragments/applications/read_only_environments.html b/templates/fragments/applications/read_only_environments.html deleted file mode 100644 index 90181a2d..00000000 --- a/templates/fragments/applications/read_only_environments.html +++ /dev/null @@ -1,76 +0,0 @@ -{% from "components/icon.html" import Icon %} -{% from "components/toggle_list.html" import ToggleButton, ToggleSection %} - -
-
-
-
-
{{ 'portfolios.applications.environments_heading' | translate }}
-
-
-
- -
-
- {{ "portfolios.applications.environments.name" | translate }} -
- - -
-
diff --git a/templates/portfolios/applications/settings.html b/templates/portfolios/applications/settings.html index 7ab84a3f..6ff8a496 100644 --- a/templates/portfolios/applications/settings.html +++ b/templates/portfolios/applications/settings.html @@ -9,6 +9,7 @@ {% from "components/pagination.html" import Pagination %} {% from "components/save_button.html" import SaveButton %} {% from "components/text_input.html" import TextInput %} +{% from "components/toggle_list.html" import ToggleButton, ToggleSection %} {% set secondary_breadcrumb = 'portfolios.applications.existing_application_title' | translate({ "application_name": application.name }) %} @@ -157,22 +158,104 @@ {% endif %} -
-
- {% if g.matchesPath("application-environments") %} - {% include "fragments/flash.html" %} - {% endif %} - {% if user_can(permissions.EDIT_ENVIRONMENT) %} - {% include "fragments/applications/edit_environments.html" %} +
+ Environments - {% if user_can(permissions.CREATE_ENVIRONMENT) %} - {% include "fragments/applications/add_new_environment.html" %} - {% endif %} + {% if user_can(permissions.CREATE_ENVIRONMENT) %} + {% include "fragments/applications/add_new_environment.html" %} + {% endif %} +
- {% elif user_can(permissions.VIEW_ENVIRONMENT) %} - {% include "fragments/applications/read_only_environments.html" %} - {% endif %} + + {% if g.matchesPath("application-environments") %} + {% include "fragments/flash.html" %} + {% endif %} + +
+
+
+
    + {% for env in environments_obj %} + {% set edit_form = env['edit_form'] %} + +
  • +
    +
    +
    + + {{ env['name'] }} + + + {% set edit_environment_button %} + {{ Icon('edit') }} + {% endset %} + + {{ + ToggleButton( + open_html=edit_environment_button, + close_html=edit_environment_button, + section_name="edit" + ) + }} + + + {% set open_members_button %} + {{ env['member_count'] }} members + {% endset %} + + {% set close_members_button %} + {{ env['member_count'] }} members + {% endset %} + + {{ + ToggleButton( + open_html=open_members_button, + close_html=close_members_button, + section_name="members" + ) + }} + +
    + +
    + +
    + + {% call ToggleSection(section_name="members") %} +
      + {% for member in env['members'] %} +
    • + {{ member }} +
    • + {% endfor %} +
    + {% endcall %} + + {% call ToggleSection(section_name="edit") %} +
      +
    • +
      + {{ edit_form.csrf_token }} + {{ TextInput(edit_form.name, validation='requiredField') }} + {{ + SaveButton( + text=("common.save" | translate) + ) + }} +
      +
    • +
    + {% endcall %} +
  • +
    + {% endfor %} +
+