<commit_before>@*
* Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0
* See accompanying LICENSE file.
*@
@import scalaz.{\/}
@(cluster:String, errorOrTopics: kafka.manager.ApiError \/ kafka.manager.TopicListExtended)

@theMenu = {
    @views.html.navigation.clusterMenu(cluster,"Topic","List",models.navigation.Menus.clusterMenus(cluster))
}

@topicScripts = {
    <script ype="text/javascript">
    $(document).ready(function() {
        $('#topics-table').DataTable();
    } );
    </script>
}

@main(
    "Topic List",
    menu = theMenu,
    breadcrumbs=views.html.navigation.breadCrumbs(models.navigation.BreadCrumbs.withViewAndCluster("Topics",cluster)),
    scripts=topicScripts) {
    <div class="col-md-12">
        <div class="panel panel-default">
            <div class="panel-heading"><h4>Operations</h4></div>
            <table class="table">
                <tr>
                    <td>
                        <a href="@routes.ReassignPartitions.confirmMultipleAssignments(cluster)" class="submit-button btn btn-primary" role="button">Generate Partition Assignments</a>
                    </td>
                    <td>
                        <a href="@routes.ReassignPartitions.manualMultipleAssignments(cluster)" class="submit-button btn btn-primary" role="button">Manually Set Partition Assignments</a>
                    </td>
                    <td>
                        <a href="@routes.ReassignPartitions.runMultipleAssignments(cluster)" class="submit-button btn btn-primary" role="button">Run Partition Assignments</a>
                    </td>
                    <td>
                        <a href="@routes.Topic.addPartitionsToMultipleTopics(cluster)" class="submit-button btn btn-primary" role="button">Add Partitions</a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
    <div class="col-md-12">
        <div class="panel panel-default">
            <div class="panel-heading"><h3>Topics</h3></div>
            @errorOrTopics.fold( 
                views.html.errors.onApiError(_),
                tl => views.html.topic.topicListContent(cluster,tl.list.map(t => (t, tl.deleteSet(t._1))), tl.underReassignments, tl.list.head._2.map(ti => ti.clusterConfig.displaySizeEnabled).getOrElse(false)))
        </div>
    </div>
}
<commit_msg>use headOption in case of no topics<commit_after>@*
* Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0
* See accompanying LICENSE file.
*@
@import scalaz.{\/}
@(cluster:String, errorOrTopics: kafka.manager.ApiError \/ kafka.manager.TopicListExtended)

@theMenu = {
    @views.html.navigation.clusterMenu(cluster,"Topic","List",models.navigation.Menus.clusterMenus(cluster))
}

@topicScripts = {
    <script ype="text/javascript">
    $(document).ready(function() {
        $('#topics-table').DataTable();
    } );
    </script>
}

@main(
    "Topic List",
    menu = theMenu,
    breadcrumbs=views.html.navigation.breadCrumbs(models.navigation.BreadCrumbs.withViewAndCluster("Topics",cluster)),
    scripts=topicScripts) {
    <div class="col-md-12">
        <div class="panel panel-default">
            <div class="panel-heading"><h4>Operations</h4></div>
            <table class="table">
                <tr>
                    <td>
                        <a href="@routes.ReassignPartitions.confirmMultipleAssignments(cluster)" class="submit-button btn btn-primary" role="button">Generate Partition Assignments</a>
                    </td>
                    <td>
                        <a href="@routes.ReassignPartitions.manualMultipleAssignments(cluster)" class="submit-button btn btn-primary" role="button">Manually Set Partition Assignments</a>
                    </td>
                    <td>
                        <a href="@routes.ReassignPartitions.runMultipleAssignments(cluster)" class="submit-button btn btn-primary" role="button">Run Partition Assignments</a>
                    </td>
                    <td>
                        <a href="@routes.Topic.addPartitionsToMultipleTopics(cluster)" class="submit-button btn btn-primary" role="button">Add Partitions</a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
    <div class="col-md-12">
        <div class="panel panel-default">
            <div class="panel-heading"><h3>Topics</h3></div>
            @errorOrTopics.fold( 
                views.html.errors.onApiError(_),
                tl => views.html.topic.topicListContent(cluster,tl.list.map(t => (t, tl.deleteSet(t._1))), tl.underReassignments, tl.list.headOption.map(opt => opt._2.map(ti => ti.clusterConfig.displaySizeEnabled).getOrElse(false)).getOrElse(false)))
        </div>
    </div>
}

{'fraction_non_alphanumeric': 0.146158650843223, 'fraction_numerical': 0.006662502602540079, 'mean_word_length': 2.347735191637631, 'pattern_counts': {'":': 0, '<': 81, '<?xml version=': 0, '>': 88, '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': '2870651', 'n_tokens_mistral': 1442, 'n_tokens_neox': 1388, 'n_words': 227}