{% extends 'custom_admin_base.html' %}
{% load staticfiles %}
{% block content %}
    {% include 'custom_admin_user_sub.html' %}
    <form method="post" action="{% url 'accounts:user_modify' %}" class="FormWrap" onsubmit=""> {% csrf_token %}
        <div class="addSmartBI"><img src="/static/base/image/smartBI.png"></div>
        {% if success %}
        <p>{{ success }}</p>
        {% endif %}
        <input type="hidden" name="user-pk" value="{{ modifiedUser.id }}">
        <label for="id_user-username">아이디:</label><input id="id_user-username" maxlength="30" name="user-username" type="text" readonly value="{{ modifiedUser.username }}" />
        <label for="id_user-email">이메일 주소:</label><input id="id_user-email" maxlength="254" name="user-email" type="email" value="{{ modifiedUser.email }}" />
        <label for="id_user-password1">비밀번호:</label><input id="id_user-password1" name="user-password" type="password" />
        <label for="id_user-password2">비밀번호 확인:</label><input id="id_user-password2" name="user-password2" placeholder="비밀번호 변경 시 한 번 더 입력 해 주세요" type="password" />
        <label for="id_user-first_name">이름:</label><input id="id_user-first_name" maxlength="30" name="user-first_name" type="text" value="{{ modifiedUser.userprofile.user_name }}" />
        <label for="id_profile-mobile">Mobile:</label> <input id="id_profile-mobile" maxlength="100" name="profile-mobile" type="text" value="{{ modifiedUser.userprofile.mobile }}" />
        <label for="id_profile-company">Company:</label><select id="id_profile-company" name="profile-company">
            <option value="{{ modifiedUser.userprofile.company_id }}" selected="selected">{{ modifiedUser.userprofile.company.name }}</option>
            {% for company in companyList %}
            <option value="{{ company.id }}">{{ company.name }}</option>
            {% endfor %}
        </select>
        <div class="Btn">
            <button class="cancelBtn" type="button" onclick="as.returnUserList()">목록</button>
            <button class="SaveBtn" type="button" onclick="as.deleteUser({{ modifiedUser.id }})">삭제</button>
            <button class="SaveBtn" type="submit">수정</button>
        </div>
    </form>
{% endblock content %}
{% block extrascript %}
{% endblock extrascript %}