<commit_before><!DOCTYPE html>
<html 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:jsf="http://xmlns.jcp.org/jsf">

    <h:head>
    </h:head>

    <h:body>
        <f:metadata>
            <f:viewParam name="redirectPage" value="#{LoginPage.redirectPage}"/>
            <f:viewParam name="provider" value="#{LoginPage.provider}"/>
            <f:viewAction action="#{LoginPage.init}"/>
        </f:metadata>
        <ui:composition template="/dataverse_template.xhtml">
            <ui:param name="pageTitle" value="#{bundle.login} - #{dataverseServiceBean.findRootDataverse().name} #{bundle.dataverse}"/>
            <ui:param name="showDataverseHeader" value="false"/>
            <ui:param name="showMessagePanel" value="#{true}"/>
            <ui:param name="loginRedirectPage" value="dataverse.xhtml"/>
            <ui:define name="body">
                <ui:fragment rendered="#{not LoginPage.authenticationProvidersAvailable}">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="alert alert-danger">
                                <h:outputFormat value="#{bundle['authenticationProvidersAvailable.tip']}" escape="false">
                                    <f:param value="&lt;h3&gt;"/>
                                    <f:param value="&lt;/h3&gt;"/>
                                    <f:param value="&lt;br /&gt;"/>
                                </h:outputFormat>
                            </div>
                        </div>
                    </div>
                </ui:fragment>
                <div id="login-container" class="row">

                    <div class="col-md-12">
                        <div class="col-md-6 col-md-offset-3">
                            <h2><span class="glyphicon glyphicon-log-in" /> Log In</h2>
                            
                            <div id="builtinProvider" jsf:rendered="#{LoginPage.provider == 'builtin'}">
                                <h:form id="loginForm" styleClass="form-horizontal">
                                    <h2 class="no-margin-top">#{bundle['auth.providers.title.builtin']}</h2>
                                    <p:focus context="loginForm"/>
                                    <ui:remove>
                                        <ui:fragment rendered="#{LoginPage.multipleProvidersAvailable}">
                                            <div class="form-group text-left">
                                                <label class="col-sm-4 control-label" for="loginSystemSelect">
                                                    #{bundle['login.System']}
                                                </label>
                                                <div class="col-sm-8">
                                                    <h:selectOneMenu id="loginSystemSelect" styleClass="form-control" value="#{LoginPage.credentialsAuthProviderId}">
                                                        <f:selectItems value="#{LoginPage.listCredentialsAuthenticationProviders()}" var="ap"
                                                                       itemLabel="#{ap.title}" itemValue="#{ap.id}" />
                                                        <f:ajax render="@all" listener="#{LoginPage.resetFilledCredentials}"/>
                                                    </h:selectOneMenu>
                                                </div>
                                            </div>
                                        </ui:fragment>
                                    </ui:remove>
                                    <ui:repeat id="credentialsContainer" value="#{LoginPage.filledCredentials}" var="fc">
                                        <div class="form-group text-left">
                                            <label class="col-sm-4 control-label" for="credValue">
                                                #{fc.credential.title}
                                            </label>
                                            <div class="col-sm-8">
                                                <h:inputText rendered="#{not fc.credential.secret}" value="#{fc.value}" id="credValue" styleClass="form-control"/>
                                                <p:message rendered="#{not fc.credential.secret}" for="credValue" display="text"/>
                                                <h:inputSecret rendered="#{fc.credential.secret}" value="#{fc.value}" id="sCredValue" styleClass="form-control"/>
                                                <p:message rendered="#{not fc.credential.secret}" for="sCredValue" display="text"/>
                                            </div>
                                        </div>
                                    </ui:repeat>
                                    <div class="form-group">
                                        <div class="col-sm-offset-4 col-sm-9 button-block">
                                            <p:commandButton id="login" value="#{bundle.login}" update="@all" action="#{LoginPage.login}"/>
                                            <p:button value="#{bundle.cancel}" outcome="/dataverse.xhtml?alias=#{dataverseServiceBean.findRootDataverse().alias}"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-offset-4 col-sm-9">
                                            <a href="passwordreset.xhtml">
                                                #{bundle['login.forgot.text']}
                                            </a>
                                        </div>
                                    </div>
                                </h:form>
                            </div>
                            <div id="remoteProvider" jsf:rendered="#{LoginPage.provider != 'builtin'}">
                                <ui:fragment rendered="#{(LoginPage.provider == 'shib') and (systemConfig.shibEnabled == true)}">
                                    <h2 class="no-margin-top">#{bundle['auth.providers.title.shib']}</h2>

                                    <h:form>
                                        <p class="help-block">
                                            <span class="glyphicon glyphicon-info-sign"/>
                                            <h:outputFormat value=" #{bundle['login.institution.blurb']} " escape="false">
                                                <f:param value="#{settingsWrapper.guidesBaseUrl}"/>
                                                <f:param value="#{systemConfig.version}"/>
                                            </h:outputFormat>
                                            <h:outputText value="#{bundle['login.institution.support.beforeLink']} " />
                                            <p:commandLink value="#{bundle['contact.support']}" oncomplete="PF('contactForm').show()" update=":contactDialog" actionListener="#{sendFeedbackDialog.initUserInput}">
                                                <f:setPropertyActionListener target="#{sendFeedbackDialog.messageSubject}" value=""/>
                                                <f:setPropertyActionListener target="#{sendFeedbackDialog.recipient}" value="#{null}"/>
                                                <f:setPropertyActionListener target="#{sendFeedbackDialog.userMessage}" value=""/>
                                                <f:setPropertyActionListener target="#{sendFeedbackDialog.userEmail}" value=""/>
                                            </p:commandLink>
                                            <h:outputText value=" #{bundle['login.institution.support.afterLink']}" escape="false"/>
                                        </p>
                                    </h:form>

                                    <div class="form-horizontal">
                                        <div class="form-group text-left">
                                            <label class="col-sm-4 control-label">
                                                #{bundle['auth.providers.title.shib']}
                                            </label>
                                            <div id="idpSelect" class="col-sm-8">

                                            </div>
                                        </div>
                                    </div>

                                    <script type="text/javascript">
                                        // TODO: get this working for https://github.com/IQSS/dataverse/issues/1551
                                        //shibRedirectPage = '?redirectPage=' + '#{LoginPage.redirectPage}';
                                        shibRedirectPage = '';
                                    </script>

                                    <script src="/resources/js/shib/idpselect_config.js" type="text/javascript" language="javascript"></script>

                                    <script src="/resources/js/shib/idpselect.js" type="text/javascript" language="javascript"></script>

                                    <script src="/resources/js/shib/idpselect_style.js" type="text/javascript" language="javascript"></script>

                                    <noscript>
                                        <!-- If you need to care about non javascript browsers you will need to
                                             generate a hyperlink to a non-js DS.

                                             To build you will need:
                                                 - URL:  The base URL of the DS you use
                                                 - EI: Your entityId, URLencoded.  You can get this from the line that
                                                   this page is called with.
                                                 - RET: Your return address dlib-adidp.ucs.ed.ac.uk. Again you can get
                                                   this from the page this is called with, but beware of the
                                                   target%3Dcookie%253A5269905f bit..

                                            < href=${URL}?entityID=${EI}&return=${RET}
                                        -->

                                        Your Browser does not support javascript. Please use
                                        <!--FIXME not valid xhtml?-->
                                        <!--<a href="http://federation.org/DS/DS?entityID=https%3A%2F%2FyourentityId.edu.edu%2Fshibboleth&return=https%3A%2F%2Fyourreturn.edu%2FShibboleth.sso%2FDS%3FSAMLDS%3D1%26target%3Dhttps%3A%2F%2Fyourreturn.edu%2F">this link</a>.-->
                                    </noscript>
                                </ui:fragment>
                                <ui:fragment rendered="#{LoginPage.provider == 'orcid'}">
                                    <h2 class="no-margin-top">#{bundle['auth.providers.title.orcid']}</h2>
                                    <p class="help-block">
                                        <span class="glyphicon glyphicon-info-sign"/>
                                        <h:outputText value=" #{bundle['auth.providers.title.blurb.orcid']}"/>
                                    </p>
                                </ui:fragment>
                                <ui:fragment rendered="#{LoginPage.provider == 'orcid-sandbox'}">
                                    <h2 class="no-margin-top">#{bundle['auth.providers.title.orcid-sandbox']}</h2>
                                    <p class="help-block">
                                        <span class="glyphicon glyphicon-info-sign"/>
                                        <h:outputText value=" #{bundle['auth.providers.title.blurb.orcid-sandbox']}"/>
                                    </p>
                                </ui:fragment>
                                <ui:fragment rendered="#{LoginPage.provider == 'google'}">
                                    <h2 class="no-margin-top">#{bundle['auth.providers.title.google']}</h2>
                                    <p class="help-block">
                                        <span class="glyphicon glyphicon-info-sign"/>
                                        <h:outputText value=" #{bundle['auth.providers.title.blurb.google']}"/>
                                    </p>
                                </ui:fragment>
                                <ui:fragment rendered="#{LoginPage.provider == 'github'}">
                                    <h2 class="no-margin-top">#{bundle['auth.providers.title.github']}</h2>
                                    <p class="help-block">
                                        <span class="glyphicon glyphicon-info-sign"/>
                                        <h:outputText value=" #{bundle['auth.providers.title.blurb.github']}"/>
                                    </p>
                                </ui:fragment>
                                
                                <div class="form-horizontal">
                                    <div class="form-group text-left">
                                        <div class="col-sm-12">
                                            <ui:repeat value="#{OAuth2Page.providers}" var="p">
                                                <h:outputLink styleClass="btn btn-default" value="#{OAuth2Page.linkFor(p.id)}">Log In with #{p.title}</h:outputLink>
                                            </ui:repeat>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                            <div id="otherProviders" jsf:rendered="#{LoginPage.authenticationProvidersAvailable}">
                                <h4>Other Log In Options</h4>
                                <ui:repeat value="#{LoginPage.listAuthenticationProviders()}" var="provider">
                                    <a href="/loginpage.xhtml?redirectPage=dataverseuser.xhtml&amp;provider=#{provider.id}" class="btn btn-default" style="margin-right:1em;"><h:outputText value="#{provider.title}" /></a>
                                </ui:repeat>
                            </div><commit_msg>More cleanup of the UI for the login pg fixing render logic in my previous commit. [ref #3338]<commit_after><!DOCTYPE html>
<html 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:jsf="http://xmlns.jcp.org/jsf">

    <h:head>
    </h:head>

    <h:body>
        <f:metadata>
            <f:viewParam name="redirectPage" value="#{LoginPage.redirectPage}"/>
            <f:viewParam name="provider" value="#{LoginPage.provider}"/>
            <f:viewAction action="#{LoginPage.init}"/>
        </f:metadata>
        <ui:composition template="/dataverse_template.xhtml">
            <ui:param name="pageTitle" value="#{bundle.login} - #{dataverseServiceBean.findRootDataverse().name} #{bundle.dataverse}"/>
            <ui:param name="showDataverseHeader" value="false"/>
            <ui:param name="showMessagePanel" value="#{true}"/>
            <ui:param name="loginRedirectPage" value="dataverse.xhtml"/>
            <ui:define name="body">
                <ui:fragment rendered="#{not LoginPage.authenticationProvidersAvailable}">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="alert alert-danger">
                                <h:outputFormat value="#{bundle['authenticationProvidersAvailable.tip']}" escape="false">
                                    <f:param value="&lt;h3&gt;"/>
                                    <f:param value="&lt;/h3&gt;"/>
                                    <f:param value="&lt;br /&gt;"/>
                                </h:outputFormat>
                            </div>
                        </div>
                    </div>
                </ui:fragment>
                <div id="login-container" class="row">

                    <div class="col-md-12">
                        <div class="col-md-6 col-md-offset-3">
                            <h2><span class="glyphicon glyphicon-log-in" /> Log In</h2>
                            
                            <div id="builtinProvider" jsf:rendered="#{LoginPage.provider == 'builtin'}">
                                <h:form id="loginForm" styleClass="form-horizontal">
                                    <h2 class="no-margin-top">#{bundle['auth.providers.title.builtin']}</h2>
                                    <p:focus context="loginForm"/>
                                    <ui:remove>
                                        <ui:fragment rendered="#{LoginPage.multipleProvidersAvailable}">
                                            <div class="form-group text-left">
                                                <label class="col-sm-4 control-label" for="loginSystemSelect">
                                                    #{bundle['login.System']}
                                                </label>
                                                <div class="col-sm-8">
                                                    <h:selectOneMenu id="loginSystemSelect" styleClass="form-control" value="#{LoginPage.credentialsAuthProviderId}">
                                                        <f:selectItems value="#{LoginPage.listCredentialsAuthenticationProviders()}" var="ap"
                                                                       itemLabel="#{ap.title}" itemValue="#{ap.id}" />
                                                        <f:ajax render="@all" listener="#{LoginPage.resetFilledCredentials}"/>
                                                    </h:selectOneMenu>
                                                </div>
                                            </div>
                                        </ui:fragment>
                                    </ui:remove>
                                    <ui:repeat id="credentialsContainer" value="#{LoginPage.filledCredentials}" var="fc">
                                        <div class="form-group text-left">
                                            <label class="col-sm-4 control-label" for="credValue">
                                                #{fc.credential.title}
                                            </label>
                                            <div class="col-sm-8">
                                                <h:inputText rendered="#{not fc.credential.secret}" value="#{fc.value}" id="credValue" styleClass="form-control"/>
                                                <p:message rendered="#{not fc.credential.secret}" for="credValue" display="text"/>
                                                <h:inputSecret rendered="#{fc.credential.secret}" value="#{fc.value}" id="sCredValue" styleClass="form-control"/>
                                                <p:message rendered="#{not fc.credential.secret}" for="sCredValue" display="text"/>
                                            </div>
                                        </div>
                                    </ui:repeat>
                                    <div class="form-group">
                                        <div class="col-sm-offset-4 col-sm-9 button-block">
                                            <p:commandButton id="login" value="#{bundle.login}" update="@all" action="#{LoginPage.login}"/>
                                            <p:button value="#{bundle.cancel}" outcome="/dataverse.xhtml?alias=#{dataverseServiceBean.findRootDataverse().alias}"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-offset-4 col-sm-9">
                                            <a href="passwordreset.xhtml">
                                                #{bundle['login.forgot.text']}
                                            </a>
                                        </div>
                                    </div>
                                </h:form>
                            </div>
                            <div id="remoteProvider" jsf:rendered="#{LoginPage.provider != 'builtin'}">
                                <ui:fragment rendered="#{(LoginPage.provider == 'shib') and (systemConfig.shibEnabled == true)}">
                                    <h2 class="no-margin-top">#{bundle['auth.providers.title.shib']}</h2>

                                    <h:form>
                                        <p class="help-block">
                                            <span class="glyphicon glyphicon-info-sign"/>
                                            <h:outputFormat value=" #{bundle['login.institution.blurb']} " escape="false">
                                                <f:param value="#{settingsWrapper.guidesBaseUrl}"/>
                                                <f:param value="#{systemConfig.version}"/>
                                            </h:outputFormat>
                                            <h:outputText value="#{bundle['login.institution.support.beforeLink']} " />
                                            <p:commandLink value="#{bundle['contact.support']}" oncomplete="PF('contactForm').show()" update=":contactDialog" actionListener="#{sendFeedbackDialog.initUserInput}">
                                                <f:setPropertyActionListener target="#{sendFeedbackDialog.messageSubject}" value=""/>
                                                <f:setPropertyActionListener target="#{sendFeedbackDialog.recipient}" value="#{null}"/>
                                                <f:setPropertyActionListener target="#{sendFeedbackDialog.userMessage}" value=""/>
                                                <f:setPropertyActionListener target="#{sendFeedbackDialog.userEmail}" value=""/>
                                            </p:commandLink>
                                            <h:outputText value=" #{bundle['login.institution.support.afterLink']}" escape="false"/>
                                        </p>
                                    </h:form>

                                    <div class="form-horizontal">
                                        <div class="form-group text-left">
                                            <label class="col-sm-4 control-label">
                                                #{bundle['auth.providers.title.shib']}
                                            </label>
                                            <div id="idpSelect" class="col-sm-8">

                                            </div>
                                        </div>
                                    </div>

                                    <script type="text/javascript">
                                        // TODO: get this working for https://github.com/IQSS/dataverse/issues/1551
                                        //shibRedirectPage = '?redirectPage=' + '#{LoginPage.redirectPage}';
                                        shibRedirectPage = '';
                                    </script>

                                    <script src="/resources/js/shib/idpselect_config.js" type="text/javascript" language="javascript"></script>

                                    <script src="/resources/js/shib/idpselect.js" type="text/javascript" language="javascript"></script>

                                    <script src="/resources/js/shib/idpselect_style.js" type="text/javascript" language="javascript"></script>

                                    <noscript>
                                        <!-- If you need to care about non javascript browsers you will need to
                                             generate a hyperlink to a non-js DS.

                                             To build you will need:
                                                 - URL:  The base URL of the DS you use
                                                 - EI: Your entityId, URLencoded.  You can get this from the line that
                                                   this page is called with.
                                                 - RET: Your return address dlib-adidp.ucs.ed.ac.uk. Again you can get
                                                   this from the page this is called with, but beware of the
                                                   target%3Dcookie%253A5269905f bit..

                                            < href=${URL}?entityID=${EI}&return=${RET}
                                        -->

                                        Your Browser does not support javascript. Please use
                                        <!--FIXME not valid xhtml?-->
                                        <!--<a href="http://federation.org/DS/DS?entityID=https%3A%2F%2FyourentityId.edu.edu%2Fshibboleth&return=https%3A%2F%2Fyourreturn.edu%2FShibboleth.sso%2FDS%3FSAMLDS%3D1%26target%3Dhttps%3A%2F%2Fyourreturn.edu%2F">this link</a>.-->
                                    </noscript>
                                </ui:fragment>
                                <ui:fragment rendered="#{LoginPage.provider == 'orcid'}">
                                    <h2 class="no-margin-top">#{bundle['auth.providers.title.orcid']}</h2>
                                    <p class="help-block">
                                        <span class="glyphicon glyphicon-info-sign"/>
                                        <h:outputText value=" #{bundle['auth.providers.title.blurb.orcid']}"/>
                                    </p>
                                </ui:fragment>
                                <ui:fragment rendered="#{LoginPage.provider == 'orcid-sandbox'}">
                                    <h2 class="no-margin-top">#{bundle['auth.providers.title.orcid-sandbox']}</h2>
                                    <p class="help-block">
                                        <span class="glyphicon glyphicon-info-sign"/>
                                        <h:outputText value=" #{bundle['auth.providers.title.blurb.orcid-sandbox']}"/>
                                    </p>
                                </ui:fragment>
                                <ui:fragment rendered="#{LoginPage.provider == 'google'}">
                                    <h2 class="no-margin-top">#{bundle['auth.providers.title.google']}</h2>
                                    <p class="help-block">
                                        <span class="glyphicon glyphicon-info-sign"/>
                                        <h:outputText value=" #{bundle['auth.providers.title.blurb.google']}"/>
                                    </p>
                                </ui:fragment>
                                <ui:fragment rendered="#{LoginPage.provider == 'github'}">
                                    <h2 class="no-margin-top">#{bundle['auth.providers.title.github']}</h2>
                                    <p class="help-block">
                                        <span class="glyphicon glyphicon-info-sign"/>
                                        <h:outputText value=" #{bundle['auth.providers.title.blurb.github']}"/>
                                    </p>
                                </ui:fragment>
                                
                                <div class="form-horizontal" jsf:rendered="#{LoginPage.provider != 'shib'}">
                                    <div class="form-group text-left">
                                        <div class="col-sm-12">
                                            <ui:repeat value="#{OAuth2Page.providers}" var="p">
                                                <h:outputLink styleClass="btn btn-default" value="#{OAuth2Page.linkFor(p.id)}">Log In with #{p.title}</h:outputLink>
                                            </ui:repeat>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                            <div id="otherProviders" jsf:rendered="#{LoginPage.authenticationProvidersAvailable}">
                                <h4>Other Log In Options</h4>
                                <ui:repeat value="#{LoginPage.listAuthenticationProviders()}" var="provider">
                                    <a href="/loginpage.xhtml?redirectPage=dataverseuser.xhtml&amp;provider=#{provider.id}" class="btn btn-default" style="margin-right:1em;"><h:outputText value="#{provider.title}" /></a>
                                </ui:repeat>
                            </div>
{'fraction_non_alphanumeric': 0.12007606628633523, 'fraction_numerical': 0.0054333061668024995, 'mean_word_length': 0.9573944832170156, 'pattern_counts': {'":': 2, '<': 359, '<?xml version=': 0, '>': 357, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 14}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 392, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4489444', 'n_tokens_mistral': 6266, 'n_tokens_neox': 6000, 'n_words': 970}