<commit_before>- url = url_for(:action => 'dialog_field_changed', :id => @edit[:rec_id] || "new") if @edit
- dialog_mode = @edit[:dialog_mode] if @edit
- edit = case dialog_mode
- when :reconfigure then field.reconfigurable
- when :review      then false
- else                   !@edit.nil?
%tr{:id => "field_#{field.id}_tr"}
  %td.key{:title => field.description}
    = field.label
  %td{:title => field.description}
    - locals = {:edit => edit, :field => field, :url => url}
    - case field.type
      - when 'DialogFieldTextBox'
        = render(:partial => "shared/dialogs/dialog_field_text_box", :locals => locals)

      - when 'DialogFieldTextAreaBox'
        = render(:partial => "shared/dialogs/dialog_field_text_area_box", :locals => locals)

      - when 'DialogFieldCheckBox'
        = render(:partial => "shared/dialogs/dialog_field_check_box", :locals => locals)

      - when 'DialogFieldDateControl', 'DialogFieldDateTimeControl'
        = render(:partial => "shared/dialogs/dialog_field_date_and_date_time_control.haml", :locals => locals)

      - when "DialogFieldRadioButton"
        = render(:partial => "shared/dialogs/dialog_field_radio_button", :locals => locals)

      - when "DialogFieldDropDownList"
        = render(:partial => "shared/dialogs/dialog_field_drop_down_list", :locals => locals)

      - when 'DialogFieldButton'
        = button_tag(_("Save"), :class => edit ? 'btn btn-primary' : 'btn btn-primary btn-disabled')

      - when 'DialogFieldTagControl'
        - category_tags = DialogFieldTagControl.category_tags(field.category).map { |cat| [cat[:description], cat[:id]] }
        - if edit
          - if field.single_value?
            - select_values = dialog_dropdown_select_values(field, wf.value(field.name), category_tags)
            = select_tag(field.name, options_for_select(select_values, wf.value(field.name)),
                         "data-miq_sparkle_on"  => true,
                         "data-miq_sparkle_off" => true,
                         "data-miq_observe"     => {:url => url}.to_json)
          - else
            = select_tag(field.name, options_for_select(category_tags, wf.value(field.name)),
                         :multiple              => true,
                         "data-miq_sparkle_on"  => true,
                         "data-miq_sparkle_off" => true,
                         "data-miq_observe"     => {:url => url}.to_json)
        - else
          - value = wf.value(field.name) || ''
          - classification_ids = value.split(',')
          = h(Classification.where(:id => classification_ids).collect(&:description).join(', '))
<commit_msg>Make DialogFieldTagControl respect read_only mode<commit_after>- url = url_for(:action => 'dialog_field_changed', :id => @edit[:rec_id] || "new") if @edit
- dialog_mode = @edit[:dialog_mode] if @edit
- edit = case dialog_mode
- when :reconfigure then field.reconfigurable
- when :review      then false
- else                   !@edit.nil?
%tr{:id => "field_#{field.id}_tr"}
  %td.key{:title => field.description}
    = field.label
  %td{:title => field.description}
    - locals = {:edit => edit, :field => field, :url => url}
    - case field.type
      - when 'DialogFieldTextBox'
        = render(:partial => "shared/dialogs/dialog_field_text_box", :locals => locals)

      - when 'DialogFieldTextAreaBox'
        = render(:partial => "shared/dialogs/dialog_field_text_area_box", :locals => locals)

      - when 'DialogFieldCheckBox'
        = render(:partial => "shared/dialogs/dialog_field_check_box", :locals => locals)

      - when 'DialogFieldDateControl', 'DialogFieldDateTimeControl'
        = render(:partial => "shared/dialogs/dialog_field_date_and_date_time_control.haml", :locals => locals)

      - when "DialogFieldRadioButton"
        = render(:partial => "shared/dialogs/dialog_field_radio_button", :locals => locals)

      - when "DialogFieldDropDownList"
        = render(:partial => "shared/dialogs/dialog_field_drop_down_list", :locals => locals)

      - when 'DialogFieldButton'
        = button_tag(_("Save"), :class => edit ? 'btn btn-primary' : 'btn btn-primary btn-disabled')

      - when 'DialogFieldTagControl'
        - category_tags = DialogFieldTagControl.category_tags(field.category).map { |cat| [cat[:description], cat[:id]] }
        - if edit
          - if field.single_value?
            - select_values = dialog_dropdown_select_values(field, wf.value(field.name), category_tags)
            = select_tag(field.name,
                         options_for_select(select_values, wf.value(field.name)),
                         drop_down_options(field, url))
          - else
            = select_tag(field.name,
                         options_for_select(category_tags, wf.value(field.name)),
                         drop_down_options(field, url).merge(:multiple => true))

        - else
          - value = wf.value(field.name) || ''
          - classification_ids = value.split(',')
          = h(Classification.where(:id => classification_ids).collect(&:description).join(', '))

{'fraction_non_alphanumeric': 0.13938795656465944, 'fraction_numerical': 0.0, 'mean_word_length': 2.681686046511628, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 57, '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': '6435480', 'n_tokens_mistral': 1532, 'n_tokens_neox': 1495, 'n_words': 261}