   viewRowDetail.DetailViewMixins._isRepeat =
     html: ->
       @$el.addClass("card__settings__fields--active")
-      """
-      <div class="card__settings__fields__field">
-        <label for="#{@cid}">Repeat: </label>
-        <span class="settings__input">
-          <input type="checkbox" name="#{@model.key}" id="#{@cid}"/> <label for="#{@cid}">Yes</label>
-        </span>
-      </div>
-      """
+      viewRowDetail.Templates.checkbox @cid, @model.key, 'Repeat'
     afterRender: ->
       @listenForCheckboxChange()
 
   viewRowDetail.DetailViewMixins.required =
     html: ->
       @$el.addClass("card__settings__fields--active")
-      """
-      <div class="card__settings__fields__field">
-        <label for="#{@cid}">Required: </label>
-        <span class="settings__input">
-          <input type="checkbox" name="#{@model.key}" id="#{@cid}"/> <label for="#{@cid}">Yes</label>
-        </span>
-      </div>
-      """
+      viewRowDetail.Templates.checkbox @cid, @model.key, 'Required'
     afterRender: ->
       @listenForCheckboxChange()
 
-      # inp = @$el.find("input")
-      # # to be moved into the model when XLF.configs.truthyValues is refactored
-      # isTrueValue = (@model.get("value") || "").toLowerCase() in $configs.truthyValues
-      # inp.prop("checked", isTrueValue)
-      # inp.change ()=> @model.set("value", inp.prop("checked"))
-
   viewRowDetail.DetailViewMixins.appearance =
     html: ->
       @$el.addClass("card__settings__fields--active")
       if @model._parent.constructor.key == 'group'
-        """
-        <div class="card__settings__fields__field">
-          <label for="#{@cid}">Appearance: </label>
-          <span class="settings__input">
-            <input type="checkbox" name="#{@model.key}" id="#{@cid}"/><label for="#{@cid}">Show all questions in this groups on the same screen</label>
-          </span>
-        </div>
-        """
+        viewRowDetail.Templates.checkbox @cid, @model.key, 'Appearance', 'Show all questions in this groups on the same screen'
       else
-        """
-        <div class="card__settings__fields__field">
-          <label for="#{@cid}">#{@model.key}: </label>
-          <span class="settings__input">
-            <input type="text" name="#{@model.key}" id="#{@cid}" class="text" />
-          </span>
-        </div>
-        """
+        viewRowDetail.Templates.textbox @cid, @model.key, 'Appearance', 'text'
     afterRender: ->
       if @model._parent.constructor.key == 'group'
         $checkbox = @$('input[type=checkbox]').eq(0)
+        value_lookup = ['', 'field-list']
         $checkbox.on 'change', () =>
-          if $checkbox.prop('checked')
-            @model.set('value', 'field-list')
-          else
-            @model.set('value', '')
+          @model.set('value', value_lookup[+$checkbox.prop('checked')])
       else
         @listenForInputChange()
 

  viewRowDetail.DetailViewMixins.hint = viewRowDetail.DetailViewMixins.default =
    html: ->
      @$el.addClass("card__settings__fields--active")
      """
      <div class="card__settings__fields__field">
        <label for="#{@cid}">#{@model.key}: </label>
        <span class="settings__input">
          <input type="text" name="#{@model.key}" id="#{@cid}" class="text" />
        </span>
      </div>
      """
    afterRender: ->
      @listenForInputChange()

  viewRowDetail.DetailViewMixins.constraint_message =
    html: ->
      @$el.addClass("card__settings__fields--active")
      """
      <div class="card__settings__fields__field">
        <label for="#{@cid}">Error Message: </label>
        <span class="settings__input">
          <input type="text" name="#{@model.key}" id="#{@cid}" class="text" />
        </span>
      </div>
      """
    insertInDOM: (rowView)->
      @_insertInDOM rowView.cardSettingsWrap.find('.card__settings__fields--validation-criteria').eq(0)
    afterRender: ->

    insertInDOM: (rowView)->
      @_insertInDOM rowView.defaultRowDetailParent

  viewRowDetail.Templates = {
    textbox: (cid, key, key_label = key, input_class = '') ->
      @field """<input type="text" name="#{key}" id="#{cid}" class="#{input_class}" />""", cid, key_label

    checkbox: (cid, key, key_label = key, input_label = 'Yes') ->
      @field """<input type="checkbox" name="#{key}" id="#{cid}"/> <label for="#{cid}">#{input_label}</label>""", cid, key_label

    field: (input, cid, key_label) ->
      """
      <div class="card__settings__fields__field">
        <label for="#{cid}">#{key_label}:</label>
        <span class="settings__input">
          #{input}
        </span>
      </div>
      """

  viewRowDetail.DetailViewMixins = {}

  viewRowDetail.DetailViewMixins.type =
