<commit_before>@import models.user.User
@import models.daos.slick.DBTableDefinitions.DBUser
@import models.audit.AuditTaskCommentTable
@import models.audit.AuditTaskTable
@import models.label.LabelTable
@import models.mission.MissionTable

@import java.util.UUID
@import models.user.UserCurrentRegionTable
@import models.region.RegionPropertyTable

@(title: String, admin: Option[User] = None, user: Option[DBUser] = Some(DBUser("unknown", "unknown", "unknown")))

@main(title) {
    @navbar(admin)
    <div class="container">
        <div class="row">
            <div class="col-lg-12">
                <div id="map-holder">
                    <div id="admin-map"></div>
                    <div id="map-label-legend">
                        <table class="table">
                            <tr><td id="map-legend-curb-ramp"></td><td>Curb Ramp</td></tr>
                            <tr><td id="map-legend-no-curb-ramp"></td><td>Missing Curb Ramp</td></tr>
                            <tr><td id="map-legend-obstacle"></td><td>Obstacle in Path</td></tr>
                            <tr><td id="map-legend-surface-problem"></td><td>Surface Problem</td></tr>
                            <tr><td id="map-legend-audited-street"></td><td>Audited Street</td></tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <h1>General Info and Stats</h1>
        <div class="row">
            <div class="col-lg-12">
                <table class="table table-striped table-condensed">
                    <tr>
                        <th class="col-md-2">Username</th>
                        <th class="col-md-2">User Id</th>
                        <th class="col-md-2">Email</th>
                        <th class="col-md-2">Mission Count</th>
                        <th class="col-md-2">Audited Street Count</th>
                        <th class="col-md-2">Label Count</th>
                    </tr>
                    <tr>
                        <td>@user.get.username</td>
                        <td>@user.get.userId</td>
                        <td>@user.get.email</td>
                        <td>@MissionTable.countCompletedMissionsByUserId(UUID.fromString(user.get.userId))</td>
                        <td>@AuditTaskTable.countCompletedAuditsByUserId(UUID.fromString(user.get.userId))</td>
                        <td>@LabelTable.countLabelsByUserId(UUID.fromString(user.get.userId))</td>
                    </tr>
                </table>
            </div>
            <div class="col-lg-12">
                <table class="table">
                    <tr>
                        <th class="col-md-2">Current Neighborhood</th>
                        <td class="col-md-10">
                            @RegionPropertyTable.neighborhoodName(UserCurrentRegionTable.currentRegion(UUID.fromString(user.get.userId)).get)
                            (Region ID: @UserCurrentRegionTable.currentRegion(UUID.fromString(user.get.userId)))
                        </td>
                    </tr>
                </table>
            </div>
        </div>

        <div class="row">
            <h1>Labels</h1>
            <div class="col-lg-12">
                <p>Recent labels</p>
                <table id="labelTable" data-order='[[ 0, "desc" ]]' class="table table-striped table-condensed">
                    <thead>
                    <tr>
                        <th class="col-md-3" data-class-name="priority">Timestamp</th>
                        <th class="col-md-2">Label Type</th>
                        <th class="col-md-1">Severity</th>
                        <th class="col-md-2">Temporary?</th>
                        <th class="col-md-5">Description</th>
                    </tr>
                    </thead>
                    <tbody>
                    @LabelTable.selectTopLabelsAndMetadataByUser(1000, UUID.fromString(user.get.userId)).map { userLabel =>
                        <tr>
                            <td>@userLabel.timestamp</td>
                            <td>@userLabel.labelTypeValue</td>
                            <td>@userLabel.severity</td>
                            <td>@userLabel.temporary</td>
                            <td>@userLabel.description</td>
                        </tr>
                    }
                    </tbody>
                </table>
            </div>
        </div>


        <h1>Audited Streets</h1>
        <div class="row">
            <table class="table table-striped table-fixed">
                <thead>
                    <tr>
                        <th class="col-xs-12">Labels per Street</th>
                    </tr>
                    <tr>
                        <th class="col-xs-2">Date</th>
                        <th class="col-xs-2">Curb Ramp</th>
                        <th class="col-xs-2">Missing Curb Ramp</th>
                        <th class="col-xs-2">Obstacle</th>
                        <th class="col-xs-2">Surface Problem</th>
                        <th class="col-xs-2">Other</th>
                    </tr></thead>
                <tbody id="task-contribution-table" ></tbody>
            </table>
        </div>

        <h1>Completed Missions</h1>
        <div class="row">
            <table class="table table-striped table-fixed">
                <thead>
                    <tr>
                        <th class="col-md-2">Mission Id</th>
                        <th class="col-md-2">Mission Label</th>
                        <th class="col-md-2">Region Id</th>
                        <th class="col-md-2">Region Name</th>
                        <th class="col-md-4">Distance (m / ft / mi)</th>
                    </tr>
                </thead>
                <tbody>
                @for(mission <- MissionTable.selectCompletedRegionalMission(UUID.fromString(user.get.userId))) {
                    <tr>
                        <td class="col-md-2">@mission.missionId</td>
                        <td class="col-md-2">@mission.label</td>
                        <td class="col-md-2">@mission.regionId</td>
                        <td class="col-md-2">@mission.regionName</td>
                        <td class="col-md-4">@("%1.1f".format(mission.distance.get)) / @("%1.1f".format(mission.distance_ft.get)) / @("%1.1f".format(mission.distance_mi.get))</td>
                    </tr>
                }
                </tbody>
            </table>
        </div>


        <div class="row">
            <h1>Feedback</h1>
            <div class="col-lg-12">
                <table class="table table-striped table-condensed">
                    <tr><th class="col-md-3">Timestamp</th><th class="col-md-3">Panorama Id</th><th class="col-md-6">Comment</th></tr>
                    @AuditTaskCommentTable.all(user.get.username).getOrElse(List()).map { comment =>
                        <tr>
                            <td>@comment.timestamp</td>
                            <td>@comment.gsvPanoramaId</td>
                            <td>@comment.comment</td>
                        </tr>
                    }
                </table>
            </div>
        </div>
    </div>
    <link href='@routes.Assets.at("stylesheets/c3.min.css")' rel="stylesheet"/>
    <link href='@routes.Assets.at("stylesheets/admin.css")' rel="stylesheet"/>
    <link href='@routes.Assets.at("stylesheets/dataTables.bootstrap.min.css")' rel="stylesheet"/>

    <script type="text/javascript" src='@routes.Assets.at("javascripts/lib/d3.v3.js")'></script>
    <script type="text/javascript" src='@routes.Assets.at("javascripts/lib/c3.min.js")'></script>
    <script type="text/javascript" src='@routes.Assets.at("javascripts/lib/underscore.min.js")'></script>
    <script type="text/javascript" src='@routes.Assets.at("javascripts/lib/jquery.dataTables.min.js")'></script>
    <script type="text/javascript" src='@routes.Assets.at("javascripts/lib/dataTables.bootstrap.min.js")'></script>

    <script type="text/javascript" src='@routes.Assets.at("javascripts/Admin/build/Admin.js")'></script>
    <script type="text/javascript" src='@routes.Assets.at("javascripts/SVLabel/src/SVLabel/util/UtilitiesSidewalk.js")'></script>
    <script type="text/javascript" src='@routes.Assets.at("javascripts/SVLabel/src/SVLabel/util/UtilitiesColor.js")'></script>
    <script>
            $(document).ready(function () {
                var username = '@user.get.username';
                window.admin = AdminUser({username: username});
                $('#labelTable').dataTable();
            });
    </script>
}<commit_msg>fixed None.get error after truncating user_current_region table<commit_after>@import models.user.User
@import models.daos.slick.DBTableDefinitions.DBUser
@import models.audit.AuditTaskCommentTable
@import models.audit.AuditTaskTable
@import models.label.LabelTable
@import models.mission.MissionTable

