{% extends "workspaces/base.html" %}

{% from "components/icon.html" import Icon %}
{% from "components/alert.html" import Alert %}
{% from "components/text_input.html" import TextInput %}


{% block workspace_content %}

{% if form.errors %}
  {{ Alert('There were some errors',
    message="<p>Please see below.</p>",
    level='error'
  ) }}
{% endif %}

<form method="POST" action="{{ url_for('workspaces.edit_workspace', workspace_id=workspace.id) }}" autocomplete="false">
  {{ form.csrf_token }}

  <div class="panel">

    <div class="panel__heading">
      <h1>Workspace Settings</h1>
    </div>

    <div class="panel__content">
      {{ TextInput(form.name, validation="workspaceName") }}
    </div>
  </div>


  <div class='action-group'>
    <button type="submit" class="usa-button usa-button-big usa-button-primary" tabindex="0">Save</button>
    <a href='{{ url_for("workspaces.workspace_projects", workspace_id=workspace.id) }}' class='action-group__action icon-link'>
      {{ Icon('x') }}
      <span>Cancel</span>
    </a>
  </div>


</form>

{% endblock %}
