{% extends "multitenancy/admin/base.html" %}

{% load bootstrap4 %}
{#% load thumbnail %#}

{% block body_class %}teams form{% endblock %}

{% block head_title %}Create Team{% endblock %}
{% block page_title %}Team Form{% endblock %}
{%block breadcrumbs%}
<li class="breadcrumb-item " ><a href="{% url 'pinax_teams:team_list' %}">Teams</a></li>

<li class="breadcrumb-item active">Create Teams</li>
{% endblock%}

{% block main_content %}
<div class="container p-5 text-dark">
    <div class="row">
        <div class="col-md-6">
            <form class="form profile-form" action="" method="POST" enctype="multipart/form-data">
                {% if team.pk %}
                    <legend>Edit Team</legend>
                {% else %}
                    <legend>Create Team</legend>
                {% endif %}

                {% csrf_token %}

                {% bootstrap_field form.name %}

                <div id="div_id_avatar" class="control-group">
                    <label for="id_avatar" class="control-label">
                        Avatar
                    </label>
                    <div class="controls">
                        {% if profile.avatar %}
                            <img class="img-polaroid avatar hidden-phone" src="{{ profile.avatar}}" alt="{{ profile.name }}" /><br />
                        {% endif %}
                        <span class="btn btn-success btn-avatar btn-small">
                            <span>Select File</span>
                            <input id="id_avatar" name="avatar" type="file">
                        </span>
                        <span class="selected-filename"></span>
                    </div>
                </div>

                 {% bootstrap_field form.description %}
                 {% bootstrap_field form.member_access %}
                 {% bootstrap_field form.manager_access %}
                

                <button type="submit" class="btn btn-primary">Save</button>
                {% if team.pk %}
                    <a class="btn btn-default" href="{% url 'pinax_teams:team_detail' team.slug %}">Cancel</a>
                {% else %}
                    <a class="btn btn-default" href="{% url 'pinax_teams:team_list' %}">Cancel</a>
                {% endif %}
            </form>
        </div>
    </div>
</div>
{% endblock %}