{% if not main_content_class %}
    {% set main_content_class = "withLoadingIndicator" %}
{% endif %}

{% extends "3-columns-split-both-sidebars.html" %}

{% if corpus_name %}
    {% block nav %}
        <div class="btn-group">
            <a href="{{ url_for("corpus_view_by_name", corpus_name=corpus_name) }}" class="btn btn-primary" type="button">
                {{ corpus_name }}
            </a>
            <button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
                <span class="caret" style="border-top-color: #fff; border-bottom-color: #fff;"></span>
            </button>
            <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu">
            {% for model in models|sort %}
                <li{% if model == corpus_name %} class="disabled"{% endif %}>
                    <a tabindex="-1" href="{{ url_for("corpus_view_by_name", corpus_name=model) }}">{{ model }}</a>
                </li>
            {% endfor %}
            </ul>
        </div>
        <span class="text">/</span>
    {% endblock %}
{% endif %}

{% block nav_extra %}
    <a id="settings" href="#settingsModal" data-toggle="modal" class="btn pull-right">
        <i class="icon-wrench"></i>
    </a>
    <a id="openRankViewer" class="btn pull-right">RankViewer</a>
    <!-- Actual modal div located at top of sidebar_content block -->
{% endblock %}

{% block left_sidebar_top_navbar %}
    <span class="brand">Topic controls</span>
    <div class="btn-group pull-right" data-toggle="buttons-radio">
        <button id="toggleColorByColBtn" class="{{ btn_class }}" type="button"><i class="icon-th-large"></i></button>
    </div>
{% endblock %}

{% block left_sidebar_top_content %}
    <div class="accordion" id="topicAccordion">
        <div class="accordion-group">
            <div class="accordion-heading">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="topicAccordion" href="#topicSortCollapse">
                    Sorting
                </a>
            </div>
            <div id="topicSortCollapse" class="accordion-body collapse">
                <div class="accordion-inner">
                    <select id="topicSortSelect" class="input-small">
                        <option>None</option>
                    </select>
                    <br />
                    <p>
                    <a id="topicCustomOrder" class="btn {{ btn_size_class }}" href="#topicCustomOrderModal" data-toggle="modal">Custom Order</a>
                    </p>
                    <div id="topicCustomOrderModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="topicCustomOrderModalLabel" aria-hidden="true">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                            <h3 id="topicCustomOrderModalLabel">Custom topic ordering</h3>
                        </div>
                        <div class="modal-body">
                            <p>Input comma-delimited order:</p>
                            <form>
                                <input id="topicCustomOrderInput" type="txt" class="input-big"> </input>
                            </form>
                        </div>
                        <div class="modal-footer">
                            <button class="btn {{ btn_size_class }}" data-dismiss="modal" aria-hidden="true">Cancel</button>
                            <button id="topicCustomOrderSubmit" class="btn btn-primary">Order</button>
                        </div>
                    </div>
                    <p>
                    <a id="anovaOrder" class="btn {{ btn_size_class }}" href="#anovaOrderModal" data-toggle="modal">Order by ANOVA</a>
                    </p>
                    <div id="anovaOrderModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="anovaOrderModalLabel" aria-hidden="true">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                            <h3 id="anovaOrderModalLabel">Order by ANOVA</h3>
                        </div>
                        <div class="modal-body">
                            <p>Select metadata field to use for ANOVA ordering:</p>
                            <select id="anovaOrderSelect" class="input-small">
                            </select>
                        </div>
                        <div class="modal-footer">
                            <button class="btn {{ btn_size_class }}" data-dismiss="modal" aria-hidden="true">Cancel</button>
                            <button id="anovaOrderSubmit" class="btn btn-primary">Order</button>
                        </div>
                    </div>
                    <p>
                    <a id="contrastOrder" class="btn {{ btn_size_class }}" href="#contrastOrderModal" data-toggle="modal">Order by Contrast</a>
                    </p>
                    <div id="contrastOrderModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="contrastOrderModalLabel" aria-hidden="true">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                            <h3 id="contrastOrderModalLabel">Order by contrast between categories</h3>
                        </div>
                        <div class="modal-body">
                            <p>Select metadata field to use for contrast ordering:</p>
                            <select id="contrastOrderSelect" class="input-small">
                            </select>
                            <p>Select categories to be contrasted:</p>
                            <select id="contrastGroup1Select" class="contrastGroup input-small">
                            </select>
                            <select id="contrastGroup2Select" class="contrastGroup input-small">
                            </select>
                        </div>
                        <div class="modal-footer">
                            <button class="btn {{ btn_size_class }}" data-dismiss="modal" aria-hidden="true">Cancel</button>
                            <button id="contrastOrderSubmit" class="btn btn-primary">Order</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="accordion-group">
            <div class="accordion-heading">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="docAccordion" href="#topicSelectCollapse">
                    Selection
                </a>
            </div>
            <div id="topicSelectCollapse" class="accordion-body collapse in">
                <div class="accordion-inner">
                    <div id="topicAdvancedSelectModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="topicAdvancedSelectModalLabel" aria-hidden="true">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                            <h3 id="topicAdvancedSelectModalLabel">Advanced Select</h3>
                        </div>
                        <div class="modal-body">
                            <p>Select topics with these properties:</p>
                            <form id="topicAdvancedSelectBody">

                            </form>
                        </div>
                        <div class="modal-footer">
                            <button class="btn {{ btn_size_class }}" data-dismiss="modal" aria-hidden="true">Cancel</button>
                            <button id="topicAdvancedSelectSubmit" class="btn btn-primary">Select</button>
                        </div>
                    </div>
                    <div class="btn-group">
                        <a id="topicAdvancedSelect" class="btn {{ btn_size_class }} btn-primary disabled" href="#topicAdvancedSelectModal" data-toggle="modal">Advanced Select</a>
                        <a id="clearColSelection" class="btn {{ btn_size_class }}"><i class="icon-remove"></i></a>
                        <a id="loadTopicSelection" class="btn {{ btn_size_class }}"><i class="icon-download"></i></a>
                        <a id="saveTopicSelection" class="btn {{ btn_size_class }}"><i class="icon-save"></i></a>
                    </div>
                    <pre id="selectedCols" class="pre-scrollable" style="max-height: 200px;">No topics selected</pre>
                    <div class="btn-group">
                        <a id="topicColorSelection" class="btn {{ btn_size_class }} btn-info" data-toggle="popover"><i class="icon-th-large"></i></a>
                        <a id="sortDocsBySelection" class="btn {{ btn_size_class }}"><i class="icon-sort"></i></a>
                        <a id="moveSelectionToLeft" class="btn {{ btn_size_class }}"><div class="rotate"><i class="icon-sort-up"></i></div></a>
                        <a id="sortTopicsByDist" class="btn {{ btn_size_class }}"><div class="rotate"><i class="icon-sort"></i></div></a>
                        <a id="hideTopicSelection" class="btn {{ btn_size_class }}"><i class="icon-eye-close"></i></a>
                        <a id="hideAllTopicsButSelection" class="btn {{ btn_size_class }}"><i class="icon-zoom-in"></i></a>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}