@import java.util.UUID
@import models.user.UserCurrentRegionTable
@import models.region.RegionPropertyTable

@(title: String, admin: Option[User] = None, user: Option[DBUser] = Some(DBUser("unknown", "unknown", "unknown")))

@main(title) {
    @navbar(admin)
    <div class="container">
        <div class="row">
            <div class="col-lg-12">
                <div id="map-holder">
                    <div id="admin-map"></div>
                    <div id="map-label-legend">
                        <table class="table">
                            <tr><td id="map-legend-curb-ramp"></td><td>Curb Ramp</td></tr>
                            <tr><td id="map-legend-no-curb-ramp"></td><td>Missing Curb Ramp</td></tr>
                            <tr><td id="map-legend-obstacle"></td><td>Obstacle in Path</td></tr>
                            <tr><td id="map-legend-surface-problem"></td><td>Surface Problem</td></tr>
                            <tr><td id="map-legend-audited-street"></td><td>Audited Street</td></tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <h1>General Info and Stats</h1>
        <div class="row">
            <div class="col-lg-12">
                <table class="table table-striped table-condensed">
                    <tr>
                        <th class="col-md-2">Username</th>
                        <th class="col-md-2">User Id</th>
                        <th class="col-md-2">Email</th>
                        <th class="col-md-2">Mission Count</th>
                        <th class="col-md-2">Audited Street Count</th>
                        <th class="col-md-2">Label Count</th>
                    </tr>
                    <tr>
                        <td>@user.get.username</td>
                        <td>@user.get.userId</td>
                        <td>@user.get.email</td>
                        <td>@MissionTable.countCompletedMissionsByUserId(UUID.fromString(user.get.userId))</td>
                        <td>@AuditTaskTable.countCompletedAuditsByUserId(UUID.fromString(user.get.userId))</td>
                        <td>@LabelTable.countLabelsByUserId(UUID.fromString(user.get.userId))</td>
                    </tr>
                </table>
            </div>
            <div class="col-lg-12">
                <table class="table">
                    <tr>
                        <th class="col-md-2">Current Neighborhood</th>
                        <td class="col-md-10">
                            @UserCurrentRegionTable.currentRegion(UUID.fromString(user.get.userId)).map {_ => RegionPropertyTable.neighborhoodName(_)}.getOrElse("Unassigned")
                            (Region ID: @UserCurrentRegionTable.currentRegion(UUID.fromString(user.get.userId)).map{_ => _}.getOrElse("NA"))
                        </td>
                    </tr>
                </table>
            </div>
        </div>

        <div class="row">
            <h1>Labels</h1>
            <div class="col-lg-12">
                <p>Recent labels</p>
                <table id="labelTable" data-order='[[ 0, "desc" ]]' class="table table-striped table-condensed">
                    <thead>
                    <tr>
                        <th class="col-md-3" data-class-name="priority">Timestamp</th>
                        <th class="col-md-2">Label Type</th>
                        <th class="col-md-1">Severity</th>
                        <th class="col-md-2">Temporary?</th>
                        <th class="col-md-5">Description</th>
                    </tr>
                    </thead>
                    <tbody>
                    @LabelTable.selectTopLabelsAndMetadataByUser(1000, UUID.fromString(user.get.userId)).map { userLabel =>
                        <tr>
                            <td>@userLabel.timestamp</td>
                            <td>@userLabel.labelTypeValue</td>
                            <td>@userLabel.severity</td>
                            <td>@userLabel.temporary</td>
                            <td>@userLabel.description</td>
                        </tr>
                    }
                    </tbody>
                </table>
            </div>
        </div>


        <h1>Audited Streets</h1>
        <div class="row">
            <table class="table table-striped table-fixed">
                <thead>
                    <tr>
                        <th class="col-xs-12">Labels per Street</th>
                    </tr>
                    <tr>
                        <th class="col-xs-2">Date</th>
                        <th class="col-xs-2">Curb Ramp</th>
                        <th class="col-xs-2">Missing Curb Ramp</th>
                        <th class="col-xs-2">Obstacle</th>
                        <th class="col-xs-2">Surface Problem</th>
                        <th class="col-xs-2">Other</th>
                    </tr></thead>
                <tbody id="task-contribution-table" ></tbody>
            </table>
        </div>

        <h1>Completed Missions</h1>
        <div class="row">
            <table class="table table-striped table-fixed">
                <thead>
                    <tr>
                        <th class="col-md-2">Mission Id</th>
                        <th class="col-md-2">Mission Label</th>
                        <th class="col-md-2">Region Id</th>
                        <th class="col-md-2">Region Name</th>
                        <th class="col-md-4">Distance (m / ft / mi)</th>
                    </tr>
                </thead>
                <tbody>
                @for(mission <- MissionTable.selectCompletedRegionalMission(UUID.fromString(user.get.userId))) {
                    <tr>
                        <td class="col-md-2">@mission.missionId</td>
                        <td class="col-md-2">@mission.label</td>
                        <td class="col-md-2">@mission.regionId</td>
                        <td class="col-md-2">@mission.regionName</td>
                        <td class="col-md-4">@("%1.1f".format(mission.distance.get)) / @("%1.1f".format(mission.distance_ft.get)) / @("%1.1f".format(mission.distance_mi.get))</td>
                    </tr>
                }
                </tbody>
            </table>
        </div>


        <div class="row">
            <h1>Feedback</h1>
            <div class="col-lg-12">
                <table class="table table-striped table-condensed">
                    <tr><th class="col-md-3">Timestamp</th><th class="col-md-3">Panorama Id</th><th class="col-md-6">Comment</th></tr>
                    @AuditTaskCommentTable.all(user.get.username).getOrElse(List()).map { comment =>
                        <tr>
                            <td>@comment.timestamp</td>
                            <td>@comment.gsvPanoramaId</td>
                            <td>@comment.comment</td>
                        </tr>
                    }
                </table>
            </div>
        </div>
    </div>
    <link href='@routes.Assets.at("stylesheets/c3.min.css")' rel="stylesheet"/>
    <link href='@routes.Assets.at("stylesheets/admin.css")' rel="stylesheet"/>
    <link href='@routes.Assets.at("stylesheets/dataTables.bootstrap.min.css")' rel="stylesheet"/>

    <script type="text/javascript" src='@routes.Assets.at("javascripts/lib/d3.v3.js")'></script>
    <script type="text/javascript" src='@routes.Assets.at("javascripts/lib/c3.min.js")'></script>
    <script type="text/javascript" src='@routes.Assets.at("javascripts/lib/underscore.min.js")'></script>
    <script type="text/javascript" src='@routes.Assets.at("javascripts/lib/jquery.dataTables.min.js")'></script>
    <script type="text/javascript" src='@routes.Assets.at("javascripts/lib/dataTables.bootstrap.min.js")'></script>

    <script type="text/javascript" src='@routes.Assets.at("javascripts/Admin/build/Admin.js")'></script>
    <script type="text/javascript" src='@routes.Assets.at("javascripts/SVLabel/src/SVLabel/util/UtilitiesSidewalk.js")'></script>
    <script type="text/javascript" src='@routes.Assets.at("javascripts/SVLabel/src/SVLabel/util/UtilitiesColor.js")'></script>
    <script>
            $(document).ready(function () {
                var username = '@user.get.username';
                window.admin = AdminUser({username: username});
                $('#labelTable').dataTable();
            });
    </script>
}
{'fraction_non_alphanumeric': 0.15961194202229023, 'fraction_numerical': 0.00808454120228677, 'mean_word_length': 1.4501980758347481, 'pattern_counts': {'":': 0, '<': 475, '<?xml version=': 0, '>': 479, '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': '947645', 'n_tokens_mistral': 5132, 'n_tokens_neox': 4940, 'n_words': 662}