<commit_before>- if @edit
  - url = url_for_only_path(:action => 'rbac_role_field_changed', :id => (@edit[:role_id] || "new"))
= render :partial => "layouts/flash_msg"
#role_info
  .row
    .col-md-12.col-lg-6
      %h3
        = _("Role Information")
      .form-horizontal
        .form-group
          %label.col-md-4.control-label
            = _("Name")
          .col-md-8
            - if !@edit
              %p.form-control-static
                = h(@role.name)
            - else
              = text_field_tag("name",
                               @edit[:new][:name],
                               :maxlength         => 50,
                               :class => "form-control",
                               "data-miq_observe" => {:interval => '.5', :url => url}.to_json)
              = javascript_tag(javascript_focus('name'))
        .form-group
          %label.col-md-4.control-label
            = _('Access Restriction for Services, VMs, and Templates')
          .col-md-8
            - if !@edit
              - if @role.settings.kind_of?(Hash) && @role.settings.fetch_path(:restrictions, :vms)
                = h(MiqUserRole::RESTRICTIONS[@role.settings.fetch_path(:restrictions, :vms)])
              - else
                = _("None")
            - else
              = select_tag('vm_restriction',
                           options_for_select([[_("None"), _("none")]] + MiqUserRole::RESTRICTIONS.invert.sort_by { |name, _value| name.downcase },
                           @edit[:new][:vm_restriction].to_sym),
                           :class    => "selectpicker")
          :javascript
            miqInitSelectPicker();
            miqSelectPickerEvent('vm_restriction', "#{url}")
        - unless @edit
          .form-group
            %label.col-md-4.control-label
              = _("Groups Using this Role")
            .col-md-8
              - @role.miq_groups.sort_by { |a| a.description.downcase }.each do |g|
                - if role_allows?(:feature => "rbac_group_show")
                  - params = {:class   => "pointer",
                              :onclick => "miqOnClickSelectRbacTreeNode('g-#{to_cid(g.id)}');",
                              :title   => _("View this Group")}
                - else
                  - params = {}
                %i.ff.ff-group{params}
                = link_to(g.description, "#", params)<commit_msg>Add missing gettext into user role screen<commit_after>- if @edit
  - url = url_for_only_path(:action => 'rbac_role_field_changed', :id => (@edit[:role_id] || "new"))
= render :partial => "layouts/flash_msg"
#role_info
  .row
    .col-md-12.col-lg-6
      %h3
        = _("Role Information")
      .form-horizontal
        .form-group
          %label.col-md-4.control-label
            = _("Name")
          .col-md-8
            - if !@edit
              %p.form-control-static
                = h(@role.name)
            - else
              = text_field_tag("name",
                               @edit[:new][:name],
                               :maxlength         => 50,
                               :class => "form-control",
                               "data-miq_observe" => {:interval => '.5', :url => url}.to_json)
              = javascript_tag(javascript_focus('name'))
        .form-group
          %label.col-md-4.control-label
            = _('Access Restriction for Services, VMs, and Templates')
          .col-md-8
            - if !@edit
              - if @role.settings.kind_of?(Hash) && @role.settings.fetch_path(:restrictions, :vms)
                = h(_(MiqUserRole::RESTRICTIONS[@role.settings.fetch_path(:restrictions, :vms)]))
              - else
                = _("None")
            - else
              - restrictions = MiqUserRole::RESTRICTIONS.map { |k, v| [_(v), k] }.sort_by { |name, _value| name.downcase }
              = select_tag('vm_restriction',
                           options_for_select([[_("None"), "none"]] + restrictions,
                           @edit[:new][:vm_restriction].to_sym),
                           :class    => "selectpicker")
          :javascript
            miqInitSelectPicker();
            miqSelectPickerEvent('vm_restriction', "#{url}")
        - unless @edit
          .form-group
            %label.col-md-4.control-label
              = _("Groups Using this Role")
            .col-md-8
              - @role.miq_groups.sort_by { |a| a.description.downcase }.each do |g|
                - if role_allows?(:feature => "rbac_group_show")
                  - params = {:class   => "pointer",
                              :onclick => "miqOnClickSelectRbacTreeNode('g-#{to_cid(g.id)}');",
                              :title   => _("View this Group")}
                - else
                  - params = {}
                %i.ff.ff-group{params}
                = link_to(g.description, "#", params)
{'fraction_non_alphanumeric': 0.14455852156057494, 'fraction_numerical': 0.0053388090349075976, 'mean_word_length': 1.3737816764132553, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 29, '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': '6803979', 'n_tokens_mistral': 1465, 'n_tokens_neox': 1417, 'n_words': 226}