{% extends 'admin/layout.html.twig' %}


{% set menu = 'admin_edu_cloud_email_seeting' %} 

{% set script_controller = 'educloud/email-setting' %}
{% block main %}
{{ web_macro.flash_messages() }}
  {% if locked|default(0) == 1 %}
    <div class="alert alert-warning" role="alert">{{'您的云邮件已被锁定，请联系客服人员：'|trans}}4008041114。</div>
  {% endif %}
  {% if enabled|default(1) == 0 or email_enable == 'stoped' %}
    <div class="alert alert-danger" role="alert">{{'您的云邮件已被禁用，请联系客服人员：'|trans}}4008041114。</div>
  {% endif %}
  <div class="eduyun-main">
  {% if enabled|default(1) == 0 or email_enable == 'stoped' %}
    <div class="mask"></div>
  {% endif %}
  	<div class="page-header clearfix">
  	  <h1 class="pull-left">{{'云邮件'|trans}}</h1>
  	</div>
  	<div class="edu-service ">
  	  <div class="edu-balance">
        {% if emailInfo.isTest|default(0) or email_enable == 'stoped' %}
  			<div class="alert alert-warning" role="alert">
          {{ emailInfo.message }}   
        </div>
        {% endif %}
  			<div class="controls  radios">
          <form class="form-horizontal" method="post" id="email-form" novalidate="">
          {% if emailStatus.status|default('disable') in  ['disable'] and accessCloud|default(0) != 0 %}
    				<button name="email-open" class="btn btn-primary" >{{'启用云邮件'|trans}}</button>
          {% elseif emailStatus.status|default('disable') == 'enable' and emailStatus.sign|default(null) != "" and accessCloud|default(0) != 0 %}
            <div name="status">
              <span class="text-success">{{'已启用'|trans}}</span>
              <button  class="btn btn-default btn-sm mlm" name="email-close"><span class="text-muted">{{'关闭'|trans}}</span></button>
              <p><span>{{'发件人名称：'|trans}}{{ emailStatus.sign }}</span> <a href="#" name="sign-update">{{'修改'|trans}}</a></p>
            </div>
            <div name="submit-sign" hidden="hidden">
              <span>{{'发件人名称：'|trans}}<input type="text" name="sign" placeholder="{{'签名3-8字，建议使用汉字'|trans}}" style="width:250px" ></span><button class="btn btn-primary mlm mrm" >{{'提交'|trans}}</button><a href="">{{'取消'|trans}}</a>
            </div>
          {% elseif emailStatus.status|default(null) == 'error' or accessCloud|default(0) == 0 %}
            <div class="row">
              <div class="col-md-2">
                <button name="email-open" class="btn btn-primary" disabled="disabled" >{{'启用云邮件'|trans}}</button>
              </div>
              <div class="col-md-10">
                <span class="text-danger text-sm" >{{'抱歉，您尚未接入教育云，不能使用云邮件服务！'|trans}}</span>
                <p><a href="http://open.edusoho.com/educloud" target="_blank">{{'立即接入'|trans}}</a></p>
              </div>
            </div>
          {% endif %}
          <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
          </form>
          {% if emailStatus.status|default('disable') == 'disable' %}
  				<div class="help-block">{{'提供优质的邮件发送通道，保证邮件发送的稳定可靠；无复杂配置；无每日发送数量限制。'|trans}}</div>
          {% endif %}
  			</div>

  		</div>
  	</div>
    {% if emailStatus.status|default(0) != 'error' and accessCloud|default(0) != 0 and enabled|default(1) != 0  %}
  	<div class="page-header clearfix">
  	  <h1 class="pull-left">{{'邮件应用场景'|trans}}</h1>
  	</div>

  	<table class="table table-bordered">

      <thead>
        <tr>
          <th style="width:20%">{{'编号'|trans}}</th>
          <th style="width:30%">{{'应用场景'|trans}}</th>
          <th style="width:30%">{{'发送方式'|trans}}</th>
          <th style="width:20%">{{'状态'|trans}}</th>
        </tr>
      </thead>
      <tbody>
        <tr>
        </tr>
        <tr>
          <td>1</td>
          <td>
            {{'邮箱验证'|trans}}
          </td>
          <td>{{'自动单发'|trans}}
          </td>
          <td class="radios" >
            <label>
              <input type="hidden" name="sms_bind" value="on" >{{'默认开启'|trans}}
            </label>
          </td>
        </tr>
        <tr>
          <td>2</td>
          <td>
            {{'重置密码'|trans}}
          </td>
          <td>{{'自动单发'|trans}}
          </td>
          <td class="radios" >
            <label>
              <input type="hidden" name="sms_bind" value="on" >{{'默认开启'|trans}}
            </label>
          </td>
        </tr>
      </tbody>
    </table>
    {% endif %}
    <input name="email-status" hidden="hidden" data-status ="{{emailStatus.status|default("")}}">
  </div>
 <!--  <button type="submit" class="btn btn-primary">保存设置</button> -->
{% endblock %}
