<commit_before>
%h3 User Management

.panel.panel-default#admin-dashboard
  .panel-heading
    .btn-toolbar{role: "toolbar"}
      %form#user-search.form-inline{ role: 'form', action: admin_users_path, :style => "display: inline;" }

        .col-sm-4
          .btn-group{data: {toggle: 'buttons'}}
            %label.btn.btn-default
              %input{type: 'radio', name: 'search_role', value: ''} All Users
            %label.btn.btn-default
              %input{type: 'radio', name: 'search_role', value: 'admin'} Admins
            %label.btn.btn-default
              %input{type: 'radio', name: 'search_role', value: 'owner'} Owners
            %label.btn.btn-default
              %input{type: 'radio', name: 'search_role', value: 'forum_user'} Forum Users
            %label.btn.btn-default
              %input{type: 'radio', name: 'search_role', value: 'forum_moderator'} Forum Moderators
        .col-sm-8
          .btn-group
            %input#auth-token{name: 'authenticity_token', type: "hidden", value: form_authenticity_token}
            %label.control-label.sr-only Limit by user email
            .input-group
              %input.form-control{type: 'search', placeholder: 'Search by Email', name: 'search', value: params[:search]}
              %span.input-group-btn
                %button.btn.btn-default{type: "submit", value: ""} Search



  .table-responsive
    %table.table#role{data: {add_target: add_role_path, remove_target: remove_role_path, destroy_target: destroy_user_path}}
      %thead
        %tr
          %th
            User
          %th
            Role

      %tbody
        - @users.each do |user|
          %tr.user{data: {user_id: user.id}}
            %td= user.email
            %td
              - user.roles.each do |role|
                %span.label.label-default{:style => "margin-right: 5px;"}
                  = role.name.capitalize
                  %a.remove-role{data: {role: role.name}, :style => "color: inherit;"}
                    %i.fa.fa-times

              / Single button
              .btn-group.pull-right
                %button.btn.btn-primary.btn-xs.dropdown-toggle{"data-toggle" => "dropdown", type: "button"}
                  Action
                  %span.caret
                %ul.dropdown-menu{role: "menu"}
                  %li
                    %a.add-role{href: "#", data: {role: 'admin'}} Make Admin
                  %li
                    %a.add-role{href: "#", data: {role: 'owner'}} Make Owner
                  %li
                    %a.add-role{href: "#", data: {role: 'admin'}} Make Forum User
                  %li
                    %a.add-role{href: "#", data: {role: 'owner'}} Make Forum Moderator
                  %li.divider
                  %li
                    %a.delete-user{href: "#"} Delete User



<commit_msg>Setting a user as a forum user or forum moderator now sets the role correctly, fixes myapnea/www_myapnea_org#48.<commit_after>
%h3 User Management

.panel.panel-default#admin-dashboard
  .panel-heading
    .btn-toolbar{role: "toolbar"}
      %form#user-search.form-inline{ role: 'form', action: admin_users_path, :style => "display: inline;" }

        .col-sm-4
          .btn-group{data: {toggle: 'buttons'}}
            %label.btn.btn-default
              %input{type: 'radio', name: 'search_role', value: ''} All Users
            %label.btn.btn-default
              %input{type: 'radio', name: 'search_role', value: 'admin'} Admins
            %label.btn.btn-default
              %input{type: 'radio', name: 'search_role', value: 'owner'} Owners
            %label.btn.btn-default
              %input{type: 'radio', name: 'search_role', value: 'forum_user'} Forum Users
            %label.btn.btn-default
              %input{type: 'radio', name: 'search_role', value: 'forum_moderator'} Forum Moderators
        .col-sm-8
          .btn-group
            %input#auth-token{name: 'authenticity_token', type: "hidden", value: form_authenticity_token}
            %label.control-label.sr-only Limit by user email
            .input-group
              %input.form-control{type: 'search', placeholder: 'Search by Email', name: 'search', value: params[:search]}
              %span.input-group-btn
                %button.btn.btn-default{type: "submit", value: ""} Search



  .table-responsive
    %table.table#role{data: {add_target: add_role_path, remove_target: remove_role_path, destroy_target: destroy_user_path}}
      %thead
        %tr
          %th
            User
          %th
            Role

      %tbody
        - @users.each do |user|
          %tr.user{data: {user_id: user.id}}
            %td= user.email
            %td
              - user.roles.each do |role|
                %span.label.label-default{:style => "margin-right: 5px;"}
                  = role.name.titleize
                  %a.remove-role{data: {role: role.name}, :style => "color: inherit;"}
                    %i.fa.fa-times

              / Single button
              .btn-group.pull-right
                %button.btn.btn-primary.btn-xs.dropdown-toggle{"data-toggle" => "dropdown", type: "button"}
                  Action
                  %span.caret
                %ul.dropdown-menu{role: "menu"}
                  %li
                    %a.add-role{href: "#", data: {role: 'admin'}} Make Admin
                  %li
                    %a.add-role{href: "#", data: {role: 'owner'}} Make Owner
                  %li
                    %a.add-role{href: "#", data: {role: 'forum_user'}} Make Forum User
                  %li
                    %a.add-role{href: "#", data: {role: 'forum_moderator'}} Make Forum Moderator
                  %li.divider
                  %li
                    %a.delete-user{href: "#"} Delete User




{'fraction_non_alphanumeric': 0.14038128249566725, 'fraction_numerical': 0.0017331022530329288, 'mean_word_length': 1.6929538030797946, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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': '947646', 'n_tokens_mistral': 1760, 'n_tokens_neox': 1680, 'n_words': 366}