<commit_before>class App.ControllerForm extends App.Controller
  constructor: (params) ->
    for key, value of params
      @[key] = value
    @attribute_count = 0

    @form = @formGen()
#    @log 'form', @form
    if @el
      @el.append( @form )

  html: =>
    @form.html()

  formGen: ->
    fieldset = $('<fieldset>')

    for attribute_clean in @model.configure_attributes
      attribute = _.clone( attribute_clean )

      if !attribute.readonly && ( !@required || @required && attribute[@required] )

        @attribute_count = @attribute_count + 1

        # add item
        item = @formGenItem( attribute, @model.className, fieldset )
        item.appendTo(fieldset)

        # if password, add confirm password item
        if attribute.type is 'password'

          attribute.display = attribute.display + ' (confirm)'
          attribute.name = attribute.name + '_confirm';

          item = @formGenItem( attribute, @model.className, fieldset )
          item.appendTo(fieldset)

    # return form
    return fieldset

  ###

  # input text field with max. 100 size
  attribute_config = {
    name:     'subject',
    display:  'Subject',
    tag:      'input',
    type:     'text',
    limit:    100,
    null:     false,
    default:  defaults['subject'],
    class:    'span7'
  }

  # colection as relation with auto completion
  attribute_config = {
    name:           'customer_id',
    display:        'Customer',
    tag:            'autocompletion',
    # auto completion params, endpoints, ui,...
    type:           'text',
    limit:          100,
    null:           false,<commit_msg>Also fill out _consfirm input box with existing value.<commit_after>class App.ControllerForm extends App.Controller
  constructor: (params) ->
    for key, value of params
      @[key] = value
    @attribute_count = 0

    @form = @formGen()
#    @log 'form', @form
    if @el
      @el.append( @form )

  html: =>
    @form.html()

  formGen: ->
    fieldset = $('<fieldset>')

    for attribute_clean in @model.configure_attributes
      attribute = _.clone( attribute_clean )

      if !attribute.readonly && ( !@required || @required && attribute[@required] )

        @attribute_count = @attribute_count + 1

        # add item
        item = @formGenItem( attribute, @model.className, fieldset )
        item.appendTo(fieldset)

        # if password, add confirm password item
        if attribute.type is 'password'

          # get existing value, if exists
          if @params
            if attribute.name of @params
              attribute.value = @params[attribute.name]

          # rename display and name to _confirm
          attribute.display = attribute.display + ' (confirm)'
          attribute.name = attribute.name + '_confirm';
          item = @formGenItem( attribute, @model.className, fieldset )
          item.appendTo(fieldset)

    # return form
    return fieldset

  ###

  # input text field with max. 100 size
  attribute_config = {
    name:     'subject',
    display:  'Subject',
    tag:      'input',
    type:     'text',
    limit:    100,
    null:     false,
    default:  defaults['subject'],
    class:    'span7'
  }

  # colection as relation with auto completion
  attribute_config = {
    name:           'customer_id',
    display:        'Customer',
    tag:            'autocompletion',
    # auto completion params, endpoints, ui,...
    type:           'text',
    limit:          100,
    null:           false,
{'fraction_non_alphanumeric': 0.11219512195121951, 'fraction_numerical': 0.006886657101865136, 'mean_word_length': 2.1320754716981134, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '7662914', 'n_tokens_mistral': 1024, 'n_tokens_neox': 970, 'n_words': 278}