<commit_before>module RapidFTR

  module FormSectionSetup

    def self.reset_definitions
      FormSection.all.each { |f| f.destroy }

      basic_identity_fields = [
        Field.new({"name" => "name",
                  "type" => "text_field", "editable" => false,
                  "highlight_information"=>HighlightInformation.new("highlighted"=>true,"order"=>1),
                  "display_name_all" => "Name"
                  }),
        Field.new({"name" => "protection_status",
                  "type" => "select_box",
                  "option_strings_text_all" => "Unaccompanied\nSeparated",
                  "highlight_information" => HighlightInformation.new("highlighted" => true,"order"=>3),
                  "display_name_all" => "Protection Status",
                  "help_text_all" => "A separated child is any person under the age of 18, separated from both parents or from his/her previous legal or customary primary care giver, but not necessarily from other relatives. An unaccompanied child is any person who meets those criteria but is ALSO separated from his/her relatives.",
                  }),
        Field.new({"name" => "ftr_status",
                  "type" => "select_box",
                  "option_strings_text" => "Identified\nVerified\nTracing On-Going\nFamily Located Cross-Border FR Pending\nFamily Located Inter-Camp FR Pending\nReunited\nExported to CPIMS\nRecord Invalid",
                  "highlight_information" => HighlightInformation.new("highlighted" => true,"order"=>4),
                  "display_name_all" => "FTR Status"
                  }),
        Field.new({"name" => "why_record_invalid",
                  "type" => "text_field",
                  "display_name_all" => "If 'Record Invalid', explain why?"
                  }),
        Field.new({"name" => "id_document",
                  "type" => "text_field",
                  "display_name_all" => "UNHCR No."
                  }),
        Field.new({"name" => "rc_id_no",
                  "type" => "text_field",
                  "highlight_information"=>HighlightInformation.new("highlighted"=>true,"order"=>2),
                  "display_name_all" => "RC ID No."
                  }),
        Field.new({"name" => "icrc_ref_no",
                  "type" => "text_field",
                  "display_name_all" => "ICRC Ref No."
                  }),
        Field.new({"name" => "gender",
                  "type" => "select_box",
                  "option_strings_text_all" => "Male\nFemale",
                  "display_name_all" => "Sex"
                  }),
        Field.new({"name" => "nick_name",
                  "type" => "text_field",
                  "display_name_all" => "Also Known As (nickname)"
                  }),
        Field.new({"name" => "names_origin",
                  "type" => "select_box",
                  "option_strings_text_all" => "Yes\nNo",
                  "display_name_all" => "Name(s) given to child after separation?"
                  }),
        Field.new({"name" => "date_of_birth",
                  "type" => "date_field",
                  "display_name_all" => "Date of Birth (dd/mm/yyyy)"
                  }),
        Field.new({"name" => "birthplace",
                  "type" => "text_field",
                  "display_name_all" => "Birthplace"
                  }),
        Field.new({"name" => "nationality",
                  "type" => "text_field",
                  "display_name_all" => "Nationality"
                  }),
        Field.new({"name" => "ethnicity_or_tribe",
                  "type" => "text_field",
                  "display_name_all" => "Ethnic group / tribe"
                  }),
        Field.new({"name" => "languages",
                  "type" => "text_field",
                  "display_name_all" => "Languages spoken"
                  }),
        Field.new({"name" => "characteristics",
                  "type" => "textarea",
                  "display_name_all" => "Distinguishing Physical Characteristics"
                  }),
        Field.new({"name" => "documents",
                  "type" => "text_field",
                  "display_name_all" => "Documents carried by the child"
                  }),
      ]
      FormSection.create!({"visible"=>true,
                          :order=> 1, :unique_id=>"basic_identity", "editable"=>true,
                          :fields => basic_identity_fields, :perm_enabled => true,
                          "name_all" => "Basic Identity",
                          "description_all" => "Basic identity information about a separated or unaccompanied child."
                          }
      )

      photo_audio_fields = [
          Field.new({"name" => "current_photo_key",
                    "type" => "photo_upload_box", "editable" => false,
                    "display_name_all" => "Current Photo Key"
                    }),
          Field.new({"name" => "recorded_audio",<commit_msg>rapidftr/tracker#40 @andreweskeclarke @austiine04 Making Name field and Basic Identity Form editable<commit_after>module RapidFTR

  module FormSectionSetup

    def self.reset_definitions
      FormSection.all.each { |f| f.destroy }

      basic_identity_fields = [
        Field.new({"name" => "name",
                  "type" => "text_field",
                  "highlight_information"=>HighlightInformation.new("highlighted"=>true,"order"=>1),
                  "display_name_all" => "Name"
                  }),
        Field.new({"name" => "protection_status",
                  "type" => "select_box",
                  "option_strings_text_all" => "Unaccompanied\nSeparated",
                  "highlight_information" => HighlightInformation.new("highlighted" => true,"order"=>3),
                  "display_name_all" => "Protection Status",
                  "help_text_all" => "A separated child is any person under the age of 18, separated from both parents or from his/her previous legal or customary primary care giver, but not necessarily from other relatives. An unaccompanied child is any person who meets those criteria but is ALSO separated from his/her relatives.",
                  }),
        Field.new({"name" => "ftr_status",
                  "type" => "select_box",
                  "option_strings_text" => "Identified\nVerified\nTracing On-Going\nFamily Located Cross-Border FR Pending\nFamily Located Inter-Camp FR Pending\nReunited\nExported to CPIMS\nRecord Invalid",
                  "highlight_information" => HighlightInformation.new("highlighted" => true,"order"=>4),
                  "display_name_all" => "FTR Status"
                  }),
        Field.new({"name" => "why_record_invalid",
                  "type" => "text_field",
                  "display_name_all" => "If 'Record Invalid', explain why?"
                  }),
        Field.new({"name" => "id_document",
                  "type" => "text_field",
                  "display_name_all" => "UNHCR No."
                  }),
        Field.new({"name" => "rc_id_no",
                  "type" => "text_field",
                  "highlight_information"=>HighlightInformation.new("highlighted"=>true,"order"=>2),
                  "display_name_all" => "RC ID No."
                  }),
        Field.new({"name" => "icrc_ref_no",
                  "type" => "text_field",
                  "display_name_all" => "ICRC Ref No."
                  }),
        Field.new({"name" => "gender",
                  "type" => "select_box",
                  "option_strings_text_all" => "Male\nFemale",
                  "display_name_all" => "Sex"
                  }),
        Field.new({"name" => "nick_name",
                  "type" => "text_field",
                  "display_name_all" => "Also Known As (nickname)"
                  }),
        Field.new({"name" => "names_origin",
                  "type" => "select_box",
                  "option_strings_text_all" => "Yes\nNo",
                  "display_name_all" => "Name(s) given to child after separation?"
                  }),
        Field.new({"name" => "date_of_birth",
                  "type" => "date_field",
                  "display_name_all" => "Date of Birth (dd/mm/yyyy)"
                  }),
        Field.new({"name" => "birthplace",
                  "type" => "text_field",
                  "display_name_all" => "Birthplace"
                  }),
        Field.new({"name" => "nationality",
                  "type" => "text_field",
                  "display_name_all" => "Nationality"
                  }),
        Field.new({"name" => "ethnicity_or_tribe",
                  "type" => "text_field",
                  "display_name_all" => "Ethnic group / tribe"
                  }),
        Field.new({"name" => "languages",
                  "type" => "text_field",
                  "display_name_all" => "Languages spoken"
                  }),
        Field.new({"name" => "characteristics",
                  "type" => "textarea",
                  "display_name_all" => "Distinguishing Physical Characteristics"
                  }),
        Field.new({"name" => "documents",
                  "type" => "text_field",
                  "display_name_all" => "Documents carried by the child"
                  }),
      ]
      FormSection.create!({"visible"=>true,
                          :order=> 1, :unique_id=>"basic_identity", "editable"=>true,
                          :fields => basic_identity_fields,
                          "name_all" => "Basic Identity",
                          "description_all" => "Basic identity information about a separated or unaccompanied child."
                          }
      )

      photo_audio_fields = [
          Field.new({"name" => "current_photo_key",
                    "type" => "photo_upload_box", "editable" => false,
                    "display_name_all" => "Current Photo Key"
                    }),
          Field.new({"name" => "recorded_audio",
{'fraction_non_alphanumeric': 0.13855119059580026, 'fraction_numerical': 0.0018084999497638902, 'mean_word_length': 1.645933014354067, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 165, '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': '4721015', 'n_tokens_mistral': 2842, 'n_tokens_neox': 2631, 'n_words': 519}