{% extends 'bom/bom-base.html' %}

{% load materializecss %}
{% load static %}

{% block head-title %}{{ title }}{% endblock %}

{% block bom-menu %}
    <li><a href="javascript:history.back()">Cancel</a></li>
{% endblock %}

{% block content %}
    <div class="container container-app">
        <div class="row">
            <div class="col s12 m8 offset-m2">
                <div class="card">
                    <div class="card-content">
                        {% if h1 %}<span class="card-title">{{ h1 }}</span>{% endif %}

                        <div class="row" style="margin-bottom: 30px;">
                            <div class="col s12">
                                <ul class="collection" style="border: none;">
                                    <li class="collection-item avatar"
                                        style="border-bottom: 1px solid #e0e0e0; min-height: 64px;">
                                        <i class="material-icons circle">business</i>
                                        <span class="title">Organization</span>
                                        <p class="grey-text">{{ organization }}</p>
                                    </li>
                                    <li class="collection-item avatar"
                                        style="border-bottom: 1px solid #e0e0e0; min-height: 64px;">
                                        <i class="material-icons circle">person</i>
                                        <span class="title">Username</span>
                                        <p class="grey-text">{{ user.username }}</p>
                                    </li>
                                    <li class="collection-item avatar" style="min-height: 64px;">
                                        <i class="material-icons circle">email</i>
                                        <span class="title">Email</span>
                                        <p class="grey-text">{{ user.email }}</p>
                                    </li>
                                </ul>
                            </div>
                        </div>

                        <form name="seller" action="{{ action }}" method="post">
                            {% csrf_token %}
                            <div class="row">
                                {{ form|materializecss:'s12' }}
                            </div>

                            <div class="card-action"
                                 style="padding: 16px 0 0 0; border-top: 1px solid rgba(160,160,160,0.2);">
                                <div class="row" style="margin-bottom: 0;">
                                    <div class="col s6">
                                        <a href="javascript:history.back()"
                                           class="waves-effect waves-teal btn-flat grey-text">Cancel</a>
                                    </div>
                                    <div class="col s6 right-align">
                                        <button class="waves-effect waves-light btn btn-primary" type="submit"
                                                name="action">Save Changes
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}