  {% extends 'TopxiaAdminBundle:CloudSetting:layout.html.twig' %}

{% block title %}云平台设置 - {{ parent() }}{% endblock %}

{% set submenu = 'key' %}
{% set script_controller = 'setting/cloud-key-update' %}

{% block maincontent %}

{{ web_macro.flash_messages() }}

<form class="form-horizontal" id="key-update-form" method="post" novalidate>

  <div class="form-group">
    <label class="col-md-3 control-label" for="access-key-field">AccessKey</label>
    <div class="col-md-6 controls">
      <input id="access-key-field" class="form-control" type="text" name="accessKey" value="{{ app.request.request.get('accessKey')|default(setting('storage.cloud_access_key', '')) }}">
      <p class="help-block">{{ '在线升级EduSoho系统、购买EduSoho应用、使用EduSoho云服务，都需使用此Key。'|copyright_less }}</p>
    </div>
  </div>

  <div class="form-group">
    <label class="col-md-3 control-label" for="secret-key-field">SecretKey</label>
    <div class="col-md-6 controls">
      <input id="secret-key-field" class="form-control" type="text" name="secretKey" value="{{ app.request.request.get('secretKey')|default(setting('storage.cloud_secret_key', '')) }}">
    </div>
  </div>

  <div class="form-group">
    <div class="col-md-3 control-label"></div>
    <div class="controls col-md-6">
      <button type="submit" class="btn btn-primary save-btn" data-loading-text="正在保存，请稍等...">保存</button>

      {% if not setting('storage.cloud_key_applied') %}
        <span class="pull-right"><span class="text-info">还没有授权码?</span> <a href="javascript:;" id="key-apply-btn" class="btn btn-sm btn-warning" data-url="{{ path('admin_setting_cloud_key_apply') }}" data-goto-url="{{ path('admin_setting_cloud_key') }}"  data-loading-text="正在申请授权码，请稍等...">申请授权码</a></span>
      {% endif %}

    </div>
  </div>

  <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
</form>

{% endblock %}