{{ define "content" }}
<div class="alert alert-info alert-dismissible fade in cookie-alert" role="alert">
  <button type="button" class="close" id="chk" data-dismiss="cookie-alert" aria-label="Accept">
    <span aria-hidden="true">Accept</span>
  </button>
  This site uses Cookies to offer you a better browsing experiance.  Find out more on <a href="/help#cookies" class="alert-link">how we use cookies and how you can change your settings</a>.
</div>

{{ with .Message }}
<div class="alert alert-danger fade in" role="alert">
  <strong>Error:</strong> {{ $.Message }}
</div>
{{ end }}
{{ with .PageItems.InfoMessage }}
<div class="alert alert-info fade in" role="alert">
  <strong>Info:</strong> {{ $.PageItems.InfoMessage }}
</div>
{{ end }}
<div class="row">
  {{ if .PageItems.QuickPay }}
  <div class="{{ loginBlocksClass (.PageItems.QuickPay) (.PageItems.JuiceCards) }}">
    <div class="card">
      <div class="card-header">
        <h2 class="card-title">Quick Payment</h2>
      </div>
      <div class="card-block">
        <p class="card-text">You can pay your bill quickly and easy with no additional fees. All you need is your most current invoice to get started. Setting up an account is optional.</p>
        <div class="row">
          <div class="col-xs-3">
            <img src="/static/img/visa.jpg" />
          </div>
          <div class="col-xs-3">
            <img src="/static/img/mc.jpg" />
          </div>
          <div class="col-xs-3">
            <img src="/static/img/disco.jpg" />
          </div>
          <div class="col-xs-3">
            <img src="/static/img/debit.jpg" />
          </div>
        </div>
      </div>
      <div class="card-footer">
        <button class="btn btn-primary disabled-btn" disabled>Pay My Bill</button>
      </div>
    </div>
  </div>
  {{ end }}
  {{ if .PageItems.JuiceCards }}
  {{ block "JuiceCardUnauth" . }}
  <div class="{{ loginBlocksClass (.PageItems.QuickPay) (.PageItems.JuiceCards) }}">
    <form method="post" action="/juicecard">
      <div class="card">
        <div class="card-header">
          <h2 class="card-title">Redeem {{ block "JuiceCardVoucher" . }}Juice Card{{ end }} </h2>
        </div>
        <div class="card-block">
          <p class="card-text">Redeem a {{ template "JuiceCardVoucher" . }} for your account.</p>
          <div class="form-group">
            {{ $len := len .PageItems.Portal }}
            {{ if gt $len 1 }}
            <label for="AccountPortal">Utility</label>
            <select class="form-control" id="AccountPortal" name="portal" aria-describedby="accountPortalHelp">
              <option value="">--select--</option>
              {{ range $key, $val := $.PageItems.Portal }}
              <option value="{{ $key }}">{{ $val }}</option>
              {{ end }}
            </select>
            <small id="accountPortalHelp" class="form-text text-muted">Select the utility that you are a customer of</small>
            {{ else }}
            {{ range $key, $val := $.PageItems.Portal }}
            <input type="hidden" name="portal" value="{{ $key }}">
            {{ end }}
            {{ end }}
          </div>
          <div class="form-group">
            <label for="AccountOrMeterNumber">{{ block "JuiceAccount" . }}Acccount{{ end }} Number</label>
            <input type="text" name="AccountOrMeterNumber" id="AccountOrMeterNumber" class="form-control" aria-describedby="accountHelp" placeholder="{{ block "JuiceCardVoucherPH" . }}Enter Account Number {{ end }}">
            <small id="accountHelp" class="form-text text-muted">This is your {{ template "JuiceAccount" . }} number</small>
          </div>
          <div class="form-group">
            <label for="JuiceCard">{{ block "JuiceCardNumber" . }}JuiceCard{{ end }} Number</label>
            <input type="text" name="JuiceCard" id="JuiceCard" class="form-control" aria-describedby="juicecardHelp" placeholder="{{ block "JuiceCardNumberPH" . }} Enter JuiceCard Number {{ end }}">
            <small id="juicecardHelp" class="form-text text-muted">{{ block "JuiceCardVoucherHelp" . }}This is your scratch off JuiceCard number or voucher
{{ end }}</small>
          </div>
        </div>
        <div class="card-footer">
          <button type="submit" class="btn btn-primary disabled-btn" disabled>Redeem</button>
        </div>
      </div>
    </form>
  </div>
  {{ end }}
  {{ end }}
  <div class="{{ loginBlocksClass (.PageItems.QuickPay) (.PageItems.JuiceCards) }}">
    <form method="post" action="/login">
      <div class="card">
        <div class="card-header">
          <h2 class="card-title">{{ template "JuiceAccount" . }} Login</h2>
        </div>
        <div class="card-block" id='loginform'>
          <p class="card-text">Login to view statements, notification manager, payment center</p>
          <div class="form-group">
            {{ $len := len .PageItems.Portal }}
            {{ if gt $len 1 }}
            <label for="AccountPortal">Utility</label>
            <select class="form-control" id="AccountPortal" name="portal" aria-describedby="accountPortalHelp">
              <option value="">--select--</option>
              {{ range $key, $val := $.PageItems.Portal }}
              <option value="{{ $key }}">{{ $val }}</option>
              {{ end }}
            </select>
            <small id="accountPortalHelp" class="form-text text-muted">Select the utility that you are a customer of</small>
            {{ else }}
            {{ range $key, $val := $.PageItems.Portal }}
            <input type="hidden" name="portal" value="{{ $key }}">
            {{ end }}
            {{ end }}
          </div>
          <div class="form-group">
            <label for="AccountNumber">{{ template "JuiceAccount" . }} Number</label>
            <input type="text" id="AccountNumber" class="form-control" name="account" aria-describedby="accountLoginHelp" placeholder="{{ block "JuiceAccountPH" . }}Enter Account Number{{ end }}" required>
            <small id="accountLoginHelp" class="form-text text-muted">This is your {{ template "JuiceAccount" . }} number, this can be found on your most recent invoice/receipt</small>
          </div>
          <div class="form-group">
            <label for="AccountPass">Password</label>
            <input type="password" id="AccountPass" class="form-control" name="password" placeholder="Password" required>
          </div>
        </div>
        <div class="card-footer">
          <button type="sumbit" class="btn btn-primary disabled-btn" disabled>Login</button>
          <button type="button" id="resetbtn" class="btn btn-secondary"  data-toggle="modal" data-target="#pwdModal" style="float: right">Forgot your password?</button>
        </div>
      </div>
    </form>

    <form method="post" action="/reset">
      <!-- Password Modal -->
      <div id="pwdModal" class="modal fade" role="dialog">
        <div class="modal-dialog">

          <!-- Modal content-->
          <div class="modal-content">
            <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal">&times;</button>
              <h4 class="modal-title">Password Reset</h4>
            </div>
            <div class="modal-body">
              <div class="card-block" id='resetform'>
                Enter your account number and phone number to reset your password.<br>You will receive a new password in a text message.
                <div class="form-group">
                  {{ $len := len .PageItems.Portal }} {{ if gt $len 1 }}
                  <label for="AccountPortal">Utility</label>
                  <select class="form-control" id="AccountPortal" name="portal" aria-describedby="accountPortalHelp">
                    <option value="">--select--</option>
                    {{ range $key, $val := $.PageItems.Portal }}
                    <option value="{{ $key }}">{{ $val }}</option>
                    {{ end }}
                  </select>
                  <small id="accountPortalHelp" class="form-text text-muted">Select the utility that you are a customer of</small>                      {{ else }} {{ range $key, $val := $.PageItems.Portal }}
                  <input type="hidden" name="portal" value="{{ $key }}"> {{ end }} {{ end }}
                </div>
                <div class="form-group">
                  <label for="AccountNumber">{{ template "JuiceAccount" . }} Number</label>
                  <input type="text" id="AccountNumber" class="form-control" name="account" aria-describedby="accountLoginHelp" placeholder="{{ template "JuiceAccountPH" . }}" required>
                  <small id="accountLoginHelp" class="form-text text-muted">This is your {{ template "JuiceAccount" . }} number, this can be found on your most recent invoice/receipt</small>
                </div>
                <div class="form-group">
                  <label for="AccountPhone">Phone Number</label>
                  <input type="tel" id="AccountPhone" class="form-control" name="phonenumber" placeholder="Phone Number" required>
                  <small id="accountPhoneHelp" class="form-text text-muted">Make sure to include the country code and area code with your phone number.<br />{{ template "phoneFmtStr" . }}</small>
                </div>
              </div>
            </div>
            <div class="modal-footer">
              <button type="sumbit" class="btn btn-primary disabled-btn" disabled>Reset Password</button>
              <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
          </div>

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

  </div>
</div>
{{ end }}
