<commit_before><div class="page-content">
  <div class="row">
    <!-- include the sidebar -->
    <div ng-include="'views/sidebar.html'"></div>
    <div class="col-md-10">
      <div class="content-box-large">
        <div class="panel-heading">
          <div class="panel-title">
            <h2><i class="glyphicon glyphicon-user"></i>&nbsp;&nbsp;Users</h2>
            <p class="text-muted">
              View users and a summary of their channel permissions as well as manage a user's groups. Channel permissions can be altered in each channel's configuration.
            </p>
          </div>
        </div>

        <!-- Top Alerts -->
        <alert ng-repeat="alert in alerts.top" type="alert.type">{{alert.msg}}</alert>
        <!-- Top Alerts -->

        <div class="panel-body">
          <!-- Users/Channels Matrix Table -->
          <div id="users-channels-matrix" class="panel-body usersChannelsMatrixDiv" style="clear: both;">

            <div class="usersChannelsMatrixLegendDiv">
              <title>Legend:</title>
              <div>
                <span tooltip="User allowed to view transactions"><i class="isAllowed glyphicon glyphicon-eye-open"></i></span>
                <span tooltip="User NOT allowed to view transactions"><i class="isNotAllowed glyphicon glyphicon-eye-open"></i></span>  
                Allowed to View Transactions
              </div>
              
              <div>
                <span tooltip="User allowed to view transaction's body"><i class="isAllowed glyphicon glyphicon-book"></i></span>
                <span tooltip="User NOT allowed to view transaction's body"><i class="isNotAllowed glyphicon glyphicon-book"></i></span>
                Allowed to View a Transaction's Body
              </div>

              <div>
                <span tooltip="User allowed to rerun transactions"><i class="isAllowed glyphicon glyphicon-repeat"></i></span>
                <span tooltip="User NOT allowed to rerun transactions"><i class="isNotAllowed glyphicon glyphicon-repeat"></i></span>
                Allowed to Rerun Transactions
              </div>
            </div>

            <div id="no-more-tables">
              <table class="table table-striped">
                <thead>
                  <tr>
                    <th width="50">#</th>
                    <th>Email</th>
                    <th>Name</th>
                    <th>Permission Groups</th>
                    <th ng-repeat="channel in usersChannelsMatrix.channels | orderBy:['name']" style="text-align: center;">{{channel.name}}</th>
                    <th width="80"></th>
                  </tr>
                </thead>
                <tbody>
                  <tr ng-repeat="user in usersChannelsMatrix.users | orderBy:['user']">
                    <td data-title="#{{ $index +1 }}"><span id="counter">{{ $index +1 }}</span></td>
                    <td data-title="User" style="max-width: none;">
                      <a href="" ng-click="editUser(user.user)">{{ user.user.email }}</a>
                      <span ng-if="user.user.locked" style="color: #d9534f" tooltip-html-unsafe="This user is currently locked<br />They will need to set their password or admin needs to set it for them"><i class="glyphicon glyphicon-lock"></i></span>
                    </td>
                    <td data-title="Name">{{ user.user.firstname }} {{ user.user.surname }}</td>
                    <td data-title="Permission Group"><span ng-repeat="group in user.user.groups"> {{ group }}{{$last ? '' : ', '}} </span></td>
                    <td style="min-width: 80px" ng-repeat="channel in usersChannelsMatrix.channels | orderBy:['name']" data-title="{{channel.name}}" class="usersChannelsMatrixTD" >

                      <!-- show if channel is allowed -->
                      <i ng-show="isAllowedChannel(channel.id, user.allowedChannels)" class="isAllowed glyphicon glyphicon-eye-open"></i>

                      <!-- show if channel is NOT allowed -->
                      <i ng-show="!isAllowedChannel(channel.id, user.allowedChannels)" class="isNotAllowed glyphicon glyphicon-eye-open"></i>


                      <!-- show if channel is allowed -->
                      <i ng-show="isAllowedChannel(channel.id, user.allowedChannelsBody)" class="isAllowed glyphicon glyphicon-book"></i>

                      <!-- show if channel is NOT allowed -->
                      <i ng-show="!isAllowedChannel(channel.id, user.allowedChannelsBody)" class="isNotAllowed glyphicon glyphicon-book"></i>


                      <!-- show if channel is allowed -->
                      <i ng-show="isAllowedChannel(channel.id, user.allowedChannelsRerun)" class="isAllowed glyphicon glyphicon-repeat"></i>

                      <!-- show if channel is NOT allowed -->
                      <i ng-show="!isAllowedChannel(channel.id, user.allowedChannelsRerun)" class="isNotAllowed glyphicon glyphicon-repeat"></i>

                    </td>
                    <td>
                      <button class="btn btn-warning btn-xs" ng-click="editUser(user.user)"><i class="glyphicon glyphicon-pencil"></i></button>
                      <button class="btn btn-danger btn-xs" ng-click="confirmDelete(user.user)"><i class="glyphicon glyphicon-remove"></i></button>
                    </td>
                  </tr>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>

          <!-- show loading gif when scope object empty and no server errors exist -->
          <div class="loadingContainer" ng-show="!(users || alerts.server)">
            <img src="images/loading.gif" alt="Loading..." />
          </div>

          <!-- Server Alerts -->
          <alert ng-repeat="alert in alerts.server" type="alert.type">{{alert.msg}}</alert>
          <!-- Server Alerts -->

          <!-- Bottom Alerts -->
          <alert ng-repeat="alert in alerts.bottom" type="alert.type">{{alert.msg}}</alert>
          <!-- Bottom Alerts -->

          <button class="btn btn-primary" ng-click="addUser()" ng-show="!alerts.server"><i class="glyphicon glyphicon-plus"></i> User</button>
        </div>
      </div>
    </div>
  </div>
