<commit_before>#event_details_div
  - if @event
    #event_info_div
      = render :partial => "layouts/flash_msg"
      %h3= _("Basic Information")
      .form-horizontal.static
        - if false
          -# Don't show description (event descriptions can not be edited)
          .form-group
            %label.control-label.col-md-2= _("Description")
            .col-md-10
              %p.form-control-static
                %img{:src => image_path("100/event-#{h(@event.name)}.png")}
                = h(@event.description)
        .form-group
          %label.control-label.col-md-2= _("Event Group")
          .col-md-10
            %p.form-control-static= h(@event.memberof.first.description)
        - unless x_active_tree == :event_tree
          .form-group
            %label.control-label.col-md-2= _("Attached to Policy")
            .col-md-10
              %p.form-control-static= h(@policy.description)
      %hr

      - if x_active_tree == :event_tree
        %h3= _("Assigned to Policies")
        - if @event_policies.empty?
          = render :partial => 'layouts/info_msg', :locals => {:message => _("This Event is not assigned to any Policies.")}
        - else
          %table.table.table-striped.table-bordered.table-hover
            %tbody
              - @event_policies.each do |p|
                - id = "xx-#{p.mode.downcase}_xx-#{p.mode.downcase}-#{p.towhat.downcase}_p-#{to_cid(p.id)}"
                %tr{:title => _("Click to view Policy"),
                  :onclick => remote_function(:url => "/miq_policy/x_show/#{id}?accord=policy")}
                  %td.narrow
                    %img{:src => image_path("100/miq_policy_#{p.towhat.downcase}#{p.active ? '' : '_inactive'}.png")}
                  %td
                    = p.description
          %hr
      - else
        %h3= _("Order of Actions if ALL Conditions are True")
        - if @edit
          %table.admintable
            %tbody
              %tr
                %td
                  %table#formtest.form{:width => "100%"}
                    %tr
                      %td{:align => "left"}= _('Available Actions:')
                      %td
                      %td.widthed{:align => "left"}= _(' Selected Actions:')
                    %tr
                      %td.widthed{:align => "left", :valign => "top"}
                        %span#choices_chosen_true_div
                          = select_tag('choices_chosen_true[]',
                            options_for_select(@edit[:choices_true].sort),
                            :multiple => true,
                            :class    => "widthed",
                            :size     => 8,
                            :id       => "choices_chosen_true")
                        %p
                      %td{:width => "20", :valign => "middle"}
                        - t = _("Move selected Actions into this Event")
                        = link_to(image_tag(image_path('toolbars/right.png'), :class => "rollover small", :alt => t),
                          {:action => 'event_edit', :button => 'true_right', :id => @event},
                          "data-miq_sparkle_on"  => true,
                          "data-miq_sparkle_off" => true,
                          "data-submit"          => 'choices_chosen_true_div',
                          :remote                => true,
                          "data-method"          => :post,
                          :title                 => t)
                        - t = _("Remove all Actions from this Event")
                        = link_to(image_tag(image_path('toolbars/allleft.png'), :class => "rollover small", :alt => t),
                          {:action => 'event_edit', :button => 'true_allleft', :id => @event},
                          "data-miq_sparkle_on"  => true,
                          "data-miq_sparkle_off" => true,
                          :remote                => true,
                          "data-method"          => :post,
                          :title                 => t)
                        - t = _("Remove selected Actions from this Event")
                        = link_to(image_tag(image_path('toolbars/left.png'), :class => "rollover small", :alt => t),
                          {:action => 'event_edit', :button => 'true_left', :id => @event},
                          "data-miq_sparkle_on"  => true,
                          "data-miq_sparkle_off" => true,
                          "data-submit"          => 'members_chosen_true_div',
                          :remote                => true,
                          "data-method"          => :post,
                          :title                 => t)
                      %td{:align => "right", :valign => "top"}
                        %span#members_chosen_true_div
                          = select_tag('members_chosen_true[]',
                            options_for_select(@edit[:new][:actions_true], @true_selected),
                            :multiple => true,
                            :class    => "widthed",
                            :size     => 8,
                            :id       => "members_chosen_true")
                      %td{:width => "20", :valign => "middle"}
                        - t = _("Move selected Action up")
                        = link_to(image_tag(image_path('toolbars/up.png'), :class => "rollover small", :alt => t),
                          {:action => 'event_edit', :button  => 'true_up', :id => @event},
                          "data-miq_sparkle_on"  => true,
                          "data-miq_sparkle_off" => true,
                          "data-submit"          => 'members_chosen_true_div',
                          :remote                => true,
                          "data-method"          => :post,
                          :title                 => t)
                        - t = _("Move selected Action down")
                        = link_to(image_tag(image_path('toolbars/down.png'), :class => "rollover small", :alt => t),
                          {:action => 'event_edit', :button => 'true_down', :id => @event},
                          "data-miq_sparkle_on"  => true,
                          "data-miq_sparkle_off" => true,
                          "data-submit"          => 'members_chosen_true_div',
                          :remote                => true,
                          "data-method"          => :post,
                          :title                 => t)
                        - t = _("Set selected Actions to Synchronous")
                        = link_to(image_tag(image_path('toolbars/syncr.png'), :class => "rollover small", :alt => t),
                          {:action => 'event_edit', :button => 'true_sync', :id => @event},
                          "data-miq_sparkle_on"  => true,
                          "data-miq_sparkle_off" => true,
                          "data-submit"          => 'members_chosen_true_div',
                          :remote                => true,
                          "data-method"          => :post,
                          :title                 => t)
                        - t = _("Set selected Actions to Asynchronous")
                        = link_to(image_tag(image_path('toolbars/asyncr.png'), :class => "rollover small", :alt => t),
                          {:action => 'event_edit', :button => 'true_async', :id => @event},
                          "data-miq_sparkle_on"  => true,
                          "data-miq_sparkle_off" => true,
                          "data-submit"          => 'members_chosen_true_div',
                          :remote                => true,
                          "data-method"          => :post,
                          :title                 => t)
          %hr
        - else
          - if @event_true_actions.empty?
            = render :partial => 'layouts/info_msg', :locals => {:message => _("This Event has no true Actions.")}
          - else
            %table.table.table-striped.table-bordered.table-hover
              %thead
                %tr
                  %th.narrow
                  %th= _("Description")
                  %th= _("Synchronous")
                  %th= _("Type")
              %tbody
                - @event_true_actions.each do |a|
                  - id = "a-#{to_cid(a.id)}"
                  - t = remote_function(:url => "/miq_policy/x_show/#{id}?accord=action")
                  - f = "miqDynatreeActivateNode(#{x_active_tree}', '#{x_node}_#{id}');"
                  %tr{:title => _("View this Event Action"),
                    :onclick => (x_active_tree == :action_tree) ? t : f}
                    %td.narrow
                      %img{:src => image_path('100/check.png')}
                    %td
                      = a.description
                    %td
                      = a.v_synchronicity
                    %td
                      = a.action_type
          %hr

        %h3= _("Order of Actions if ANY Conditions are False")
        - if @edit
          %table.admintable
            %tbody
              %tr
                %td
                  %table#formtest.form{:width => "100%"}<commit_msg>Fixed a typo in the onclick link.<commit_after>#event_details_div
  - if @event
    #event_info_div
      = render :partial => "layouts/flash_msg"
      %h3= _("Basic Information")
      .form-horizontal.static
        - if false
          -# Don't show description (event descriptions can not be edited)
          .form-group
            %label.control-label.col-md-2= _("Description")
            .col-md-10
              %p.form-control-static
                %img{:src => image_path("100/event-#{h(@event.name)}.png")}
                = h(@event.description)
        .form-group
          %label.control-label.col-md-2= _("Event Group")
          .col-md-10
            %p.form-control-static= h(@event.memberof.first.description)
        - unless x_active_tree == :event_tree
          .form-group
            %label.control-label.col-md-2= _("Attached to Policy")
            .col-md-10
              %p.form-control-static= h(@policy.description)
      %hr

      - if x_active_tree == :event_tree
        %h3= _("Assigned to Policies")
        - if @event_policies.empty?
          = render :partial => 'layouts/info_msg', :locals => {:message => _("This Event is not assigned to any Policies.")}
        - else
          %table.table.table-striped.table-bordered.table-hover
            %tbody
              - @event_policies.each do |p|
                - id = "xx-#{p.mode.downcase}_xx-#{p.mode.downcase}-#{p.towhat.downcase}_p-#{to_cid(p.id)}"
                %tr{:title => _("Click to view Policy"),
                  :onclick => remote_function(:url => "/miq_policy/x_show/#{id}?accord=policy")}
                  %td.narrow
                    %img{:src => image_path("100/miq_policy_#{p.towhat.downcase}#{p.active ? '' : '_inactive'}.png")}
                  %td
                    = p.description
          %hr
      - else
        %h3= _("Order of Actions if ALL Conditions are True")
        - if @edit
          %table.admintable
            %tbody
              %tr
                %td
                  %table#formtest.form{:width => "100%"}
                    %tr
                      %td{:align => "left"}= _('Available Actions:')
                      %td
                      %td.widthed{:align => "left"}= _(' Selected Actions:')
                    %tr
                      %td.widthed{:align => "left", :valign => "top"}
                        %span#choices_chosen_true_div
                          = select_tag('choices_chosen_true[]',
                            options_for_select(@edit[:choices_true].sort),
                            :multiple => true,
                            :class    => "widthed",
                            :size     => 8,
                            :id       => "choices_chosen_true")
                        %p
                      %td{:width => "20", :valign => "middle"}
                        - t = _("Move selected Actions into this Event")
                        = link_to(image_tag(image_path('toolbars/right.png'), :class => "rollover small", :alt => t),
                          {:action => 'event_edit', :button => 'true_right', :id => @event},
                          "data-miq_sparkle_on"  => true,
                          "data-miq_sparkle_off" => true,
                          "data-submit"          => 'choices_chosen_true_div',
                          :remote                => true,
                          "data-method"          => :post,
                          :title                 => t)
                        - t = _("Remove all Actions from this Event")
                        = link_to(image_tag(image_path('toolbars/allleft.png'), :class => "rollover small", :alt => t),
                          {:action => 'event_edit', :button => 'true_allleft', :id => @event},
                          "data-miq_sparkle_on"  => true,
                          "data-miq_sparkle_off" => true,
                          :remote                => true,
                          "data-method"          => :post,
                          :title                 => t)
                        - t = _("Remove selected Actions from this Event")
                        = link_to(image_tag(image_path('toolbars/left.png'), :class => "rollover small", :alt => t),
                          {:action => 'event_edit', :button => 'true_left', :id => @event},
                          "data-miq_sparkle_on"  => true,
                          "data-miq_sparkle_off" => true,
                          "data-submit"          => 'members_chosen_true_div',
                          :remote                => true,
                          "data-method"          => :post,
                          :title                 => t)
                      %td{:align => "right", :valign => "top"}
                        %span#members_chosen_true_div
                          = select_tag('members_chosen_true[]',
                            options_for_select(@edit[:new][:actions_true], @true_selected),
                            :multiple => true,
                            :class    => "widthed",
                            :size     => 8,
                            :id       => "members_chosen_true")
                      %td{:width => "20", :valign => "middle"}
                        - t = _("Move selected Action up")
                        = link_to(image_tag(image_path('toolbars/up.png'), :class => "rollover small", :alt => t),
                          {:action => 'event_edit', :button  => 'true_up', :id => @event},
                          "data-miq_sparkle_on"  => true,
                          "data-miq_sparkle_off" => true,
                          "data-submit"          => 'members_chosen_true_div',
                          :remote                => true,
                          "data-method"          => :post,
                          :title                 => t)
                        - t = _("Move selected Action down")
                        = link_to(image_tag(image_path('toolbars/down.png'), :class => "rollover small", :alt => t),
                          {:action => 'event_edit', :button => 'true_down', :id => @event},
                          "data-miq_sparkle_on"  => true,
                          "data-miq_sparkle_off" => true,
                          "data-submit"          => 'members_chosen_true_div',
                          :remote                => true,
                          "data-method"          => :post,
                          :title                 => t)
                        - t = _("Set selected Actions to Synchronous")
                        = link_to(image_tag(image_path('toolbars/syncr.png'), :class => "rollover small", :alt => t),
                          {:action => 'event_edit', :button => 'true_sync', :id => @event},
                          "data-miq_sparkle_on"  => true,
                          "data-miq_sparkle_off" => true,
                          "data-submit"          => 'members_chosen_true_div',
                          :remote                => true,
                          "data-method"          => :post,
                          :title                 => t)
                        - t = _("Set selected Actions to Asynchronous")
                        = link_to(image_tag(image_path('toolbars/asyncr.png'), :class => "rollover small", :alt => t),
                          {:action => 'event_edit', :button => 'true_async', :id => @event},
                          "data-miq_sparkle_on"  => true,
                          "data-miq_sparkle_off" => true,
                          "data-submit"          => 'members_chosen_true_div',
                          :remote                => true,
                          "data-method"          => :post,
                          :title                 => t)
          %hr
        - else
          - if @event_true_actions.empty?
            = render :partial => 'layouts/info_msg', :locals => {:message => _("This Event has no true Actions.")}
          - else
            %table.table.table-striped.table-bordered.table-hover
              %thead
                %tr
                  %th.narrow
                  %th= _("Description")
                  %th= _("Synchronous")
                  %th= _("Type")
              %tbody
                - @event_true_actions.each do |a|
                  - id = "a-#{to_cid(a.id)}"
                  - t = remote_function(:url => "/miq_policy/x_show/#{id}?accord=action")
                  - f = "miqDynatreeActivateNode('#{x_active_tree}', '#{x_node}_#{id}');"
                  %tr{:title => _("View this Event Action"),
                    :onclick => (x_active_tree == :action_tree) ? t : f}
                    %td.narrow
                      %img{:src => image_path('100/check.png')}
                    %td
                      = a.description
                    %td
                      = a.v_synchronicity
                    %td
                      = a.action_type
          %hr

        %h3= _("Order of Actions if ANY Conditions are False")
        - if @edit
          %table.admintable
            %tbody
              %tr
                %td
                  %table#formtest.form{:width => "100%"}
{'fraction_non_alphanumeric': 0.13073879343053824, 'fraction_numerical': 0.0036858366307116917, 'mean_word_length': 1.079576194770063, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 227, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2641451', 'n_tokens_mistral': 5142, 'n_tokens_neox': 4919, 'n_words': 899}