{% extends 'old-bootstrap-modal-layout.html.twig' %}

{% set modalSize = 'large' %}

{% block title %}{{'短信推送'|trans}}{% endblock %}
{% block body %}

<lable id="smsSend-form" class="form-horizontal"  data-url = "{{ path('generate_short_link',{url:url})}}" style="display:none;">
  <div class="row form-group">
    <div class="col-md-3 control-label">
      <label for="title">{{'发送对象'|trans}}:</label>
    </div>
    <div class="col-md-7 controls">
      <p class="help-block">{% if targetType == 'course' and item.parentId %}{{'%classroom.name%内'|trans({'%classroom.name%': classroom.name|default('班级'|trans)})}} {% else %}{{'所有'|trans}}{% endif %}{{'用户'|trans}}</p>
    </div>
  </div>

  <div class="row form-group">
    <div class="col-md-3 control-label">
      <label for="title">{{'预计发送量'|trans}}:</label>
    </div>
    <div class="col-md-7 controls">
      <p class="help-block">{{count}}{{'条'|trans}}</p>
    </div>
  </div>

  <div class="row form-group">
    <div class="col-md-3 control-label">
      <label for="startTime">{{'发送内容'|trans}}:</label>
    </div>
    <div style="z-index:2000;">
      <p class="help-block">
        {% if smsInfo.usedSmsSign.name|default()  %}
          【{{ smsInfo.usedSmsSign.name }}】
        {% endif %}
          {% if targetType == 'classroom' %}{{ classroom.name|default('班级'|trans) }}{% else %}{{'课程'|trans}}{% endif %}{{'：'|trans}}{{'《'|trans}}{{item.title}}{{'》'|trans}}{{'现已开始报名'|trans}} ! <a href ='{{url}}' target="_blank">{{'链接地址'|trans}}</a>
      </p>
    </div>
  </div>
</lable>

<form id="smsSend-ready" class="form-horizontal">
  <input type="hidden" name="sms_open" value={{isOpen}}>
  <div class="row form-group">
    <div class="col-md-8 control-label">
      <p>{% if isOpen %}{{'短信发送准备中'|trans}}...{% else %}{{'请联系超级管理员，开启云短信相关设置。'|trans}}{% endif %}</p>
    </div>
  </div>
</form>
<div id="smsSend-progress" class="package-update-progress" style="display:none;">
  <div class="progress progress-striped active">
    <div class="progress-bar progress-bar-success" style="width: 0%"></div>
  </div>
  <div class="color-success progress-text"></div>
</div>

{% endblock %}

{% block footer %}
  <button id = 'begin-smsSend' data-url="{{ path('publish_sms_send',{targetType:targetType,id:item.id,count:count,index:0,url:url}) }}" data-submiting-text="{{'正在提交'|trans}}" class="btn btn-primary pull-right" data-toggle="form-submit" data-target="#smsSend-form" style="display:none;">{{'发送'|trans}}</button>
  <strong class="text color-danger" id="updating-hint" style="display:none;">{{'正在发送，请不要关闭当前窗口'|trans}}...</strong>
  <button id = 'cancle-smsSend'type="button" class="btn btn-link pull-right" data-dismiss="modal" style="display:none;">{{'取消'|trans}}</button>
  <button id="finish-smsSend" data-loading-text="{{'正在发送, 请稍等'|trans}}..." class="btn btn-primary" style="display:none">{{'发送完成'|trans}}</button>\

  {% include 'seajs_loader_compatible.html.twig' with {topxiawebbundle: true} %}
  <script> app.lazyLoad = function() { app.load('topxiawebbundle/controller/sms/sms-send') }; </script>
  
{% endblock %}