<commit_before>@DetailViewMixins = do ->
  VX = {}

  VX.label = VX.hint =
    html: ->
      """
      #{@model.key}: <code>#{@model.get("value")}</code>
      """
    afterRender: ->
      @$el.find("code").editInPlace
        save_if_nothing_changed: true
        callback: (uu, ent)=>
          @model.set("value", ent)
          if ent is "" then "..." else ent

  VX.name =
    html: ->
      """
      #{@model.key}: <code>#{@model.get("value")}</code>
      """
    afterRender: ->
      @$el.find("code").editInPlace
        save_if_nothing_changed: true
        callback: (uu, ent)=>
          cleanName = XLF.sluggify ent
          @model.set("value", cleanName)
          if ent is "" then "..." else cleanName

  VX.required =
    html: ->
      """<label><input type="checkbox"> Required?</label>"""
    afterRender: ->
      inp = @$el.find("input")
      inp.prop("checked", @model.get("value"))
      inp.change ()=> @model.set("value", inp.prop("checked"))

  type_select_options = XLF.lookupRowType.typeSelectList()
  VX.type =
    html: ->
      typeId = @model.get("typeId")
      htmlStr = """
      <span class="select-tp">type: <code>#{typeId}</code></span>
      """
      rtp = @model.get("rowType")
      if rtp.specifyChoice
        listName = @model.get("list")?.get("name")
        if listName
          htmlStr += """ from <span class="select-list choice-list-anchor"><code>#{listName}</code></span> <button class="edit-list" data-list-name="#{listName}">Edit</button>"""
        else if @model.parentRow._parent.choices.models.length is 0
          htmlStr += """ from <button class="create-new-list choice-list-anchor">create a list</button>"""
        else
          htmlStr += """ from <span class="select-list choice-list-anchor missing">choose a list</span>"""

      @$el.html htmlStr

      typeSelectCb = (unused, entered)=>
        @model.set("value", entered)
      $sel = $("<select>", class: "inplace_field")
      $og = $("<optgroup>", label: "Field types")
      for [label, name] in type_select_options<commit_msg>fixes #9<commit_after>@DetailViewMixins = do ->
  VX = {}

  VX.label = VX.hint =
    html: ->
      """
      #{@model.key}: <code>#{@model.get("value")}</code>
      """
    afterRender: ->
      @$el.find("code").editInPlace
        save_if_nothing_changed: true
        callback: (uu, ent)=>
          @model.set("value", ent)
          if ent is "" then "..." else ent

  VX.name =
    html: ->
      """
      #{@model.key}: <code>#{@model.get("value")}</code>
      """
    afterRender: ->
      @$el.find("code").editInPlace
        save_if_nothing_changed: true
        callback: (uu, ent)=>
          cleanName = XLF.sluggify ent
          @model.set("value", cleanName)
          if ent is "" then "..." else cleanName

  VX.required =
    html: ->
      """<label><input type="checkbox"> Required?</label>"""
    afterRender: ->
      inp = @$el.find("input")
      inp.prop("checked", @model.get("value"))
      inp.change ()=> @model.set("value", inp.prop("checked"))

  type_select_options = XLF.lookupRowType.typeSelectList()
  VX.type =
    html: ->
      typeId = @model.get("typeId")
      htmlStr = """
      type: <span class="select-tp"><code>#{typeId}</code></span>
      """
      rtp = @model.get("rowType")
      if rtp.specifyChoice
        listName = @model.get("list")?.get("name")
        if listName
          htmlStr += """ from <span class="select-list choice-list-anchor"><code>#{listName}</code></span> <button class="edit-list" data-list-name="#{listName}">Edit</button>"""
        else if @model.parentRow._parent.choices.models.length is 0
          htmlStr += """ from <button class="create-new-list choice-list-anchor">create a list</button>"""
        else
          htmlStr += """ from <span class="select-list choice-list-anchor missing">choose a list</span>"""

      @$el.html htmlStr

      typeSelectCb = (unused, entered)=>
        @model.set("value", entered)
      $sel = $("<select>", class: "inplace_field")
      $og = $("<optgroup>", label: "Field types")
      for [label, name] in type_select_options
{'fraction_non_alphanumeric': 0.19407335438426038, 'fraction_numerical': 0.0007286859363614282, 'mean_word_length': 2.5561312607944733, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 73, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5345', 'n_tokens_mistral': 1355, 'n_tokens_neox': 1348, 'n_words': 252}