{% extends 'old-bootstrap-modal-layout.html.twig' %}
{% block title %}{{ template.name|trans|raw }}{% endblock %}

{% block body %}
  <form class="form-horizontal" id="notification-setting-form" method="post" action="{{ path('admin_wechat_notification_setting_modal', {key: key}) }}">
    {% block rule %}
      <div class="form-group">
        <div class="col-sm-2 control-label"><label>{{'wechat.notification.setting_conditions_label'|trans}}</label></div>
        <div class="col-sm-10 controls mts">{{ template.rule|trans|raw }}</div>
      </div>

    {% endblock %}
    {% block status %}
      <div class="form-group">
        <div class="col-sm-2 control-label"><label>{{'wechat.notification.setting_status_label'|trans}}</label></div>
        <div class="col-sm-10 controls radios mts">
          <label><input type="radio" name="status" value="1" {% if template.status|default(0) == 1 %}checked{% endif %}> {{'是'|trans}}</label>
          <label><input type="radio" name="status" value="0" {% if template.status|default(0) == 0 %}checked{% endif %}> {{'否'|trans}}</label>
        </div>
      </div>
    {% endblock %}
    {% block custom %}{% endblock %}
    <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
  </form>
{% endblock %}
{% block footer %}
  <div class="pull-right">
    <a href="{{ path('admin_wechat_notification_manage') }}" class="btn btn-link">{{ 'form.btn.cancel'|trans }}</a>
    <button type="button" class="js-notification-setting-btn btn btn-primary save-btn" data-url="{{ path('admin_wechat_notification_setting_modal', {key:key}) }}" data-submiting-text="{{ 'wechat.notification.saving'|trans }}">{{ 'wechat.notification.save'|trans }}</button>
  </div>
  <script>app.load('wechat-notification/setting-modal/index');</script>
{% endblock %}