<script id="template-survery" type="text/x-tmpl">
  <div class="attributes" data-index="${_l}" data-question="${_ques}">
    <div class="attributes-header clearfix">
      <a class="btn btn-mini pull-right btn-danger delete" href="#"><i class="icon-trash"></i> Delete</a>
      <input class="should_destroy" id="${_destroy[0]}" name="${_destroy[1]}" type="hidden">
      <input id="${_sequence[0]}" class="sequence" name="${_sequence[1]}" type="hidden" value="${_sequence[2]}">
      {{if _id}}
        <input id="${_id[0]}" name="${_id[1]}" type="hidden" value="${_id[2]}">
      {{/if}}
      <h4><b></b> Q<span>${_length}</span> <i class="icon-caret-up"></i> <span class="questions-title">${_title_translations[3].en}</span></h4>
    </div>
    <div class="attributes-body">
      <div class="control-group">
        <label class="control-label muted" for="">Question Title</label>
        <div class="controls">
          <div class="input-append">
            <div class="tab-content">
              <div class="tab-pane fade active in" id="${_title_translations[2]+'_en'}">
                <input class="span4 q-title" id="${_title_translations[0]+'_en'}" name="${_title_translations[1]+'[en]'}" type="text" value="${_title_translations[3].en}" />
              </div>
              <div class="tab-pane fade" id="${_title_translations[2]+'_zh_tw'}">
                <input class="span4 q-title" id="${_title_translations[0]+'_zh_tw'}" name="${_title_translations[1]+'[zh_tw]'}" type="text" value="${_title_translations[3].zh_tw}" />
              </div>
            </div>
            <div class="btn-group" data-toggle="buttons-radio">
              <a class="btn change-title active" href="${'#'+_title_translations[2]+'_en'}" data-toggle="tab">English</a>
              <a class="btn change-title" href="${'#'+_title_translations[2]+'_zh_tw'}" data-toggle="tab">Chinese</a>
            </div>
          </div>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label muted">Description </label>
        <div class="controls">
          <div class="tab-content textarea-lang">
            <div class="btn-group" data-toggle="buttons-radio">
              <a class="btn active" href="${'#'+_description_translations[2]+'_en'}" data-toggle="tab">English</a>
              <a class="btn" href="${'#'+_description_translations[2]+'_zh_tw'}" data-toggle="tab">Chinese</a>
            </div>
            <div class="tab-pane fade active in" id="${_description_translations[2]+'_en'}">
              <textarea class="resizable" id="${_description_translations[0]+'_en'}" name="${_description_translations[1]+'[en]'}" rows="3">${_description_translations[3].en}</textarea>
            </div>
            <div class="tab-pane fade" id="${_description_translations[2]+'_zh_tw'}">
              <textarea class="resizable" id="${_description_translations[0]+'_zh_tw'}" name="${_description_translations[1]+'[zh_tw]'}" rows="3">${_description_translations[3].zh_tw}</textarea>
            </div>
          </div>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label muted" for="">Type </label>
        <div class="controls">
          <select class="type-selector" id="${_type[0]}" name="${_type[1]}" >
            <option value="0" {{if _type[2] == 0}}selected="selected"{{/if}}>Oneline</option>
            <option value="1" {{if _type[2] == 1}}selected="selected"{{/if}}>Multi-line</option>
            <option value="2" {{if _type[2] == 2}}selected="selected"{{/if}}>Radio</option>
            <option value="3" {{if _type[2] == 3}}selected="selected"{{/if}}>Check</option>
            <option value="4" {{if _type[2] == 4}}selected="selected"{{/if}}>Select</option>
            <option value="5" {{if _type[2] == 5}}selected="selected"{{/if}}>Radio Group</option>
          </select>
        </div>
      </div>

      <div class="field-type" style="display: none">


        <div class="control-group rgl">
          <label for="" class="control-label muted">Radio Group Label</label>
          <div class="controls add-input">
            <div class="add-target">
             

              <p class="add-btn">
                <a href="#" class="btn btn-mini btn-primary"><i class="icons-plus"></i> Add</a>
              </p>
            </div>
          </div>
        </div>

        <hr />

        <div class="control-group options">
          <label for="" class="control-label muted">Options List</label>
          <div class="controls add-input">
            <div class="add-target">
             

              <p class="add-btn">
                <a href="#" class="btn btn-mini btn-primary"><i class="icons-plus"></i> Add</a>
              </p>
            </div>
          </div>
        </div>

        <div class="control-group allow">
          <div class="controls">
            <label class="checkbox">
              <input name="${_custom_option[1]}" type="hidden" value="${_custom_option[2] << 0}" />
              <input id="${_custom_option[0]}" type="checkbox" {{if _custom_option[2]}} checked="checked" {{/if}} />
              Allow Custom Option
            </label>
          </div>
        </div>


      </div>

      <div class="control-group">
        <label class="control-label muted" for="redirectMode"></label>
        <div class="controls">
          <label class="checkbox">
            <input name="${_is_required[1]}" type="hidden" value="${_is_required[2] << 0}" />
            <input id="${_is_required[0]}" type="checkbox" {{if _is_required[2]}} checked="checked" {{/if}} />
            Is Required
          </label>
        </div>
      </div>

    </div>
  </div>