{% block left_sidebar_bottom_navbar %}
    <span class="brand">Document controls</span>
    <div class="btn-group pull-right" data-toggle="buttons-radio">
        <button id="toggleColorByRowBtn" class="{{ btn_class }} active" type="button" data-toggle="buttons-radio"><i class="icon-th-large"></i></button>
    </div>
{% endblock %}

{% block left_sidebar_bottom_content %}
    <!-- This modal isn't actually in the sidebar, but it needed the sidebar's CSS to show up over the fade -->
    <div id="settingsModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="settingsModalLabel" aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h3 id="settingsModalLabel">Settings</h3>
        </div>
        <div class="modal-body">
            <h4>Document Labels</h4>
            <label class="radio">
                <input type="radio" name="docLabelsRadios" id="autoDocLabels" value="option1" checked>
                Auto-generate document labels
            </label>
            <label class="radio">
                <input type="radio" name="docLabelsRadios" id="metadataDocLabels" value="option2">
                Label documents with metadata
            </label>
            <select id="metadataDocLabelSelect" class="input-small">
            </select>
            <h4>Topic Representation</h4>
            <p>Number of words to display:</p>
            <p><input id="numWordsInput" type="txt"></p>
            <p>Ranking type:</p>
            <p>
            <div class="radio" id="rankingTypeRadioGroup">
                <label class="radio">
                    <input type="radio" name="rankingType" id="freq">
                    Rank by frequency
                </label>
                <label class="radio">
                    <input type="radio" name="rankingType" id="sal" checked>
                    Rank by saliency
                </label>
                <label class="radio">
                    <input type="radio" name="rankingType" id="ig">
                    Rank by information gain
                </label>
            </div>
            </p>
            <h4>Aggregation glyphs</h4>
            <p>Scale factor for aggregate glyphs (must be between 1 and 5):</p>
            <p><input id="aggSizeFactorInput" type="txt"></p>
        </div>
    </div>
    <!-- Now beginning actual sidebar content. -->
    <div class="accordion" id="docAccordion">
        <div class="accordion-group">
            <div class="accordion-heading">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="docAccordion" href="#sortCollapse">
                    Sorting
                </a>
            </div>
            <div id="sortCollapse" class="accordion-body collapse">
                <div class="accordion-inner">
                    <h6>By metadata</h6>
                    <select id="sortSelect" class="input-small">
                        <option value='None'>None</option>
                    </select>
                    <h6>By nth topic size</h6>
                    <select id="sortByNthTopicSelect" class="input-small">
                        <option value="-1">None</option>
                        <option value="0">First</option>
                        <option value="1">Second</option>
                        <option value="2">Third</option>
                        <option value="3">Fourth</option>
                        <option value="4">Fifth</option>
                    </select>
                    <br />
                    <a id="docCustomOrder" class="btn {{ btn_size_class }}" href="#docCustomOrderModal" data-toggle="modal">Custom Order</a>
                    <div id="docCustomOrderModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="docCustomOrderModalLabel" aria-hidden="true">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                            <h3 id="docCustomOrderModalLabel">Custom document ordering</h3>
                        </div>
                        <div class="modal-body">
                            <p>Input comma-delimited order:</p>
                            <form>
                                <input id="docCustomOrderInput" type="txt" class="input-big"> </input>
                            </form>
                        </div>
                        <div class="modal-footer">
                            <button class="btn {{ btn_size_class }}" data-dismiss="modal" aria-hidden="true">Cancel</button>
                            <button id="docCustomOrderSubmit" class="btn btn-primary">Order</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="accordion-group">
            <div class="accordion-heading">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="docAccordion" href="#aggCollapse">
                    Aggregation
                </a>
            </div>
            <div id="aggCollapse" class="accordion-body collapse">
                <div class="accordion-inner">
                    <select id="aggregateSelect" class="input-small">
                        <option>None</option>
                    </select>
                    <div id="clearAggDiv"><a id="clearAggregation" class="btn {{ btn_size_class }}">Clear</a></div>
                </div>
                <div id="aggIntModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labeledby="aggIntModalLabel" aria-hidden="true">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                        <h3 id="aggIntModalLabel">Aggregate by numerical metadata</h3>
                    </div>
                    <div class="modal-body">
                        Aggregate in chunks of <input id="aggChunkSize" type="txt" class="input-small"> </input> starting from <input id="aggStartingFrom" type="txt" class="input-small"> </input>
                    </div>
                    <div class="modal-footer">
                        <button class="btn {{ btn_size_class }}" data-dismiss="modal" aria-hidden="true">Cancel</button>
                        <button id="aggIntSubmit" class="btn {{ btn_size_class }} btn-primary">Aggregate</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="accordion-group">
            <div class="accordion-heading">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="docAccordion" href="#filterCollapse">
                    Filtering
                </a>
            </div>
            <div id="filterCollapse" class="accordion-body collapse">
                <div class="accordion-inner">
                    <a id="addFilter" href="#addFilterModal" data-toggle="modal" class="btn {{ btn_size_class }}btn-primary"><!--<i class="icon-plus icon-white"></i>-->+ Add</a>
                    <div id="addFilterModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                            <h3 id="myModalLabel">Add filter</h3>
                        </div>
                        <div class="modal-body">
                            <p>Filter documents with these properties:</p>
                            <form id="addFilterBody">

                            </form>
                        </div>
                        <div class="modal-footer">
                            <button class="btn {{ btn_size_class }}" data-dismiss="modal" aria-hidden="true">Cancel</button>
                            <button id="addFilterSubmit" class="btn {{ btn_size_class }} btn-primary">Add</button>
                        </div>
                    </div>
                    <div id="filterWell" class="well well-small">
                        <!--No active filters-->
                    </div>
                </div>
            </div>
        </div>
        <div class="accordion-group">
            <div class="accordion-heading">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="docAccordion" href="#selectCollapse">
                    Selection
                </a>
            </div>
            <div id="selectCollapse" class="accordion-body collapse in">
                <div class="accordion-inner">
                    <div id="advancedSelectModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="advancedSelectModalLabel" aria-hidden="true">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                            <h3 id="advancedSelectModalLabel">Advanced Select</h3>
                        </div>
                        <div class="modal-body">
                            <p>Select documents with these properties:</p>
                            <form id="advancedSelectBody">

                            </form>
                        </div>
                        <div class="modal-footer">
                            <button class="btn {{ btn_size_class }}" data-dismiss="modal" aria-hidden="true">Cancel</button>
                            <button id="advancedSelectSubmit" class="btn btn-primary">Select</button>
                        </div>
                    </div>
                    <div class="btn-group">
                        <a id="advancedSelect" class="btn {{ btn_size_class }} btn-primary" href="#advancedSelectModal" data-toggle="modal">Advanced Select</a>
                        <a id="clearRowSelection" class="btn {{ btn_size_class }}"><i class="icon-remove"></i></a>
                        <a id="loadSelection" class="btn {{ btn_size_class }}"><i class="icon-download"></i></a>
                        <a id="saveSelection" class="btn {{ btn_size_class }}"><i class="icon-save"></i></a>
                    </div>
                    <pre id="selectedRows" class="pre-scrollable" style="max-height: 200px;">No documents selected</pre>
                    <div class="btn-group">
                        <a id="colorSelection" class="btn {{ btn_size_class }} btn-info" data-toggle="popover"><i class="icon-th-large"></i></a>
                        <a id="sortBySelection" class="btn {{ btn_size_class }}"><div class="rotate"><i class="icon-sort"></i></div></a>
                        <a id="moveSelectionToTop" class="btn {{ btn_size_class }}"><i class="icon-sort-up"></i></a>
                        <a id="sortDocsByDist" class="btn {{ btn_size_class }}"><i class="icon-sort"></i></a>
                        <a id="hideSelection" class="btn {{ btn_size_class }}"><i class="icon-eye-close"></i></a>
                        <a id="hideAllButSelection" class="btn {{ btn_size_class }}"><i class="icon-zoom-in"></i></a>
                        <!--<a id="openSelectionInMeso" class="btn {{ btn_size_class }}"><i class="icon-folder-open"></i></a>-->
                    </div>
                </div>
            </div>
        </div>
        <div class="accordion-group">
            <div class="accordion-heading">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="docAccordion" href="#colorCollapse">
                    Coloring by metadata
                </a>
            </div>
            <div id="colorCollapse" class="accordion-body collapse">
                <div class="accordion-inner">
                    <select id="colorByMetadataSelect" class="input-small">
                        <option>None</option>
                    </select>
                    <div><a id="colorByMetadataSubmit" class="btn {{ btn_size_class }} btn-primary">Color</a></div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}

