<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:c="http://java.sun.com/jsp/jstl/core"
     xmlns:p="http://primefaces.org/ui"
     xmlns:o="http://omnifaces.org/ui">

    <!-- Search Form -->
    <p:panel styleClass="panelLayoutBlock panelSerchForm" rendered="#{showSearch == true}">
        <p:panelGrid styleClass="panelgridLayoutTable" columns="2" columnClasses="text-left,text-right">
            <ui:fragment>
                <h:form>
                    <p:focus/>
                    <!--autocomplete disabled for now, too buggy: https://redmine.hmdc.harvard.edu/issues/3447#note-2 -->
                    <!--<p:autoComplete id="autoCompleteSearch" size="40" value="SearchIncludeFragment.query" completeMethod="autoCompleteBean.complete" style="margin-right:1em;"/>-->
                    <p:inputText id="formerAutoCompleteSearch" size="40" value="#{SearchIncludeFragment.query}" onkeypress="if (event.keyCode == 13) { submitsearch(); return false; }"/>
                    <p:watermark for="formerAutoCompleteSearch" value="Search this Dataverse..."/>
                    <p:commandLink id="searchbutton" styleClass="btn btn-default" action="#{SearchIncludeFragment.searchRedirect(dataverseRedirectPage)}">
                        <span class="glyphicon glyphicon-search"/> Find
                    </p:commandLink>
                    <p:remoteCommand name="submitsearch" action="#{SearchIncludeFragment.searchRedirect(dataverseRedirectPage)}"/>                  
                    <h:outputLink id="advsearchlink" value="/search/advanced.xhtml" target="#{showFacets == true ? '_self' : '_blank'}" rendered="#{showAdvancedSearchLink}">
                        <h:outputText value="Advanced Search"/>
                        <!--<f:param name="q" value="#{SearchIncludeFragment.query}" disable="#{empty SearchIncludeFragment.query}"/>-->
                    </h:outputLink>
                </h:form>
            </ui:fragment>
            
            <o:importFunctions type="edu.harvard.iq.dataverse.authorization.groups.impl.AuthenticatedUsers" />
            <ui:fragment rendered="#{!dataverseSession.user.authenticated and (permissionServiceBean.userOn(AuthenticatedUsers:get(),SearchIncludeFragment.dataverse).canIssueCommand('CreateDataverseCommand')
                                     or permissionServiceBean.userOn(AuthenticatedUsers:get(),SearchIncludeFragment.dataverse).canIssueCommand('CreateDatasetCommand'))}">
                
                <div style="float:right;">
                    <button type="button" class="btn btn-default" onclick="addData_popup.show()">
                        <span class="glyphicon glyphicon-plus"/> Add Data <span class="caret"></span>
                    </button>
                </div>
                <p:confirmDialog header="Add Data" widgetVar="addData_popup">                                           
                    <f:facet name="message">
                        You need to <a href="/dataverseuser.xhtml#{dataverseHeaderFragment.loginRedirectPage}&amp;editMode=CREATE">Sign Up</a>
                        or <a href="/loginpage.xhtml#{dataverseHeaderFragment.loginRedirectPage}">Log In</a> to create a dataverse or add a dataset.
                    </f:facet>
                </p:confirmDialog>  
            </ui:fragment>

            <ui:fragment rendered="#{dataverseSession.user.authenticated and (permissionServiceBean.on(SearchIncludeFragment.dataverse).canIssueCommand('CreateDataverseCommand')
                                     or permissionServiceBean.on(SearchIncludeFragment.dataverse).canIssueCommand('CreateDatasetCommand'))}">
                <h:form id="shareForm">
                    <div class="btn-group">
                        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                            <span class="glyphicon glyphicon-plus"/> Add Data <span class="caret"></span><commit_msg>Added new AllowSignUp logic to the Sign Up link in the Add Data button on the Dataverse page when a guest is viewing the page, or you aren't logged in. [ref #988]<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:c="http://java.sun.com/jsp/jstl/core"
     xmlns:p="http://primefaces.org/ui"
     xmlns:o="http://omnifaces.org/ui">

    <!-- Search Form -->
    <p:panel styleClass="panelLayoutBlock panelSerchForm" rendered="#{showSearch == true}">
        <p:panelGrid styleClass="panelgridLayoutTable" columns="2" columnClasses="text-left,text-right">
            <ui:fragment>
                <h:form>
                    <p:focus/>
                    <!--autocomplete disabled for now, too buggy: https://redmine.hmdc.harvard.edu/issues/3447#note-2 -->
                    <!--<p:autoComplete id="autoCompleteSearch" size="40" value="SearchIncludeFragment.query" completeMethod="autoCompleteBean.complete" style="margin-right:1em;"/>-->
                    <p:inputText id="formerAutoCompleteSearch" size="40" value="#{SearchIncludeFragment.query}" onkeypress="if (event.keyCode == 13) { submitsearch(); return false; }"/>
                    <p:watermark for="formerAutoCompleteSearch" value="Search this Dataverse..."/>
                    <p:commandLink id="searchbutton" styleClass="btn btn-default" action="#{SearchIncludeFragment.searchRedirect(dataverseRedirectPage)}">
                        <span class="glyphicon glyphicon-search"/> Find
                    </p:commandLink>
                    <p:remoteCommand name="submitsearch" action="#{SearchIncludeFragment.searchRedirect(dataverseRedirectPage)}"/>                  
                    <h:outputLink id="advsearchlink" value="/search/advanced.xhtml" target="#{showFacets == true ? '_self' : '_blank'}" rendered="#{showAdvancedSearchLink}">
                        <h:outputText value="Advanced Search"/>
                        <!--<f:param name="q" value="#{SearchIncludeFragment.query}" disable="#{empty SearchIncludeFragment.query}"/>-->
                    </h:outputLink>
                </h:form>
            </ui:fragment>
            
            <o:importFunctions type="edu.harvard.iq.dataverse.authorization.groups.impl.AuthenticatedUsers" />
            <ui:fragment rendered="#{!dataverseSession.user.authenticated and (permissionServiceBean.userOn(AuthenticatedUsers:get(),SearchIncludeFragment.dataverse).canIssueCommand('CreateDataverseCommand')
                                     or permissionServiceBean.userOn(AuthenticatedUsers:get(),SearchIncludeFragment.dataverse).canIssueCommand('CreateDatasetCommand'))}">
                
                <div style="float:right;">
                    <button type="button" class="btn btn-default" onclick="addData_popup.show()">
                        <span class="glyphicon glyphicon-plus"/> Add Data <span class="caret"></span>
                    </button>
                </div>
                <p:confirmDialog header="Add Data" widgetVar="addData_popup">                                           
                    <f:facet name="message">
                        You need to 
                        <ui:fragment rendered="#{dataverseHeaderFragment.signupAllowed}">
                            <a href="/dataverseuser.xhtml#{dataverseHeaderFragment.loginRedirectPage}&amp;editMode=CREATE">Sign Up</a> or 
                        </ui:fragment>
                        <a href="/loginpage.xhtml#{dataverseHeaderFragment.loginRedirectPage}">Log In</a> to create a dataverse or add a dataset.
                    </f:facet>
                </p:confirmDialog>  
            </ui:fragment>

            <ui:fragment rendered="#{dataverseSession.user.authenticated and (permissionServiceBean.on(SearchIncludeFragment.dataverse).canIssueCommand('CreateDataverseCommand')
                                     or permissionServiceBean.on(SearchIncludeFragment.dataverse).canIssueCommand('CreateDatasetCommand'))}">
                <h:form id="shareForm">
                    <div class="btn-group">
                        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                            <span class="glyphicon glyphicon-plus"/> Add Data <span class="caret"></span>
{'fraction_non_alphanumeric': 0.13667372382968712, 'fraction_numerical': 0.0045871559633027525, 'mean_word_length': 2.366191607284244, 'pattern_counts': {'":': 0, '<': 101, '<?xml version=': 0, '>': 101, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 14}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2393145', 'n_tokens_mistral': 2277, 'n_tokens_neox': 2144, 'n_words': 345}