</div><commit_msg>OHM-266: Add dismissable alerting functionality to users view<commit_after><div class="page-content">
  <div class="row">
    <!-- include the sidebar -->
    <div ng-include="'views/sidebar.html'"></div>
    <div class="col-md-10">
      <div class="content-box-large">
        <div class="panel-heading">
          <div class="panel-title">
            <h2><i class="glyphicon glyphicon-user"></i>&nbsp;&nbsp;Users</h2>
            <p class="text-muted">
              View users and a summary of their channel permissions as well as manage a user's groups. Channel permissions can be altered in each channel's configuration.
            </p>
          </div>
        </div>

        <!-- Top Alerts -->
        <div class="alert alert-{{alert.type}} alert-dismissible" role="alert" ng-repeat="alert in alerts.top">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            {{alert.msg}}
        </div>
        <!-- Top Alerts -->

        <div class="panel-body">
          <!-- Users/Channels Matrix Table -->
          <div id="users-channels-matrix" class="panel-body usersChannelsMatrixDiv" style="clear: both;">

            <div class="usersChannelsMatrixLegendDiv">
              <title>Legend:</title>
              <div>
                <span tooltip="User allowed to view transactions"><i class="isAllowed glyphicon glyphicon-eye-open"></i></span>
                <span tooltip="User NOT allowed to view transactions"><i class="isNotAllowed glyphicon glyphicon-eye-open"></i></span>  
                Allowed to View Transactions
              </div>
              
              <div>
                <span tooltip="User allowed to view transaction's body"><i class="isAllowed glyphicon glyphicon-book"></i></span>
                <span tooltip="User NOT allowed to view transaction's body"><i class="isNotAllowed glyphicon glyphicon-book"></i></span>
                Allowed to View a Transaction's Body
              </div>

              <div>
                <span tooltip="User allowed to rerun transactions"><i class="isAllowed glyphicon glyphicon-repeat"></i></span>
                <span tooltip="User NOT allowed to rerun transactions"><i class="isNotAllowed glyphicon glyphicon-repeat"></i></span>
                Allowed to Rerun Transactions
              </div>
            </div>

            <div id="no-more-tables">
              <table class="table table-striped">
                <thead>
                  <tr>
                    <th width="50">#</th>
                    <th>Email</th>
                    <th>Name</th>
                    <th>Permission Groups</th>
                    <th ng-repeat="channel in usersChannelsMatrix.channels | orderBy:['name']" style="text-align: center;">{{channel.name}}</th>
                    <th width="80"></th>
                  </tr>
                </thead>
                <tbody>
                  <tr ng-repeat="user in usersChannelsMatrix.users | orderBy:['user']">
                    <td data-title="#{{ $index +1 }}"><span id="counter">{{ $index +1 }}</span></td>
                    <td data-title="User" style="max-width: none;">
                      <a href="" ng-click="editUser(user.user)">{{ user.user.email }}</a>
                      <span ng-if="user.user.locked" style="color: #d9534f" tooltip-html-unsafe="This user is currently locked<br />They will need to set their password or admin needs to set it for them"><i class="glyphicon glyphicon-lock"></i></span>
                    </td>
                    <td data-title="Name">{{ user.user.firstname }} {{ user.user.surname }}</td>
                    <td data-title="Permission Group"><span ng-repeat="group in user.user.groups"> {{ group }}{{$last ? '' : ', '}} </span></td>
                    <td style="min-width: 80px" ng-repeat="channel in usersChannelsMatrix.channels | orderBy:['name']" data-title="{{channel.name}}" class="usersChannelsMatrixTD" >

                      <!-- show if channel is allowed -->
                      <i ng-show="isAllowedChannel(channel.id, user.allowedChannels)" class="isAllowed glyphicon glyphicon-eye-open"></i>

                      <!-- show if channel is NOT allowed -->
                      <i ng-show="!isAllowedChannel(channel.id, user.allowedChannels)" class="isNotAllowed glyphicon glyphicon-eye-open"></i>


                      <!-- show if channel is allowed -->
                      <i ng-show="isAllowedChannel(channel.id, user.allowedChannelsBody)" class="isAllowed glyphicon glyphicon-book"></i>

                      <!-- show if channel is NOT allowed -->
                      <i ng-show="!isAllowedChannel(channel.id, user.allowedChannelsBody)" class="isNotAllowed glyphicon glyphicon-book"></i>


                      <!-- show if channel is allowed -->
                      <i ng-show="isAllowedChannel(channel.id, user.allowedChannelsRerun)" class="isAllowed glyphicon glyphicon-repeat"></i>

                      <!-- show if channel is NOT allowed -->
                      <i ng-show="!isAllowedChannel(channel.id, user.allowedChannelsRerun)" class="isNotAllowed glyphicon glyphicon-repeat"></i>

                    </td>
                    <td>
                      <button class="btn btn-warning btn-xs" ng-click="editUser(user.user)"><i class="glyphicon glyphicon-pencil"></i></button>
                      <button class="btn btn-danger btn-xs" ng-click="confirmDelete(user.user)"><i class="glyphicon glyphicon-remove"></i></button>
                    </td>
                  </tr>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>

          <!-- show loading gif when scope object empty and no server errors exist -->
          <div class="loadingContainer" ng-show="!(users || alerts.server)">
            <img src="images/loading.gif" alt="Loading..." />
          </div>

          <!-- Server Alerts -->
          <div class="alert alert-{{alert.type}} alert-dismissible" role="alert" ng-repeat="alert in alerts.server">
              <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
              {{alert.msg}}
          </div>
          <!-- Server Alerts -->

          <!-- Bottom Alerts -->
          <div class="alert alert-{{alert.type}} alert-dismissible" role="alert" ng-repeat="alert in alerts.bottom">
              <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
              {{alert.msg}}
          </div>
          <!-- Bottom Alerts -->

          <button class="btn btn-primary" ng-click="addUser()" ng-show="!alerts.server"><i class="glyphicon glyphicon-plus"></i> User</button>
        </div>
      </div>
    </div>
  </div>
</div>
{'fraction_non_alphanumeric': 0.15572833295220673, 'fraction_numerical': 0.0026678862718194983, 'mean_word_length': 1.9344665622903154, 'pattern_counts': {'":': 0, '<': 323, '<?xml version=': 0, '>': 323, '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': '3668254', 'n_tokens_mistral': 3666, 'n_tokens_neox': 3409, 'n_words': 827}