{% block main_navbar %}
    <span class="brand" id="matrixViewBreadcrumbs">
        <!--<a href="#">Model</a> / <a href="#">Aggregating by: Genre</a> / Genre: Argumentation-->
        Model
    </span>
    <div class="btn-group pull-right">
        <button id="hideEmptyTopics" class="{{ btn_class }}" type="button">Hide Empty Topics</button>
        <button id="resetColors" class="{{ btn_class }}" type="button">Reset Colors</button>
        <button id="resetOrders" class="{{ btn_class }}" type="button">Reset Data</button>
    </div>
{% endblock %}

{% block main_content %}
    <div id="renameTopicModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="renameTopicModalLabel" aria-hidden="true">
        <div class="modal-header">
            <button id="renameTopicDismiss" type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h3 id="renameTopicModalLabel">Rename Topic</h3>
        </div>
        <div class="modal-body">
            <p>New name:</p>
            <p><input id="newTopicName" type="txt"></p>
        </div>
        <div class="modal-footer">
            <button type="button" id="renameTopicCancel" class="btn {{ btn_size_class }}" data-dismiss="modal" aria-hidden="true">Cancel</button>
            <button type="button" id="renameTopicSubmit" class="btn {{ btn_size_class }} btn-primary">Rename</button>
        </div>
    </div>
    <div id="nameGroupModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="nameGroupModalLabel" aria-hidden="true">
        <div class="modal-header">
            <button id="nameGroupDismiss" type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h3 id="nameGroupModalLabel">Name group</h3>
        </div>
        <div class="modal-body">
            <p>Name:</p>
            <p><input id="groupName" type="txt"></p>
        </div>
        <div class="modal-footer">
            <button id="nameGroupCancel" class="btn {{ btn_size_class }}" data-dismiss="modal" aria-hidden="true">Cancel</button>
            <button id="nameGroupSubmit" class="btn {{ btn_size_class }} btn-primary">Name</button>
        </div>
    </div>
    <div id="loadGroupModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="loadGroupModalLabel" aria-hidden="true">
        <div class="modal-header">
            <button id="loadGroupDismiss" type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h3 id="loadGroupModalLabel">Name group</h3>
        </div>
        <div class="modal-body">
            <p>Group to load:</p>
            <p><select id="loadGroupSelect"></select></p>
        </div>
        <div class="modal-footer">
            <button id="loadGroupCancel" class="btn {{ btn_size_class }}" data-dismiss="modal" aria-hidden="true">Cancel</button>
            <button id="loadGroupSubmit" class="btn {{ btn_size_class }} btn-primary">Load</button>
        </div>
    </div>
    <div id="matrixView">
        Corpus matrix here
    </div>
{% endblock %}

