From 8fe9c464bde21adbf5b83e427366b687da46499e Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Mon, 15 Oct 2018 16:40:15 -0400 Subject: [PATCH] Refactor Edit Project Form fragment to only include form fields that are shared in new and edit forms --- templates/fragments/edit_project_form.html | 92 ++++------------------ 1 file changed, 15 insertions(+), 77 deletions(-) diff --git a/templates/fragments/edit_project_form.html b/templates/fragments/edit_project_form.html index b55b9f7b..50e387e3 100644 --- a/templates/fragments/edit_project_form.html +++ b/templates/fragments/edit_project_form.html @@ -1,87 +1,25 @@ -{% from "components/icon.html" import Icon %} -{% from "components/modal.html" import Modal %} {% from "components/text_input.html" import TextInput %} {% from "components/alert.html" import Alert %} - - {% set new_project = project is not defined %} - {% set form_action = url_for('workspaces.create_project', workspace_id=workspace.id) if new_project else url_for('workspaces.edit_project', workspace_id=workspace.id, project_id=project.id) %} - {% set action_text = 'Create' if new_project else 'Update' %} - {% set title_text = 'Add a new project' if new_project else 'Edit {} project'.format(project.name) %} +{% set title_text = 'Edit {} project'.format(project.name) if project else 'Add a new project' %} -
- {% call Modal(name=modalName, dismissable=False) %} -

{{ action_text }} project !{ name }

+{{ form.csrf_token }} +
+
+

{{ title_text }}

+
+

- When you click {{ action_text }} Project, the environments - - !{environment.name} - - will be created as individual cloud resource groups under !{ name } project. + AT-AT allows you to organize your workspace into multiple projects, each of which may have environments.

- -
- - -
- {% endcall %} - - {{ form.csrf_token }} -
-
-

{{ title_text }}

-
- -
-

- AT-AT allows you to organize your workspace into multiple projects, each of which may have environments. -

- {{ TextInput(form.name) }} - {{ TextInput(form.description, paragraph=True) }} -
+ {{ TextInput(form.name) }} + {{ TextInput(form.description, paragraph=True) }}
+
-
{# this extra div prevents this bug: https://www.pivotaltracker.com/story/show/160768940 #} -
- {{ Alert(message=None, level="error", vue_template=True) }} -
+
{# this extra div prevents this bug: https://www.pivotaltracker.com/story/show/160768940 #} +
+ {{ Alert(message=None, level="error", vue_template=True) }}
- - {% if new_project %} -
-
-

Project Environments

-

- Each environment created within a project is an enclave of cloud resources that is logically separated from each other for increased security. -

-
- -
    -
  • -
    - - -
    - -
  • -
- - -
- {% endif %} - -
- -
- -
- - - - +