<commit_before><div xmlns="http://www.w3.org/1999/xhtml"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:p="http://primefaces.org/ui"
     xmlns:iqbs="http://xmlns.jcp.org/jsf/composite/iqbs">

    <!-- Navbar Panel -->
    <nav id="navbarFixed" class="navbar navbar-default navbar-fixed-top" role="navigation" style="margin-bottom:0;">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#topNavBar">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <h:outputText styleClass="navbar-brand" value="Dataverse App"/>
            </div>
            <div class="collapse navbar-collapse" id="topNavBar">

                <ul class="nav navbar-nav navbar-right">
                    <li class="dropdown">
                        <a value="#" class="dropdown-toggle" data-toggle="dropdown">
                            Search <b class="caret"></b>
                        </a>
                        <div class="dropdown-menu">
                            <form style="width:420px; padding:10px;">
                                <input style="display: inline-block;" type="text" size="40" value="" placeholder="Search the entire app..." autocomplete="off" class="ui-autocomplete-input ui-inputfield ui-widget ui-state-default ui-corner-all" aria-disabled="false" aria-readonly="false" aria-multiline="false"/>
                                <button style="margin-left:1em; display: inline-block;" type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="false">
                                    <span class="ui-button-text ui-c">Find</span>
                                </button>
                            </form>
                        </div>
                    </li>
                    <li>
                        <h:outputLink value="/guides/index.html" target="_blank">
                            User Guides
                        </h:outputLink>
                    </li>
                    <ui:fragment rendered="#{dataverseSession.user.guest}">
                        <li>
                            <h:outputLink value="/dataverseuser.xhtml?editMode=CREATE">
                                Create Account
                            </h:outputLink>
                        </li>
                    </ui:fragment>
                    <ui:fragment rendered="#{!dataverseSession.user.guest}">
                        <li>
                            <h:outputLink value="/dataverseuser.xhtml?editMode=INFO" >
                                <h:outputText value="#{dataverseSession.user.firstName} #{dataverseSession.user.lastName}" />
                            </h:outputLink>
                        </li>
                    </ui:fragment>
                    <ui:fragment rendered="#{dataverseSession.user.guest}">
                        <li>
                            <h:outputLink value="/loginpage.xhtml">
                                Log In
                            </h:outputLink>
                        </li>
                    </ui:fragment>
                    <ui:fragment rendered="#{not dataverseSession.user.guest}">
                        <h:form styleClass="navbar-form navbar-left" role="logout">
                            <h:commandButton value="Log Out" styleClass="btn btn-default" actionListener="#{dataverseSession.setUser(null)}"/>
                        </h:form>
                    </ui:fragment>
                </ul>
            </div>
        </div>
    </nav>
    
    <!-- Header Panel -->
    <div class="container" style="background:gold; margin:0 auto .5em auto; padding:2em 1em;">
        <a href="/dataverse.xhtml?id=#{dataverse.id}" style="font-size: 1.3em;">#{dataverse.name} Dataverse</a>
    </div>

    <!-- Breadcrumbs Panel -->
    <ui:fragment rendered="#{showBreadcrumbs}">
        <div id="breadcrumbNavBlock" class="container">
            <!-- Dataverses -->
            <ui:repeat value="#{dataverseHeaderFragment.getDataverses(dataverse)}" var="dv" varStatus="status">

                <h:outputText value=" > " styleClass="breadcrumbCarrot" rendered="#{!status.first}"/>

                <ui:fragment rendered="#{!empty dataverseServiceBean.findByOwnerId(dv.getId())}">

                    <div style="float:left; position:relative;">
                        <div class="dropdown">

                            <h:outputText id="breadcrumbLnk#{status.index}" value="#{dv.name} Dataverse" style="font-weight:bold;" rendered="#{dataverse.id == dv.id}"/>

                            <ui:fragment rendered="#{dataverse.id != dv.id}">
                                <a id="breadcrumbLnk#{status.index}" style="font-weight: #{dataverse.id == dv.id ? 'bold' : 'normal'}" role="button" data-toggle="dropdown" data-target="#" href="/dataverse.xhtml?id=#{dv.id}">
                                  <h:outputText value="#{dv.name} Dataverse"/> <span class="caret"></span>
                                </a>
                            </ui:fragment>

                            <div class="dropdown-menu" role="menu" aria-labelledby="breadcrumbLnk#{status.index}">
                                <p:tree value="#{dataverseHeaderFragment.getDataverseTree(dv)}" var="node" dynamic="true" cache="true" id="tree">
                                  <p:treeNode>
                                      <h:outputText value="#{node.name} Dataverse" style="font-weight:bold;" rendered="#{dataverse.id == node.id and dataset == null}"/>
                                      <h:outputLink value="/dataverse.xhtml?id=#{node.id}" rendered="#{dataverse.id != node.id or dataset != null}">
                                          <h:outputText value="#{node.name} Dataverse"/>
                                      </h:outputLink>
                                  </p:treeNode>
                              </p:tree>
                            </div>

                        </div>
                    </div>

                </ui:fragment>

                <ui:fragment rendered="#{empty dataverseServiceBean.findByOwnerId(dv.getId())}">
                    <h:outputText value="#{dv.name} Dataverse" style="font-weight:bold; padding-top:1px; margin-left:.2em; display:block; float:left;" rendered="#{dataverse.id == dv.id and dataset == null }"/>
                    <h:outputLink value="/dataverse.xhtml?id=#{dv.id}" style="padding-top:1px; display:block; float:left;" rendered="#{dataverse.id != dv.id or dataset != null}">
                        <h:outputText value="#{dv.name} Dataverse" style="font-weight: bold;"/>
                    </h:outputLink>
                </ui:fragment>

            </ui:repeat>

            <!-- Dataset, if available -->
            <ui:fragment rendered="#{!empty dataset.latestVersion.metadata.title}">
                <h:outputText value=" > " styleClass="breadcrumbCarrot"/>
                <h:outputText value="#{dataset.latestVersion.metadata.title}" style="float:left; font-weight:bold;"/>
            </ui:fragment>
        </div>
    </ui:fragment>

    <!-- Message Panel -->
    <ui:fragment rendered="#{showMessagePanel}">
        <div class="container">
            <iqbs:messages collapsible="false" />
        </div>
    </ui:fragment>

