<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->
<div ng-controller="UserController">
  <div id="form-container" class="col-md-6 col-md-offset-3">

    <div>
      <div class="page-header">
        <span>{{'PASSWORD_CHANGE_REQUIRED'| translate}}</span>
      </div>
      <div class="breadcrumb-header text-center">

        <div class="row">            
          <div id="status-buttons" class="btn-group btn-breadcrumb col-md-12 col-md-offset-3">
            <a class="btn btn-secondary btn-default breadcrumb-home" ng-click="logout()">
              <i class="fa fa-power-off"style="color:red"></i>
            </a>
            <!--add class breadcrumb-disabled-link to buttons to prevent click-->
            <a ui-sref-active="active" class="btn btn-secondary btn-default">{{'PASSWORD_CHANGE'| translate}}</a>
          </div>
        </div>
      </div>
      <form class="signup-form" name="changePasswordForm" ng-submit="changePassword(user, $event)" novalidate>

        <div id="form-views" ui-view>
          <div id="attribute" class="form-group">
            <label for="user.password">{{'PASSWORD'| translate}}</label>
            <input type="password" class="form-control" name="password" ng-model="user.password" placeholder="password">
          </div>

          <div id="attribute" class="form-group">
            <label for="confirmPassword">{{'CONFIRM_PASSWORD'| translate}}</label>
            <input name="password" type="password" class="form-control" equals="user.password" ng-model="confirmPassword.value"
                   placeholder="confirm password" validate="true">
            <validation-message name="password"/>
          </div>

          <div id="attribute" class="form-group">
            <div class="suggestions">
              {{'PASSWORD_STRENGTH'| translate}}: 
              <span ng-if="passStrength < 50">{{'NOTSECURE'| translate}}</span>
              <span ng-if="passStrength >= 50 && passStrength <= 82">{{'ALMOSTSECURE'| translate}}</span>
              <span ng-if="passStrength > 82">{{'VERYGOOD'| translate}}</span>
            </div>
            <div ng-password-strength="user.password" strength="passStrength" inner-class="progress-bar" 
                 inner-class-prefix="progress-bar-">
            </div>
          </div>
          <div id="attribute" class="form-group row">
            <div class="col-xs-6">
              <a id="cancel" class="btn btn-danger float-left nav-button" tabindex="0" ng-click="logout()"
                 tabindex="0" ng-enter="logout()">
                {{'CANCEL'| translate}}
              </a>
            </div>
            <div class="col-xs-6">
              <button id="resetpassword" type="submit" tabindex="0"
                      class="btn btn-secondary btn-default float-right nav-button">
                {{'SUBMIT'| translate}}
              </button>
            </div>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>
