{% extends 'admin/edu-cloud/edu-cloud-layout.html.twig' %}

{% block title %}{{ '教育云'|trans }} - {{ parent() }}{% endblock %}

{% set menu = 'overview' %}
{# {% set script_controller = '' %} #}

{% block main %}
  <div class="page-header"><h1>{{'概览'|trans}}</h1></div>
{% if account %}
  <div class="panel panel-default">
    <table class="table table-striped table-hover" style="word-break:break-all;">
      <thead>
          <tr>
              <th style="text-align: center; width: 40%">{{'项目'|trans}}</th>
              <th style="text-align: center; width: 30%">{{'内容'|trans}}</th>
              <th style="text-align: center;">{{'操作'|trans}}</th>
          </tr>
      </thead>
      <tbody style="text-align: center;">
        
          <tr>
            <td>{{'账户余额'|trans}}</td> 
            <td><span>{{account.cash|default(0)}}</span> {{'元 '|trans}}</td>
            <td><a class="btn btn-primary btn-sm" href="{{path('admin_cloud_recharge')}}" target="_blank"> {{'去充值'|trans}} </a></td>
          </tr>
        
          <tr>
            <td>{{'云短信状态'|trans}}</td>
            <td>
              <span>
              {% if smsStatus.status == 'auditing' %}
                {{'审核中'|trans}}
              {% endif %}
              {% if smsStatus.status == 'failed' %}
                {{'未通过'|trans}}
              {% endif %}
              {% if smsStatus.status == 'passed' %}
                {{'已通过'|trans}}
              {% endif %}
              {% if smsStatus.status == 'error' %}
                {{ smsStatus.message }}
              {% endif %}
              </span>
            </td>

            <td>
              {% if smsStatus.status == 'error' %} {# or smsStatus.status == 'failed' #}
                <span class="btn btn-default btn-sm" data-toggle="modal" data-target="#modal" data-url="{{path('admin_edu_cloud_apply_for_sms')}}" > {{'申请开通云短信'|trans}} </span>
              {% endif %}
            </td>
          </tr>
      <tbody>
    </table>
  </div>
{% else %}
  <td><a class="btn btn-primary btn-sm" href="http://open.edusoho.com/register" target="_blank"> {{'没有帐号? 去注册'|trans}} </a></td>
{% endif %}
{% endblock %}