</div><commit_msg>cleaned up tree html and logic<commit_after><div xmlns="http://www.w3.org/1999/xhtml"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:p="http://primefaces.org/ui"
     xmlns:iqbs="http://xmlns.jcp.org/jsf/composite/iqbs">

    <!-- Navbar Panel -->
    <nav id="navbarFixed" class="navbar navbar-default navbar-fixed-top" role="navigation" style="margin-bottom:0;">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#topNavBar">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <h:outputText styleClass="navbar-brand" value="Dataverse App"/>
            </div>
            <div class="collapse navbar-collapse" id="topNavBar">

                <ul class="nav navbar-nav navbar-right">
                    <li class="dropdown">
                        <a value="#" class="dropdown-toggle" data-toggle="dropdown">
                            Search <b class="caret"></b>
                        </a>
                        <div class="dropdown-menu">
                            <form style="width:420px; padding:10px;">
                                <input style="display: inline-block;" type="text" size="40" value="" placeholder="Search the entire app..." autocomplete="off" class="ui-autocomplete-input ui-inputfield ui-widget ui-state-default ui-corner-all" aria-disabled="false" aria-readonly="false" aria-multiline="false"/>
                                <button style="margin-left:1em; display: inline-block;" type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="false">
                                    <span class="ui-button-text ui-c">Find</span>
                                </button>
                            </form>
                        </div>
                    </li>
                    <li>
                        <h:outputLink value="/guides/index.html" target="_blank">
                            User Guides
                        </h:outputLink>
                    </li>
                    <ui:fragment rendered="#{dataverseSession.user.guest}">
                        <li>
                            <h:outputLink value="/dataverseuser.xhtml?editMode=CREATE">
                                Create Account
                            </h:outputLink>
                        </li>
                    </ui:fragment>
                    <ui:fragment rendered="#{!dataverseSession.user.guest}">
                        <li>
                            <h:outputLink value="/dataverseuser.xhtml?editMode=INFO" >
                                <h:outputText value="#{dataverseSession.user.firstName} #{dataverseSession.user.lastName}" />
                            </h:outputLink>
                        </li>
                    </ui:fragment>
                    <ui:fragment rendered="#{dataverseSession.user.guest}">
                        <li>
                            <h:outputLink value="/loginpage.xhtml">
                                Log In
                            </h:outputLink>
                        </li>
                    </ui:fragment>
                    <ui:fragment rendered="#{not dataverseSession.user.guest}">
                        <h:form styleClass="navbar-form navbar-left" role="logout">
                            <h:commandButton value="Log Out" styleClass="btn btn-default" actionListener="#{dataverseSession.setUser(null)}"/>
                        </h:form>
                    </ui:fragment>
                </ul>
            </div>
        </div>
    </nav>

    <!-- Header Panel -->
    <div class="container" style="background:gold; margin:0 auto .5em auto; padding:2em 1em;">
        <a href="/dataverse.xhtml?id=#{dataverse.id}" style="font-size: 1.3em;">#{dataverse.name} Dataverse</a>
    </div>

    <!-- Breadcrumbs Panel -->
    <ui:fragment rendered="#{showBreadcrumbs}">
        <div id="breadcrumbNavBlock" class="container">
            <!-- Dataverses -->
            <ui:repeat value="#{dataverseHeaderFragment.getDataverses(dataverse)}" var="dv" varStatus="status">

                <h:outputText value=" > " styleClass="breadcrumbCarrot" rendered="#{!status.first}"/>


                <div style="float:left; position:relative;">
                    <div class="dropdown">

                        <h:outputText value="#{dv.name} Dataverse" style="font-weight: #{dataverse.id == dv.id ? 'bold' : 'normal'}"  rendered="#{dataverse.id == dv.id and dataset == null}"/>
                        <ui:fragment rendered="#{dataverse.id != dv.id or dataset != null}" >
                            <a id="breadcrumbLnk#{status.index}" href="/dataverse.xhtml?id=#{dv.id}">
                                <h:outputText value="#{dv.name} Dataverse"/>
                            </a>
                        </ui:fragment>
                        
                        <a id="breadcrumbLnkTree#{status.index}" style="font-weight: #{dataverse.id == dv.id ? 'bold' : 'normal'}" role="button" data-toggle="dropdown" data-target="#" rendered="#{!empty dataverseServiceBean.findByOwnerId(dv.getId())}">
                            <span class="caret"></span>
                        </a>

                        <div class="dropdown-menu" role="menu" aria-labelledby="breadcrumbLnk#{status.index}" rendered="#{!empty dataverseServiceBean.findByOwnerId(dv.getId())}">
                            <p:tree value="#{dataverseHeaderFragment.getDataverseTree(dv)}" var="node"  cache="true" id="tree">
                                <p:treeNode>
                                    <h:outputText value="#{node.name} Dataverse" style="font-weight:bold;" rendered="#{dataverse.id == node.id and dataset == null}"/>
                                    <h:outputLink value="/dataverse.xhtml?id=#{node.id}" rendered="#{dataverse.id != node.id or dataset != null}">
                                        <h:outputText value="#{node.name} Dataverse"/>
                                    </h:outputLink>
                                </p:treeNode>
                            </p:tree>
                        </div>
                    </div>
                </div>

            </ui:repeat>

            <!-- Dataset, if available -->
            <ui:fragment rendered="#{!empty dataset.latestVersion.metadata.title}">
                <h:outputText value=" > " styleClass="breadcrumbCarrot"/>
                <h:outputText value="#{dataset.latestVersion.metadata.title}" style="float:left; font-weight:bold;"/>
            </ui:fragment>
        </div>
    </ui:fragment>

    <!-- Message Panel -->
    <ui:fragment rendered="#{showMessagePanel}">
        <div class="container">
            <iqbs:messages collapsible="false" />
        </div>
    </ui:fragment>

</div>
{'fraction_non_alphanumeric': 0.15220905172413793, 'fraction_numerical': 0.002896012931034483, 'mean_word_length': 1.5518130262931775, 'pattern_counts': {'":': 0, '<': 241, '<?xml version=': 0, '>': 245, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 14}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 15, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2963461', 'n_tokens_mistral': 4045, 'n_tokens_neox': 3824, 'n_words': 634}