From 0371ecbd99ace484dca00ba2497b2b86e3986492 Mon Sep 17 00:00:00 2001 From: Montana Date: Thu, 25 Apr 2019 14:47:18 -0400 Subject: [PATCH] Add Read Only version of Application Environments table --- ...vironments.html => edit_environments.html} | 0 .../applications/read_only_environments.html | 77 +++++++++++++++++++ .../portfolios/applications/settings.html | 25 +++--- 3 files changed, 92 insertions(+), 10 deletions(-) rename templates/fragments/applications/{environments.html => edit_environments.html} (100%) create mode 100644 templates/fragments/applications/read_only_environments.html diff --git a/templates/fragments/applications/environments.html b/templates/fragments/applications/edit_environments.html similarity index 100% rename from templates/fragments/applications/environments.html rename to templates/fragments/applications/edit_environments.html diff --git a/templates/fragments/applications/read_only_environments.html b/templates/fragments/applications/read_only_environments.html new file mode 100644 index 00000000..f38ed58c --- /dev/null +++ b/templates/fragments/applications/read_only_environments.html @@ -0,0 +1,77 @@ +{% from "components/icon.html" import Icon %} +{% from "components/toggle_list.html" import ToggleButton, ToggleSection %} + +
+
+
+
+
{{ 'portfolios.applications.environments_heading' | translate }}
+
+
+
+ +
+
+ {{ "portfolios.applications.environments.name" | translate }} + {{ "portfolios.applications.environments.members" | translate }} +
+ +
    + {% for name, members_list in environments_obj.items() %} + +
  • +
    + + {{ name }} + + + + {% set open_environments_button %} + {{ "common.show" | translate }} Environments ({{ members_list | length }}) {{ Icon('caret_down') }} + {% endset %} + + {% set close_environments_button %} + {{ "common.hide" | translate }} Environments ({{ members_list | length }}) {{ Icon('caret_up') }} + {% endset %} + + {{ + ToggleButton( + open_html=open_environments_button, + close_html=close_environments_button, + section_name="environments" + ) + }} + +
    + + {% call ToggleSection(section_name="environments") %} +
      + {% for member in members_list %} +
    • +
      {{ member.name }}
      +
    • + {% endfor %} +
    + {% endcall %} + + {% call ToggleSection(section_name="edit") %} +
      +
    • +
      +
      +
      +
      + Row here +
      +
      +
      +
      +
    • +
    + {% endcall %} +
  • +
    + {% endfor %} +
+
+
diff --git a/templates/portfolios/applications/settings.html b/templates/portfolios/applications/settings.html index 24c8b5fb..d6abf274 100644 --- a/templates/portfolios/applications/settings.html +++ b/templates/portfolios/applications/settings.html @@ -78,16 +78,21 @@
- {% include "fragments/applications/environments.html" %} - + {% if user_can(permissions.EDIT_APPLICATION) %} + {% include "fragments/applications/edit_environments.html" %} + + {% elif user_can(permissions.VIEW_ENVIRONMENT) %} + {% include "fragments/applications/read_only_environments.html" %} + {% endif %} +
{% if user_can(permissions.DELETE_APPLICATION) %} {% call Modal(name="delete-application") %}