<commit_before>FullPageFormView = OrchestraView.extend(
  el: '#content'

  initialize: (options) ->
    @options = options
    @options.cid = @cid
    @element = options.element
    @title = options.title
    @listUrl = options.listUrl
    @completeOptions(@element) if @element != undefined
    @events = {}
    if options.triggers
      for i of options.triggers
        @events[options.triggers[i].event] = options.triggers[i].name
        eval "this." + options.triggers[i].name + " = options.triggers[i].fct"
    @loadTemplates [
      'fullPageFormView',
      'elementTitle'
    ]
    if options.multiVersion
      @options.title = @renderTemplate('elementTitle',
        element: options.element
      )
    return

  render: ->
    $(@el).html(@renderTemplate('fullPageFormView', @options))
    $('.js-widget-title', @$el).html $('#generated-title', @$el).html()
    @addEventOnForm()
    @addSelect2OnForm()
    @addColorPickerOnForm()
    $("[data-prototype]", @$el).each ->
      PO.formPrototypes.addPrototype $(this)
      return
    return

  addSelect2OnForm: ->
    if $(".select2", @$el).length > 0
      activateSelect2($(".select2", @$el))

  addColorPickerOnForm: ->
    if $(".colorpicker", @$el).length > 0
      activateColorPicker()

  addEventOnForm: ->
    options = @options
    $("form", @$el).on "submit", (e) ->
      e.preventDefault()
      $(this).ajaxSubmit
        success: (response) ->
          options.html = response
          view = new FullPageFormView(options)
      return

  changeLanguage: (event) ->
    event.preventDefault()
    language = $(event.currentTarget).data('language')
    link = @element.get('links')._self_without_parameters + '?language=' + language
    tableViewLoadSpecificElement(link, @title, @listUrl)

  changeVersion: (event) ->
    event.preventDefault()
    version = event.currentTarget.value
    link = @element.get('links')._self_without_parameters + '?language=' + @element.get('language') + '&version=' + version
    tableViewLoadSpecificElement(link, @title, @listUrl)<commit_msg>accept error on forms and display them<commit_after>FullPageFormView = OrchestraView.extend(
  el: '#content'

  initialize: (options) ->
    @options = options
    @options.cid = @cid
    @element = options.element
    @title = options.title
    @listUrl = options.listUrl
    @completeOptions(@element) if @element != undefined
    @events = {}
    if options.triggers
      for i of options.triggers
        @events[options.triggers[i].event] = options.triggers[i].name
        eval "this." + options.triggers[i].name + " = options.triggers[i].fct"
    @loadTemplates [
      'fullPageFormView',
      'elementTitle'
    ]
    if options.multiVersion
      @options.title = @renderTemplate('elementTitle',
        element: options.element
      )
    return

  render: ->
    $(@el).html(@renderTemplate('fullPageFormView', @options))
    $('.js-widget-title', @$el).html $('#generated-title', @$el).html()
    @addEventOnForm()
    @addSelect2OnForm()
    @addColorPickerOnForm()
    $("[data-prototype]", @$el).each ->
      PO.formPrototypes.addPrototype $(this)
      return
    return

  addSelect2OnForm: ->
    if $(".select2", @$el).length > 0
      activateSelect2($(".select2", @$el))

  addColorPickerOnForm: ->
    if $(".colorpicker", @$el).length > 0
      activateColorPicker()

  addEventOnForm: ->
    options = @options
    $("form", @$el).on "submit", (e) ->
      e.preventDefault()
      $(this).ajaxSubmit
        success: (response) ->
          options.html = response
          view = new FullPageFormView(options)
        error: (response) ->
          options.html = response.responseText
          view = new FullPageFormView(options)
      return

  changeLanguage: (event) ->
    event.preventDefault()
    language = $(event.currentTarget).data('language')
    link = @element.get('links')._self_without_parameters + '?language=' + language
    tableViewLoadSpecificElement(link, @title, @listUrl)

  changeVersion: (event) ->
    event.preventDefault()
    version = event.currentTarget.value
    link = @element.get('links')._self_without_parameters + '?language=' + @element.get('language') + '&version=' + version
    tableViewLoadSpecificElement(link, @title, @listUrl)
{'fraction_non_alphanumeric': 0.15299906279287723, 'fraction_numerical': 0.0032802249297094657, 'mean_word_length': 3.1689453125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 28, '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': '7589274', 'n_tokens_mistral': 1299, 'n_tokens_neox': 1287, 'n_words': 242}