<!DOCTYPE html>

<html lang="en">

<head>
<meta charset="UTF-8" />
<title>RStudio SSO Sign In</title>
<link rel="shortcut icon" href="images/favicon.ico" />

<link rel="stylesheet" href="rstudio.css" type="text/css"/>
<link rel="stylesheet" href="signin.css" type="text/css"/>

<script type="text/javascript" src="js/signin.js"></script>

<style type="text/css">

#errorpanel {
  display: #errorDisplay#;
}

</style>

</head>

<body>

<header id="banner">
  <div id="logo">
    #!logoHtml#
  </div>
  <div id="licensed-to">
    <span id="license-prefix">#licensePrefix#</span>
    <span id="licensee">#licensee#</span>
  </div>
</header>

<main>
<div id="errorpanel">
<p id="errortext">Error: #errorMessage#</p>
</div>
<div role="alert" aria-atomic="true" class="visuallyhidden" id="live-error"></div>

<form name='login_form' action='#action#'
      method='POST' enctype='application/x-www-form-urlencoded'
      onsubmit='return verifyMe();'>

<table role="presentation" id="border" align="center" width="100%">
  <tr>
    <td>
      <div role="group" aria-labelledby="caption_header">
        <div id="controls">
          <h1 id="caption_header" class="caption">Sign into RStudio with SAML SSO</h1>
          <div style="display: #staySignedInDisplay#;">
            <input type="checkbox" name="staySignedIn" id="staySignedIn" value="1"/>
            <label for="staySignedIn">Stay signed in when browser closes</label>
            <p style="display: #authTimeoutMinutesDisplay#;">
              <span style="font-size:10px">You will automatically be signed out after #authTimeoutMinutes# minutes of inactivity.</span>
          </p>
          </div>
          <input type="hidden" name="csrf-token" value="#csrf_token#" />
          <input type='hidden' name='appUri' value='#appUri#'/>
          <div class="buttonpanel">
            <button id="signinbutton" class="fancy">Sign in with SAML</button>
          </div>
        </div>
        <div id="goback" class="signinhidden">
          <h1 class="caption">Signed Out</h1>
          <p role="alert" aria-atomic="true">This browser was signed out from RStudio due to inactivity or by a manual sign out initiated from another tab. A new sign in was detected and you may now return to RStudio using the button below.</p>
          <div class="buttonpanel"><button class="fancy" type="button" onclick="window.location = responseURL;">Return to RStudio</button></div>
        </div>
      </div>
    </td>
  </tr>
</table>
</form>
<div class="signin-spinner-holder">
  <div aria-live="polite" class="visuallyhidden" id="progress-message"></div>
  <div role="progressbar" aria-labelledby="progress-message" id="spinner" class="signin-hidden signin-spinner">
     <div></div><div></div><div></div><div></div>
     <div></div><div></div><div></div><div></div>
     <div></div><div></div><div></div><div></div>
  </div>
</div>

<div id="login-html">
#!loginPageHtml#
</div>

</main>
</body>

</html>
