- url = url_for_only_path(:action => 'tag_edit_form_field_changed', :id => @sb[:rec_id] || @edit[:object_ids][0])
#tab_div
  %h3
    - if @tagitems.length > 1
      = _("Tag Assignment (Tags common to all selected items)")
    - else
      = _("Tag Assignment")
  %table.table.table-bordered{:style => "margin-bottom: 0;"}
    %thead
      %tr
        %th
          = _("Select a customer tag to assign:")
        %th
          - @categories.each do |cat_key, _|
            - if session[:assigned_filters].include?(cat_key.downcase)
              - @categories.delete(cat_key)
          = select_tag("tag_cat",
            options_for_select(@categories.sort_by{|key, _| key.downcase}, @edit[:cat].name),
            "data-miq_observe"     => {:url => url}.to_json,
            "data-live-search"     => "true",
            "data-container"       => "body",
            "class"                => "selectpicker")
          :javascript
            miqInitSelectPicker();
            miqSelectPickerEvent("tag_cat", "#{url}", {beforeSend: true, complete: true});
        %th
          = render :partial => "layouts/tag_edit_cat_tags"
  = render :partial => 'layouts/tag_edit_assignments', :locals => {:entry => nil}
  %br
  = _("* Only a single value can be assigned from these categories")

- url = url_for_only_path(:action => 'tag_edit_form_field_changed', :id => @sb[:rec_id] || @edit[:object_ids][0])
#tab_div
  %h3
    - if @tagitems.length > 1
      = _("Tag Assignment (Tags common to all selected items)")
    - else
      = _("Tag Assignment")
  %table.table.table-bordered{:style => "margin-bottom: 0;"}
    %thead
      %tr
        %th
          = _("Select a customer tag to assign:")
        %th
          - @categories.each do |cat_key, _|
            - if session[:assigned_filters].include?(cat_key.downcase)
              - @categories.delete(cat_key)
          = select_tag("tag_cat",
            options_for_select(@categories, @edit[:cat].name),
            "data-miq_observe"     => {:url => url}.to_json,
            "data-live-search"     => "true",
            "data-container"       => "body",
            "class"                => "selectpicker")
          :javascript
            miqInitSelectPicker();
            miqSelectPickerEvent("tag_cat", "#{url}", {beforeSend: true, complete: true});
        %th
          = render :partial => "layouts/tag_edit_cat_tags"
  = render :partial => 'layouts/tag_edit_assignments', :locals => {:entry => nil}
  %br
  = _("* Only a single value can be assigned from these categories")

Remove sorting of the array with categories for assigning tags from haml
Remove sorting of the array with categories for assigning tags from haml

Remove sorting of the array with categories for assigning tags from haml
as it no longer makes sense to be there because proper sorting is already
implemented in tag_edit_build_screen method.
