<commit_before><div class="small-16 columns">
    <h1>Isaac Administration</h1>
</div>

<div class="row">
    <div class="small-16 columns">
        <div class="panel white clearfix">
            <h2>Useful links</h4>
            <ul class="no-bullet horizontal-list">
                <li><a ui-sref="contentErrors">Content Errors Page</a></li>
                <li><a href="/api/content/tags" target="_blank">List of tags</a></li>
                <li><a href="/api/content/units" target="_blank">List of units</a></li>
                <li><a ui-sref='adminStats'>Statistics</a></li>
            </ul>            
        </div>
    </div>
</div>
<div class="row">
    <div class="small-16 columns">
        <div class="panel white clearfix">
            <div class="small-16 columns">
                <h2>Admin Console</h2>
                <ul>
                    <li ng-show="segueVersion"><strong>API Version:</strong> {{segueVersion.segueVersion}}</li>                    
                    <li ng-show="indexQueue" title="{{indexQueue.queue}}"><strong>Current Index Queue Size:</strong> {{indexQueue.queue.length}} <span ng-show="indexQueue.queue.length > 0">[<a href="javascript:void(0)" ng-click="clearIndexQueue()">Clear Unstarted jobs</a>]</span></li>
                    <li ng-show="cachedVersions" title="{{cachedVersions.cachedVersions}}"><strong>Content Versions Cached:</strong> {{cachedVersions.cachedVersions.length}}</li>   
                </ul>                
            </div>
        </div>            
    </div>
</div>
<div ng-show="isAdminUser">
    <div class="row">
        <div class="small-16 columns">
            <div class="panel white clearfix">
                <div class="row">
                    <div class="small-16 columns">
                        <h2>Administrative tools</h2>
                    </div>
                </div>
                <div class="row">
                    <div class="small-16 columns">
                       <h3>Manage site content <a name="content">&nbsp;</a></h3>
                    </div>
                    <div class="medium-5 columns text-right">
                       <label for="content-version">
                            <strong>Live Content Version</strong>
                        </label>
                    </div>
                    <form ng-submit="setVersion()">
                        <div class="medium-7 columns end">
                            <input id="content-version" type="text" ng-model="contentVersion.liveVersion" placeholder="Enter commit SHA" ng-change="versionChange = null">
                        </div>
                        <div class="medium-4 columns end" ng-if="versionChange != 'IN_PROGRESS'">
                            <button ng-click="setVersion()">Set Version</button>
                        </div>
                    </form>
                </div>
                <div class="row" ng-if="versionChange == 'IN_PROGRESS'">
                    <div class="medium-16 columns text-center">
                        <h4>Updating...</h4>
                        <img src="/assets/loading.gif">
                    </div>
                </div>
                <div class="row" ng-if="versionChange == 'SUCCESS'">
                    <div class="medium-16 columns text-center">
                        <h4>Content version changed successfully.</h4>
                    </div>
                </div>
                <div class="row" ng-if="versionChange == 'ERROR'">
                    <div class="medium-16 columns text-center">
                        <h4 style="color:#a00;">Error: Content version could not be changed.</h4>
                    </div>
                </div>
                <div class="row">
                    <div class="small-16 columns">
                       <h3>Manage user accounts <a name="users">&nbsp;</a></h3>
                    </div>
                    <form ng-submit="findUsers()">
                        <div class="medium-12 medium-centered columns end">
                            <label for="user-search-familyName">
                                <strong>Find a user by family name</strong>
                            </label>                            
                            <input id="user-search-familyName" type="text" ng-model="userSearch.searchTerms.familyName" placeholder="Enter user familyName" >
                            <label for="user-search-email">
                                <strong>Find a user by email</strong>
                            </label>                            
                            <input id="user-search-email" type="text" ng-model="userSearch.searchTerms.email" placeholder="Enter user email" >

                            <label for="user-school-other">
                                <strong>Find by manually entered school:</strong>
                            </label>
                            <select id="user-school-other" ng-model="userSearch.searchTerms.schoolOther">
                                <option value="">Any School</option>
                                <option ng-repeat="school in schoolOtherEntries" ng-value="school.name">{{school.name}}</option>
                            </select> 

                            <label for="user-search-role">
                                <strong>Find by user role:</strong>
                            </label>
                            <select id="user-search-role" ng-model="userSearch.searchTerms.role">
                                <option value="">Any Role</option>
                                <option value="TEACHER">Teacher</option>
                                <option value="CONTENT_EDITOR">Content Editor</option>
                                <option value="ADMIN">Admin</option>
                            </select>                            
                        </div>
                        <div class="medium-12 medium-centered columns end">
                            <button ng-click="findUsers()">Find user</button>
                        </div>        
                    </form>
                </div>
            
                <!-- Results TODO: stolen from search page this needs tidying up -->
                <section ng-if="userSearch.hasSearched">
                    <div class="small-16 columns" ng-if="userSearch.isLoading">
                            <h4>User search results</h4>                        
                        <div class="text-center" >
                            <img src="/assets/loading.gif">
                        </div>    
                    </div>

                    <div class="row" ng-if="userSearch.results && !userSearch.isLoading">
                        <div class="small-16 columns">
                            <h4>User search results ({{userSearch.results.length}})</h4>
                            <table>
                                <tr>
                                    <th><a href="javascript:void(0);" ng-click="userSearchSortPredicate = 'familyName'; reverse=!reverse">Name</a></th><commit_msg>Added event manager role to search box<commit_after><div class="small-16 columns">
    <h1>Isaac Administration</h1>
</div>

