<div class="row" id="test-content">
    <div class="col-xs-12">

    <form class="form-horizontal" role="form">

        <div class="form-group">
            <label class="col-sm-3 control-label no-padding-right" for="" data-i18n="template.group"></label>

            <div class="col-sm-9">
              <select class="col-xs-10 col-sm-5" id="groupSelect">

              </select>
            </div>
        </div>


        <div class="form-group batch-insert">
            <label class="col-sm-3 control-label no-padding-right" for="" data-i18n="template.content"></label>

            <div class="col-sm-9">
              <textarea id="content" class="autosize-transition span12" style="overflow: hidden; word-wrap: break-word; height: 50px; margin: 0px; width: 237px;resize: none;"></textarea>
            </div>
        </div>

        <div class="clearfix form-actions">
            <div class="col-md-offset-3 col-md-6">
                <button class="btn btn-info submit" type="button" onclick="add();">
                    <i class="ace-icon fa fa-check bigger-110"></i>
                    <span data-i18n="operation.save"></span>
                </button>

            </div>
        </div>

    </form>
    </div>
</div>

<textarea id="templateGroupSelect" style="display:none">

  <!-- <option value="0" data-i18n="operation.default"></option> -->
  {{#data}}
  <option value="{{group_id}}">{{group_name}}</option>
  {{/data}}

</textarea>


<script type="text/javascript">

  jsonm("template/group_cache.php","#templateGroupSelect","#groupSelect");

  function add()
  {
      var group  = $("#groupSelect").val();
      var content = $("#content").val();

      var param = "group=" + group;
      param += "&content=" + paramEncode(content);

      var url = "template/add.php";
      url += "?" + param;

      jsonp(url,function (data) {
          mbox(data.msg);
          hidePbox();
          loadTable();
      });
  }
</script>
