<commit_before>= content_for :title do
  Reduce Quota: #{t("resource_management.#{@resource.service_type}")} &gt; #{userfriendly_resource_name(@resource)}

=simple_form_for @resource, url: resources_reduce_quota_path(service: @resource.service_type, resource: @resource.name), method: :post, remote: request.xhr?, html: { data: { modal: true } }, wrapper: :horizontal_form do |f|

  %div{class: modal? ? 'modal-body' : ''}

    - unless @resource.errors.empty?
      %p.alert.alert-error= @resource.errors.full_messages.to_sentence

    %fieldset
      - if @resource.data_type.to_sym == :number
        = f.input :quota,
            label: 'Reduce your quota to',
            input_html: { value: @resource.usage},
            icon_hint:  "Your current quota is #{@resource.quota} and you are using #{@resource.usage} #{userfriendly_resource_name(@resource)} in your project"
      - else
        - current_value = @resource.data_type.format(@resource.usage)
        - previous_value = params[:new_style_resource] ? params[:new_style_resource][:quota] : nil
        = f.input :quota,
          label: 'Reduce your quota to',
          as: :string,
          input_html: { value: previous_value || current_value },
          icon_hint:  "Your current quota is #{@resource.data_type.format(@resource.quota)} and you are using #{current_value} of #{userfriendly_resource_name(@resource)} in your project"

  .buttons{class: modal? ? 'modal-footer' : ''}
    - if modal?<commit_msg>adjustments for better code reading<commit_after>= content_for :title do
  Reduce Quota: #{t("resource_management.#{@resource.service_type}")} &gt; #{userfriendly_resource_name(@resource)}

=simple_form_for @resource, url: resources_reduce_quota_path(service: @resource.service_type, resource: @resource.name), method: :post, remote: request.xhr?, html: { data: { modal: true } }, wrapper: :horizontal_form do |f|

  %div{class: modal? ? 'modal-body' : ''}

    - unless @resource.errors.empty?
      %p.alert.alert-error= @resource.errors.full_messages.to_sentence

    %fieldset
      - if @resource.data_type.to_sym == :number
        = f.input :quota,
            label: 'Reduce your quota to',
            input_html: { value: @resource.usage},
            icon_hint:  "Your current quota is #{@resource.quota} and you are using #{@resource.usage} #{userfriendly_resource_name(@resource)} in your project"
      - else
        - current_usage = @resource.data_type.format(@resource.usage)
        - previous_value = params[:new_style_resource] ? params[:new_style_resource][:quota] : nil
        = f.input :quota,
          label: 'Reduce your quota to',
          as: :string,
          input_html: { value: previous_value || current_usage },
          icon_hint:  "Your current quota is #{@resource.data_type.format(@resource.quota)} and you are using #{current_usage} of #{userfriendly_resource_name(@resource)} in your project"

  .buttons{class: modal? ? 'modal-footer' : ''}
    - if modal?
{'fraction_non_alphanumeric': 0.13758389261744966, 'fraction_numerical': 0.0, 'mean_word_length': 3.6651017214397497, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5634099', 'n_tokens_mistral': 918, 'n_tokens_neox': 903, 'n_words': 213}