{% extends 'layouts/base.html' %}
{% load i18n %}
{% load static %}

{% block content %}
  {% include 'header.html' %}
  <main id="main-content">
    {% include 'partials/notifications/notifications_block.html' %}
    <section>
      <div>
        <h1>{% translate 'Edit member' %}</h1>
        <form method="post" class="horizontal-view">
          {% csrf_token %}
          <fieldset>
            {% with member.member_name as name %}
              <legend>
                {% blocktranslate %}Edit {{ name }}{% endblocktranslate %}
              </legend>
            {% endwith %}
            <div>
              {% translate 'Member name' %}
              <div>{{ object.member_name }}</div>
            </div>
            <div>
              {% translate 'Role in organization' %}
              <div>{{ object.member_role }}</div>
            </div>
            <div>
              {% translate 'Goal' %}
              <div>{{ object.goal }}</div>
            </div>
            <div>
              {% translate 'Authorized to sign' %}
              <div>{{ object.authorized }}</div>
            </div>
            {% for field in form %}
              {% include 'partials/form/field_input_wrapper.html' %}
            {% endfor %}
          </fieldset>
          <div class="horizontal-view">
            <button type="submit">{% translate 'Save member' %}</button>
            <a class="button ghost"
               href="{% url 'organization_detail' object.organization_id %}">{% translate 'Cancel' %}</a>
          </div>
        </form>
      </div>
    </section>
  </main>
{% endblock %}

{% block html_at_end_body %}
  {{ block.super }}
  <script src="{% static '/js/checkboxToggler.js' %}" nonce="{{ request.csp_nonce }}"></script>
{% endblock %}