{% block right_sidebar_top_navbar %}
    <span class="brand" id="topicViewTitle">Topic <span id="selectedTopicNum"></span></span>
    <a id="hideSelectedTopic" class="pull-right close">&times;</a>
    <ul class="nav pull-right">
        <li><a href="#topicMetadataTab" data-toggle="tab">Metadata</a></li>
        <li class="active"><a href="#topicView" data-toggle="tab">Distribution</a></li>
    </ul>
{% endblock %}

{% block right_sidebar_top_content %}
    <div class="tab-content">
        <div class="tab-pane" id="topicMetadataTab">
            No topic selected.
        </div>
        <div class="tab-pane active" id="topicView">
            No topic selected.
        </div>
    </div>
{% endblock %}

{% block right_sidebar_bottom_navbar %}
    <span class="brand" id="docViewTitle"><span id="docViewTypeLabel">Document</span> <span id="selectedDocNum"></span></span>
    <a id="hideSelectedDoc" class="pull-right close">&times;</a>
    <ul class="nav pull-right">
        <li id="docMetadataLI" class="active"><a href="#docMetadataTab" data-toggle="tab">Metadata</a></li>
        <li id="aggregateListLI" style="display: none;"><a href="#aggregateListTab" data-toggle="tab">Documents</a></li>
        <li id="docTopicLayoutLI"><a href="#docTopicLayoutTab" data-toggle="tab">Graph</a></li>
        <li id="topicCountsLI"><a href="#topicCountsTab" data-toggle="tab">Counts</a></li>
    </ul>
{% endblock %}

