<%
	if((typeof newTab !== "undefined") && newTab) var linkAttr = 'target="_blank"';
	else var linkAttr = '';
%>

<div id="signinPopup" class="sign-in modal hide fade">
	<div class="modal-header center">
	    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
	    <h3>Sign In</h3>
  	</div>
	<div class="modal-body center">
		 <%  if(signInUrlOrcid) { %>
				<div class="orcid-signin center">
					<a href="<%=signInUrlOrcid%>" class="signin orcid-btn update-orcid-sign-in-url" <%=linkAttr%>>
						<img src="<%= MetacatUI.root %>/img/orcid_64x64.png" />
						<span>Sign in with ORCID</span>
					</a>
				</div>
		<% } if(MetacatUI.appModel.get("enableLdapSignIn")) { %>

			<div class="accordion" id="advanced-login">
				<div class="accordion-heading center">
					<a class="accordion-toggle" data-toggle="collapse" data-parent="#advanced-login" href="#signinLdap">
	        			Have an existing account?
	      			</a>
				</div>
				<div id="signinLdap" class="accordion-body <% if(collapseLdap) { %> collapse <% } %>">
					 <div class="accordion-inner center">

						 <%=ldapLoginForm%>

					</div>
				</div>
			</div>
		<% } %>
	</div>
  <% if( MetacatUI.appModel.get("showSignInHelp") ){ %>
  <div class="modal-footer center">
    <a href="<%=MetacatUI.root%>/signin-help" class="danger" data-dismiss="modal">Having issues signing in?</a>
  </div>
  <% } %>
</div>

<div id="signupPopup" class="sign-in modal hide fade">
	<div class="modal-header center">
	    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
	    <h3>Sign Up</h3>
  	</div>
	<div class="modal-body center">
		<% if(signInUrlOrcid) { %>
			<p>There's no need to create a new account - just use your <a href="<%=signInUrlOrcid%>">existing <img src="<%= MetacatUI.root %>/img/orcid_64x64.png" class="icon-on-left icon" /> ORCID account</a> now or <a href="<%=signInUrlOrcid%>">create a new one</a>.</p>
			<div class="orcid-signin center">
				<a href="<%=signInUrlOrcid%>" class="signin orcid-btn update-orcid-sign-in-url" <%=linkAttr%>>
					<img src="<%= MetacatUI.root %>/img/orcid_64x64.png" />
					<span>Sign up with ORCID</span>
				</a>
			</div>
		<% } %>
	</div>
</div>