</script>



<script id="template-survery-option" type="text/x-tmpl">
{{if _className == 'rgl'}}
  <div class="input-append" data-question-option="${_ques}">
    {{if _radiogroups_id}}
      <input type="hidden" value="${_radiogroups_id[1]}" name="${_radiogroups_id[0]}" />
      <input type="hidden" class="should_destroy_option" name="${_destroy[0]}" />
    {{/if}}
    <div class="tab-content">
      <div class="tab-pane fade active in" id="${_radiogroups[2]+'en'}">
        <input type="text" class="span4" id="${_radiogroups[0]+'en'}" name="${_radiogroups[1]+'[en]'}" value="${_radiogroups[3].en}" />
      </div>
      <div class="tab-pane fade" id="${_radiogroups[2]+'zh_tw'}">
        <input type="text" class="span4" id="${_radiogroups[0]+'zh_tw'}" name="${_radiogroups[1]+'[zh_tw]'}" value="${_radiogroups[3].zh_tw}" />
      </div>
    </div>
    <div class="btn-group" data-toggle="buttons-radio">
      <a class="btn active" href="${'#'+_radiogroups[2]+'en'}" data-toggle="tab">English</a>
      <a class="btn" href="${'#'+_radiogroups[2]+'zh_tw'}" data-toggle="tab">Chinese</a>
      <a href="#" class="btn remove-input">
        <i class="icon-trash"></i>
      </a>
    </div>
  </div>
{{else}}
  <div class="input-append" data-question-option="${_ques}">
   {{if _options_id}}
      <input type="hidden" value="${_options_id[1]}" name="${_options_id[0]}" />
       <input type="hidden" class="should_destroy_option" name="${_destroy[0]}" />
    {{/if}}
    <div class="tab-content">
      <div class="tab-pane fade active in" id="${_option[2]+'en'}">
        <input type="text" class="span4" id="${_option[0]+'en'}" name="${_option[1]+'[en]'}" value="${_option[3].en}" />
      </div>
      <div class="tab-pane fade" id="${_option[2]+'zh_tw'}">
        <input type="text" class="span4" id="${_option[0]+'zh_tw'}" name="${_option[1]+'[zh_tw]'}" value="${_option[3].zh_tw}" />
      </div>
    </div>
    <div class="btn-group" data-toggle="buttons-radio">
      <a class="btn active" href="${'#'+_option[2]+'en'}" data-toggle="tab">English</a>
      <a class="btn" href="${'#'+_option[2]+'zh_tw'}" data-toggle="tab">Chinese</a>
      <a href="#" class="btn remove-input">
        <i class="icon-trash"></i>
      </a>
    </div>
  </div>
{{/if}}

</script>