{% block right_sidebar_bottom_content %}
    <div class="tab-content">
        <div class="tab-pane active" id="docMetadataTab">
            No document selected.
        </div>
        <div class="tab-pane" id="aggregateListTab">
            No documents selected.
        </div>
        <div class="tab-pane" id="docTopicLayoutTab">
            No document selected.
        </div>
        <div class="tab-pane" id="topicCountsTab">
            No document selected.
        </div>
    </div>
{% endblock %}

{% block floating_divs %}
    <ul id="rowContextMenu" class="dropdown-menu contextmenu" role="menu" aria-labelledby="dropdownMenu">
        <li><a id="sortByRow" tabindex="-1">Sort by this row</a></li>
        <li class="dropdown-submenu">
            <a id="colorRow" tabindex="-1">Color this row</a>
            <ul id="rowColorDropdown" class="dropdown-menu">
            </ul>
        </li>
        <li><a id="sortByDistFromRow" tabindex="-1">Sort rows by distance from this</a></li>
        <li class="divider"></li>
        <li><a id="hideRow" tabindex="-1">Hide this row</a></li>
        <li class="disabled"><a id="openGroup" tabindex="-1">Open group</a></li>
        <li class="disabled"><a id="openGroupInMeso" tabindex="-1">Open group in MesoViewer</a> </li>
        <li class="divider"></li>
        <li><a id="openInTextViewer" tabindex="-1">Open in TextViewer</a></li>
    </ul>
    <ul id="colContextMenu" class="dropdown-menu contextmenu" role="menu" aria-labelledby="dropdownMenu">
        <li><a id="sortByCol" tabindex="-1">Sort by this column</a></li>
        <li class="dropdown-submenu">
            <a id="colorCol" tabindex="-1">Color this column</a>
            <ul id="colColorDropdown" class="dropdown-menu">
            </ul>
        </li>
        <li><a id="sortByDistFromCol" tabindex="-1">Sort cols by distance from this</a></li>
        <li class="divider"></li>
        <li><a id="hideCol" tabindex="-1">Hide this column</a></li>
        <li><a id="renameCol" tabindex="-1" href="#renameTopicModal" data-toggle="modal">Rename this column</a></li>
    </ul>
{% endblock %}

{% block scripts %}
    <script type="text/javascript">
        $METADATA_URL = "{{ url_for('corpus_get_metadata', corpus_name=corpus_name) }}";
        $THETA_URL = "{{ url_for('corpus_get_theta', corpus_name=corpus_name) }}";
        corpus_name = "{{ corpus_name|safe }}";
    </script>
    <script type="text/javascript" src="{{ url_for("static", filename="js/Utils.js") }}"></script>
    <script type="text/javascript" src="{{ url_for("static", filename="js/CorpusViewer.js") }}"></script>
    <script type="text/javascript" src="{{ url_for("static", filename="js/CorpusViewer_responsive.js") }}"></script>
{% endblock %}
