{% extends 'settings/layout.html.twig' %}
{% block title %}{{'安全设置'|trans}} - {{ parent() }}{% endblock %}
{% set side_nav = 'security' %}

{% block main %}
 {% embed "bootstrap/panel.html.twig" with {class:'panel-col'} %}
    {% block heading %}{{'安全设置'|trans}}{% endblock %}
    {% block body %}
    {{ web_macro.flash_messages() }}

      <div class="row safety-setting" style="margin-top:10px;">
        <div class="col-xs-2 tar">
          <span class="glyphicon glyphicon-info-sign {% if progressScore > 67 %}color-success{% elseif progressScore > 34 %}text-warning{% else %}color-danger{% endif %}" style="font-size:20px;"></span>
        </div>
      <div class="col-sm-6 col-xs-5">
        <div class="progress mbs">
          <div class="progress-bar" role="progressbar" style="width: {{ progressScore }}%;"></div>
        </div>
      </div>
      <div class="col-sm-4 col-xs-5">
        {% if progressScore > 67 %}
          <span class="color-success" style="display:block;">{{'安全等级：高'|trans}}</span>
        {% elseif progressScore > 34 %}
        <span class="text-warning" style="display:block;">{{'安全等级：中'|trans}}</span>
        {% else %}
          <span class="color-danger" style="display:block;">{{'安全等级：低'|trans}}</span>
        {% endif %}
      </div>
    </div>

    <hr>

    <div class="row">
      <div class="col-xs-2 tar
        {% if hasLoginPassword %}
          color-success
        {% else %}
          color-danger
        {% endif %}
      " style="font-size:20px">
        {% if hasLoginPassword %}
          <span class="glyphicon glyphicon-ok"></span>
        {% else %}
          <span class="glyphicon glyphicon-warning-sign"></span>
        {% endif %}
      </div>

      <span class="col-sm-3 col-xs-6" style="margin-top: 5px;" >{{'登录密码'|trans}}</span>

      <span class="col-sm-4 hidden-xs" style="margin-top: 5px;" >{{'登录网校时需要输入的密码。'|trans}}</span>

      <a href="{{ path('settings_password') }}" class="col-xs-offset-1 btn btn-primary" style="margin-top: -3px;" >{{'修改'|trans}}</a>
    </div>
    <hr>

    <div class="row">
      <div class="col-xs-2 tar
        {% if hasPayPassword %}
          color-success
        {% else %}
          color-danger
        {% endif %}
      " style="font-size:20px">
        {% if hasPayPassword %}
          <span class="glyphicon glyphicon-ok"></span>
        {% else %}
          <span class="glyphicon glyphicon-warning-sign"></span>
        {% endif %}
      </div>

      <span class="col-sm-3 col-xs-6" style="margin-top: 5px;" >{{'支付密码'|trans}}</span>

      <span class="col-sm-4 hidden-xs" style="margin-top: 5px;" >{{'在网校进行消费行为时需要输入的密码。'|trans}}</span>

      {% if hasPayPassword %}
        <a href="{{ path('settings_reset_pay_password') }}" class="col-xs-offset-1 btn btn-primary" style="margin-top: -3px;" >{{'重置'|trans}}</a>
      {% else %}
        <a href="{{ path('settings_pay_password') }}" class="col-xs-offset-1  btn btn-primary" style="margin-top: -3px;" >{{'设置'|trans}}</a>
      {% endif %}

    </div>
    <hr>

    <div class="row">
      <div class="col-xs-2 tar
        {% if hasFindPayPasswordQuestion %}
          color-success
        {% else %}
          color-danger
        {% endif %} "
        style="font-size:20px">

        {% if hasFindPayPasswordQuestion %}
          <span class="glyphicon glyphicon-ok"></span>
        {% else %}
          <span class="glyphicon glyphicon-warning-sign"></span>
        {% endif %}
      </div>

      <span class="col-sm-3 col-xs-6" style="margin-top: 5px;" >{{'安全问题'|trans}}</span>

      <span class="col-sm-4 hidden-xs" style="margin-top: 5px;" >{{'通过设置并且验证安全问题，保护帐号密码安全。'|trans}}</span>

      <a href="{{ path('settings_security_questions') }}" class="col-xs-offset-1 btn btn-primary" style="margin-top: -3px;" >
      {% if hasFindPayPasswordQuestion %}
        {{'查看'|trans}}
      {% else %}
        {{'设置'|trans}}
      {% endif %}

      </a>
    </div>

    {% if (setting('cloud_sms.sms_enabled')|default('')) == '1' and (setting('cloud_sms.sms_bind')|default('')) == 'on' %}
      <hr>

      <div class="row">
        <div class="col-xs-2 tar
          {% if hasVerifiedMobile %}
            color-success
          {% else %}
            color-danger
          {% endif %} "
          style="font-size:20px">

          {% if hasVerifiedMobile %}
            <span class="glyphicon glyphicon-ok"></span>
          {% else %}
            <span class="glyphicon glyphicon-warning-sign"></span>
          {% endif %}
        </div>

        <span class="col-sm-3 col-xs-6" style="margin-top: 5px;" >{{'手机绑定'|trans}}</span>

        <span class="col-sm-4 hidden-xs" style="margin-top: 5px;" >{{'增加账户登录、购买课程时的安全性，同时还可以找回登录密码，支付密码。'|trans}}</span>

        <a href="{{ path('settings_bind_mobile') }}" class="col-xs-offset-1 btn btn-primary" style="margin-top: -3px;" >
        {% if hasVerifiedMobile %}
          {{'修改'|trans}}
        {% else %}
          {{'绑定'|trans}}
        {% endif %}
        </a>
      </div>
    {% endif %}

    {% endblock %}
  {% endembed %}
{% endblock %}