<commit_before>class GroupGeneralSettingsView extends JView

  constructor: (options = {}, data) ->

    super options,data

    @setClass "general-settings-view group-admin-modal"

    formOptions = {}
    formOptions.callback = (formData) =>
      @saveSettings formData

    @createFormButtons formOptions
    @createFormFields  formOptions

    @settingsForm = new KDFormViewWithFields formOptions, @getData()

    # unless KD.config.roles? and 'owner' in KD.config.roles
    #   @settingsForm.buttons.Remove.hide()

    # if data.slug is 'koding'
    #   @settingsForm.buttons.Remove.hide()

  createFormFields: (formOptions) ->
    group = @getData()

    if group.slug isnt "koding"
      formOptions.fields      = {}
      formOptions.fields.Logo =
        label                 : "Logo"
        itemClass             : GroupLogoSettings

    formOptions.fields.Title  =
      label                   : "Group Name"
      name                    : "title"
      defaultValue            : Encoder.htmlDecode group.title ? ""
      placeholder             : 'Please enter a title here'

    formOptions.fields.Description =
      label                   : "Description"
      type                    : "textarea"
      name                    : "body"
      defaultValue            : Encoder.htmlDecode group.body ? ""
      placeholder             : 'Please enter a description here.'
      autogrow                : yes

    formOptions.fields["Visibility settings"] =
      itemClass               : KDSelectBox
      label                   : "Visibility"
      type                    : "select"
      name                    : "visibility"
      defaultValue            : group.visibility ? "visible"
      selectOptions           : [
        { title : "Visible"   ,    value : "visible" }
        { title : "Hidden"    ,     value : "hidden" }
      ]

  createFormButtons: (formOptions) -><commit_msg>Groups: Fixed a bug where options is being undefined.<commit_after>class GroupGeneralSettingsView extends JView

  constructor: (options = {}, data) ->

    super options,data

    @setClass "general-settings-view group-admin-modal"

    formOptions = {}
    formOptions.callback = (formData) =>
      @saveSettings formData

    @createFormButtons formOptions
    @createFormFields  formOptions

    @settingsForm = new KDFormViewWithFields formOptions, @getData()

    # unless KD.config.roles? and 'owner' in KD.config.roles
    #   @settingsForm.buttons.Remove.hide()

    # if data.slug is 'koding'
    #   @settingsForm.buttons.Remove.hide()

  createFormFields: (formOptions) ->
    group = @getData()
    formOptions.fields = {}

    if group.slug isnt "koding"
      formOptions.fields.Logo =
        label                 : "Logo"
        itemClass             : GroupLogoSettings

    formOptions.fields.Title  =
      label                   : "Group Name"
      name                    : "title"
      defaultValue            : Encoder.htmlDecode group.title ? ""
      placeholder             : 'Please enter a title here'

    formOptions.fields.Description =
      label                   : "Description"
      type                    : "textarea"
      name                    : "body"
      defaultValue            : Encoder.htmlDecode group.body ? ""
      placeholder             : 'Please enter a description here.'
      autogrow                : yes

    formOptions.fields["Visibility settings"] =
      itemClass               : KDSelectBox
      label                   : "Visibility"
      type                    : "select"
      name                    : "visibility"
      defaultValue            : group.visibility ? "visible"
      selectOptions           : [
        { title : "Visible"   ,    value : "visible" }
        { title : "Hidden"    ,     value : "hidden" }
      ]

  createFormButtons: (formOptions) ->
{'fraction_non_alphanumeric': 0.0911208904996117, 'fraction_numerical': 0.0, 'mean_word_length': 1.6411483253588517, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3131726', 'n_tokens_mistral': 1022, 'n_tokens_neox': 972, 'n_words': 226}