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

{% set menu = 'admin_cloud_consult_setting' %}

{% block main %}
  {{ web_macro.flash_messages() }}
  <div class="page-heading">
    {{ 'admin.cloud_consult.content_title'|trans }}
  </div>
  <form class="form-horizontal" role="form" method="post" novalidate>
    <div class="form-group">
      <label for="" class="col-sm-3 control-label">{{ 'admin.cloud_consult.open'|trans }}：</label>
      <div class="controls col-md-9 radios">
        <div class="form-group">
          <label>
            <input type="radio" name="cloud_consult_setting_enabled"
                   value="1" {% if cloud_consult.cloud_consult_is_buy and cloud_consult.cloud_consult_setting_enabled %} checked {% endif %} {% if not cloud_consult.cloud_consult_is_buy %} disabled{% endif %}> {{ 'form.radio_btn.open'|trans }}
          </label>
          <label>
            <input type="radio" name="cloud_consult_setting_enabled"
                   value="0" {% if not cloud_consult.cloud_consult_is_buy or not cloud_consult.cloud_consult_setting_enabled %} checked {% endif %} {% if not cloud_consult.cloud_consult_is_buy %} disabled{% endif %}> {{ 'form.radio_btn.close'|trans }}
          </label>
        </div>
        <div class="help-block">
          {% if cloud_consult.cloud_consult_login_url | default('')%}
            <a href=" {{ cloud_consult.cloud_consult_login_url }} " target="_blank" class="btn btn-success">{{ 'admin.cloud_consult.login_url_btn'|trans }}</a>
            <br>
          {% endif %}
        </div>
        {% if  cloud_consult.cloud_consult_is_buy %}
          <div class="text-md mbl color-gray">
            {{ 'admin.cloud_consult.tips'|trans|raw }}
          </div>
        {% endif %}
      </div>
    </div>
    <div class="row form-group">
      <div class="controls col-md-offset-3 col-md-8">
          <button type="submit" class="btn btn-primary"{% if not cloud_consult.cloud_consult_is_buy %} disabled="disabled" {% endif %}>{{ 'form.btn.submit'|trans }}</button>
      </div>
    </div>
    <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
  </form>
{% endblock %}