{% extends "base/base.html" %}
{% load staticfiles %}

{% block staticfile %}
<link rel="stylesheet" href="{% static 'css/setting.css' %}">
{% endblock staticfile %}

{% block content %}
            <div id="settingContentWrap">
                <h3 id="settingHeadLine">User Settings</h3>
                <div id="settingWrap" class="fix">
                    <div>
                        <form action="/setting/changePassword" method="POST" name="cpf">{% csrf_token %}
                            <div class="line">
                                <p>비밀번호</p>
                                <input type="password" name="password" id="password">
                            </div>
                            <div class="line">
                                <p>새 비밀번호</p>
                                <input type="password" name="change_password" id="change_password">
                            </div>
                            <div class="line">
                                <p>새 비밀번호 확인</p>
                                <input type="password" name="confirm_password" id="confirm_password">
                            </div>
                            <div class="line">
                                <button>저장</button>
                            </div>
                        </form>
                    </div>
                    <div>
                        <form action="/setting/changeUserInfo" method="POST" name="uif" enctype="multipart/form-data">{% csrf_token %}
                            <div class="line">
                                <p>사용자 이름</p>
                                <input type="text" value="{{ user.name }}" name="user_name" id="user_name">
                            </div>
                            <div class="line">
                                <p>사용자 이메일</p>
                                <input type="email" value="{{ user.email }}" name="user_email" id="user_email">
                            </div>
                            <div class="line">
                                <p>사용자 프로필</p>
                                {% if user.propic %}
                                    <div class="settingPropic"><img src="{{ user.propic.url }}"width="80px"></div>
                                {% else %}
                                    <div><img src="/static/image/ningen.png"width="80px"></div>
                                {% endif %}
                                <input type="file" name="user_propic" id="user_propic">
                            </div>
                            <div class="line">
                                <button>저장</button>
                            </div>
                        </form>
                    </div>
                    <div>
                        <div class="line">
                            <p>테마</p>
                            <div id="themeTap" class="fix">
                                <div>
                                    <div>
                                        <img src="{% static 'image/light.png' %}">
                                    </div>
                                    <div>
                                        <input type="radio" name="color_theme"><span>밝은 색</span>
                                    </div>
                                </div>
                                <div>
                                    <div>
                                        <img src="{% static 'image/dark.png' %}">
                                    </div>
                                    <div>
                                        <input type="radio" name="color_theme"><span>어두운 색</span>
                                    </div>
                                </div>
                            </div>
                            <div class="line">
                                <p>언어</p>
                                <input type="radio" name="lang_theme"><span>한글</span>
                                <input type="radio" name="lang_theme"><span>영어</span>
                            </div>
                            <div class="line">
                               <button>저장</button>
                            </div>
                        </div>
                    </div>
                </div>
                {% if user.is_superuser %}
                <div id="companySettingWrap">
                    <h3 id="companyHeadLine">Company Settings</h3>
                    <div>
                        <form action="/order/companyIfo" method="POST" name="cif" id="cif">{% csrf_token %}
                            <div class="line">
                                <p>회사명 등록</p>
                                <input type="text" name="company" id="company" value="{{ company.name }}">
                            </div>
                            <div class="line">
                                <p>회사코드</p>
                                <input type="text" name="company_code" id="company_code" value="{{ company.code }}">
                            </div>
                            <div class="line">
                               <button>저장</button>
                            </div>
                        </form>
                    </div>
                    <div>
                        <form action="/setting/createDepartment" method="POST" name="cif" id="cif">{% csrf_token %}
                            <div class="line">
                                <p>부서명 등록</p>
                                <input type="text" autocomplete="off" name="department" id="department">
                            </div>
                            <div class="line">
                                <p>부서리스트</p>
                                <select id="departmentList" size="5">
                                    {% for department in departmentList %}
                                        <option value="{{ department.id }}">{{ department.name }}</option>
                                    {% endfor %}
                                </select>
                            </div>
                            <div class="line">
                               <button>저장</button>
                            </div>
                        </form>
                    </div>
                    <div>
                        <form action="/setting/userActive" method="POST" name="uaf" id="uaf">{% csrf_token %}
                            <div class="line">
                                <p>유저 리스트</p>
                                <select>
                                    <option></option>
                                </select>
                            </div>
                        </form>
                    </div>
                </div>
                {% endif %}

            </div>

{% endblock content %}