<commit_before>%div.new-record-form-container{ :class => record.errors.any? ? '' : 'hidden' }
  %div{ :style => 'display: none' }
    #help-generate=t :help_generate

  - if defined? GloboDns::Config::ENABLE_VIEW and GloboDns::Config::ENABLE_VIEW
    %i
      - unless @domain.view.nil?
        = t(:new_record_warning, name: @domain.name, view_name: @domain.view.name)

  = form_for([@domain, record], :remote => true, :html => {:id => 'new-record-form'}) do |f|

    - if record && record.errors.any?
      %ul.errors
      - record.errors.full_messages.each do |msg|
        %li= msg

    %table#new-record
      %tbody
        %tr
          %td= f.label :type, t(:label_domain_record_type)
          %td= f.select :type, Record::high_priority_types + (Record::record_types - ['SOA'] - Record::high_priority_types)
          %td= f.check_box :generate, {:id => 'generate_checkbox'}, true, false
          %td= help_icon('help-generate')
          %td= f.label :generate, t(:label_domain_record_generate)
        %tr{ style: "display: none;" }
          %td= f.label :tag, t(:label_domain_record_tag)
          %td= f.select :tag, Record::caa_tags
        %tr{ style: "display: none;" }
          %td= f.label :range, t(:label_domain_record_range)
          %td= f.text_field :range
        %tr
          %td= f.label :host, t(:label_domain_record_host)
          %td= f.text_field :name
        %tr
          %td= f.label :ttl, t(:label_domain_record_ttl)
          %td= f.text_field :ttl
        %tr
          %td= f.label :prio, t(:label_domain_record_priority)
          %td= f.text_field :prio
        %tr
          %td= f.label :weight, t(:label_domain_record_weight)
          %td= f.text_field :weight
        %tr
          %td= f.label :port, t(:label_domain_record_port)
          %td= f.text_field :port
        %tr
          %td= f.label :content, t(:label_domain_record_content)
          %td= f.text_field :content
        %tr.actions
          %td{:colspan => 2}
            = button_tag(t(:generic_cancel), :class => 'cancel-new-record-button ui-icon-ban-circle')
            = f.button(t(:generic_create),   :class => 'create-record-button ui-icon-download-alt')

:javascript
  - if current_user.admin?
    let showAlert = false;
  - else
    let showAlert = true;<commit_msg>Selection of subcomponent for new records<commit_after>%div.new-record-form-container{ :class => record.errors.any? ? '' : 'hidden' }
  %div{ :style => 'display: none' }
    #help-generate=t :help_generate

  - if defined? GloboDns::Config::ENABLE_VIEW and GloboDns::Config::ENABLE_VIEW
    %i
      - unless @domain.view.nil?
        = t(:new_record_warning, name: @domain.name, view_name: @domain.view.name)

  = form_for([@domain, record], :remote => true, :html => {:id => 'new-record-form'}) do |f|

    - if record && record.errors.any?
      %ul.errors
      - record.errors.full_messages.each do |msg|
        %li= msg

    %table#new-record
      %tbody
        %tr
          %td= f.label :type, t(:label_domain_record_type)
          %td= f.select :type, Record::high_priority_types + (Record::record_types - ['SOA'] - Record::high_priority_types)
          %td= f.check_box :generate, {:id => 'generate_checkbox'}, true, false
          %td= help_icon('help-generate')
          %td= f.label :generate, t(:label_domain_record_generate)
        %tr{ style: "display: none;" }
          %td= f.label :tag, t(:label_domain_record_tag)
          %td= f.select :tag, Record::caa_tags
        %tr{ style: "display: none;" }
          %td= f.label :range, t(:label_domain_record_range)
          %td= f.text_field :range
        %tr
          %td= f.label :host, t(:label_domain_record_host)
          %td= f.text_field :name
        %tr
          %td= f.label :ttl, t(:label_domain_record_ttl)
          %td= f.text_field :ttl
        %tr
          %td= f.label :prio, t(:label_domain_record_priority)
          %td= f.text_field :prio
        %tr
          %td= f.label :weight, t(:label_domain_record_weight)
          %td= f.text_field :weight
        %tr
          %td= f.label :port, t(:label_domain_record_port)
          %td= f.text_field :port
        %tr
          %td= f.label :content, t(:label_domain_record_content)
          %td= f.text_field :content
        - if GloboDns::Config::DOMAINS_OWNERSHIP
          %tr
            %td= label :sub_component, "Sub Component"
            %td= select_tag :sub_component, options_for_select(@sub_components, @domain_ownership_info[:sub_component_id]), {:required => true}
        %tfoot
        %tr.actions
          %td{:colspan => 2}
            = button_tag(t(:generic_cancel), :class => 'cancel-new-record-button ui-icon-ban-circle')
            = f.button(t(:generic_create),   :class => 'create-record-button ui-icon-download-alt')

:javascript
  - if current_user.admin?
    let showAlert = false;
  - else
    let showAlert = true;
{'fraction_non_alphanumeric': 0.14606741573033707, 'fraction_numerical': 0.00040858018386108274, 'mean_word_length': 2.509677419354839, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7127436', 'n_tokens_mistral': 1669, 'n_tokens_neox': 1648, 'n_words': 340}