<div class="row">
    <div class="small-16 columns">
        <div class="panel white clearfix">
            <h2>Useful links</h4>
            <ul class="no-bullet horizontal-list">
                <li><a ui-sref="contentErrors">Content Errors Page</a></li>
                <li><a href="/api/content/tags" target="_blank">List of tags</a></li>
                <li><a href="/api/content/units" target="_blank">List of units</a></li>
                <li><a ui-sref='adminStats'>Statistics</a></li>
            </ul>            
        </div>
    </div>
</div>
<div class="row">
    <div class="small-16 columns">
        <div class="panel white clearfix">
            <div class="small-16 columns">
                <h2>Admin Console</h2>
                <ul>
                    <li ng-show="segueVersion"><strong>API Version:</strong> {{segueVersion.segueVersion}}</li>                    
                    <li ng-show="indexQueue" title="{{indexQueue.queue}}"><strong>Current Index Queue Size:</strong> {{indexQueue.queue.length}} <span ng-show="indexQueue.queue.length > 0">[<a href="javascript:void(0)" ng-click="clearIndexQueue()">Clear Unstarted jobs</a>]</span></li>
                    <li ng-show="cachedVersions" title="{{cachedVersions.cachedVersions}}"><strong>Content Versions Cached:</strong> {{cachedVersions.cachedVersions.length}}</li>   
                </ul>                
            </div>
        </div>            
    </div>
</div>
<div ng-show="isAdminUser">
    <div class="row">
        <div class="small-16 columns">
            <div class="panel white clearfix">
                <div class="row">
                    <div class="small-16 columns">
                        <h2>Administrative tools</h2>
                    </div>
                </div>
                <div class="row">
                    <div class="small-16 columns">
                       <h3>Manage site content <a name="content">&nbsp;</a></h3>
                    </div>
                    <div class="medium-5 columns text-right">
                       <label for="content-version">
                            <strong>Live Content Version</strong>
                        </label>
                    </div>
                    <form ng-submit="setVersion()">
                        <div class="medium-7 columns end">
                            <input id="content-version" type="text" ng-model="contentVersion.liveVersion" placeholder="Enter commit SHA" ng-change="versionChange = null">
                        </div>
                        <div class="medium-4 columns end" ng-if="versionChange != 'IN_PROGRESS'">
                            <button ng-click="setVersion()">Set Version</button>
                        </div>
                    </form>
                </div>
                <div class="row" ng-if="versionChange == 'IN_PROGRESS'">
                    <div class="medium-16 columns text-center">
                        <h4>Updating...</h4>
                        <img src="/assets/loading.gif">
                    </div>
                </div>
                <div class="row" ng-if="versionChange == 'SUCCESS'">
                    <div class="medium-16 columns text-center">
                        <h4>Content version changed successfully.</h4>
                    </div>
                </div>
                <div class="row" ng-if="versionChange == 'ERROR'">
                    <div class="medium-16 columns text-center">
                        <h4 style="color:#a00;">Error: Content version could not be changed.</h4>
                    </div>
                </div>
                <div class="row">
                    <div class="small-16 columns">
                       <h3>Manage user accounts <a name="users">&nbsp;</a></h3>
                    </div>
                    <form ng-submit="findUsers()">
                        <div class="medium-12 medium-centered columns end">
                            <label for="user-search-familyName">
                                <strong>Find a user by family name</strong>
                            </label>                            
                            <input id="user-search-familyName" type="text" ng-model="userSearch.searchTerms.familyName" placeholder="Enter user familyName" >
                            <label for="user-search-email">
                                <strong>Find a user by email</strong>
                            </label>                            
                            <input id="user-search-email" type="text" ng-model="userSearch.searchTerms.email" placeholder="Enter user email" >

                            <label for="user-school-other">
                                <strong>Find by manually entered school:</strong>
                            </label>
                            <select id="user-school-other" ng-model="userSearch.searchTerms.schoolOther">
                                <option value="">Any School</option>
                                <option ng-repeat="school in schoolOtherEntries" ng-value="school.name">{{school.name}}</option>
                            </select> 

                            <label for="user-search-role">
                                <strong>Find by user role:</strong>
                            </label>
                            <select id="user-search-role" ng-model="userSearch.searchTerms.role">
                                <option value="">Any Role</option>
                                <option value="TEACHER">Teacher</option>
                                <option value="CONTENT_EDITOR">Content Editor</option>
                                <option value="EVENT_MANAGER">Event Manager</option>
                                <option value="ADMIN">Admin</option>
                            </select>                            
                        </div>
                        <div class="medium-12 medium-centered columns end">
                            <button ng-click="findUsers()">Find user</button>
                        </div>        
                    </form>
                </div>
            
                <!-- Results TODO: stolen from search page this needs tidying up -->
                <section ng-if="userSearch.hasSearched">
                    <div class="small-16 columns" ng-if="userSearch.isLoading">
                            <h4>User search results</h4>                        
                        <div class="text-center" >
                            <img src="/assets/loading.gif">
                        </div>    
                    </div>

                    <div class="row" ng-if="userSearch.results && !userSearch.isLoading">
                        <div class="small-16 columns">
                            <h4>User search results ({{userSearch.results.length}})</h4>
                            <table>
                                <tr>
                                    <th><a href="javascript:void(0);" ng-click="userSearchSortPredicate = 'familyName'; reverse=!reverse">Name</a></th>
{'fraction_non_alphanumeric': 0.13170391061452513, 'fraction_numerical': 0.008379888268156424, 'mean_word_length': 1.2282557958612106, 'pattern_counts': {'":': 0, '<': 363, '<?xml version=': 0, '>': 365, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '945544', 'n_tokens_mistral': 3603, 'n_tokens_neox': 3359, 'n_words': 696}