<!DOCTYPE html>
<html lang="en" ng-app="ansible">
<head>
  <meta charset="utf-8">
  <title>AnsibleWorks AWX</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="stylesheet" href="{{ STATIC_URL }}css/custom-theme/jquery-ui-1.10.3.custom.min.css" />
  <link rel="stylesheet" href="{{ STATIC_URL }}css/bootstrap.min.css" />
  <link rel="stylesheet" href="{{ STATIC_URL }}css/font-awesome.min.css" />
  <link rel="stylesheet" href="{{ STATIC_URL }}css/select2.css" />
  <link rel="stylesheet" href="{{ STATIC_URL }}css/select2-bootstrap.css" />
  
  {% if settings.USE_MINIFIED_JS %} 
  <link rel="stylesheet" href="{{ STATIC_URL }}css/awx.min.css" />
  {% else %}
  <link rel="stylesheet/less" type="text/css" href="{{ STATIC_URL }}less/ansible-ui.less" />
  {% endif %}
  
  <link rel="shortcut icon" href="{{ STATIC_URL }}img/favicon.ico" />
  <script>
      var $basePath = "{{ STATIC_URL }}";
  </script>
  <script src="{{ STATIC_URL }}js/config.js"></script>
  <script src="{{ STATIC_URL }}lib/jquery/jquery-1.10.2.min.js"></script>
  <script src="{{ STATIC_URL }}lib/angular/angular.min.js"></script>
  <script src="{{ STATIC_URL }}lib/angular/angular-resource.min.js"></script>
  <script src="{{ STATIC_URL }}lib/angular/angular-cookies.min.js"></script>
  <script src="{{ STATIC_URL }}lib/angular/angular-sanitize.min.js"></script>
  {% if settings.USE_MINIFIED_JS %} 
  <script src="{{ STATIC_URL }}js/awx-min.js"></script>
  {% else %}
  <script src="{{ STATIC_URL }}js/app.js"></script>
  <script src="{{ STATIC_URL }}lib/ansible/AuthService.js"></script>
  <script src="{{ STATIC_URL }}lib/ansible/RestServices.js"></script>
  <script src="{{ STATIC_URL }}lib/ansible/Utilities.js"></script>
  <script src="{{ STATIC_URL }}lib/ansible/form-generator.js"></script>
  <script src="{{ STATIC_URL }}lib/ansible/list-generator.js"></script>
  <script src="{{ STATIC_URL }}lib/ansible/prompt-dialog.js"></script>
  <script src="{{ STATIC_URL }}lib/ansible/generator-helpers.js"></script>
  <script src="{{ STATIC_URL }}lib/ansible/directives.js"></script>
  <script src="{{ STATIC_URL }}lib/ansible/filters.js"></script>
  <script src="{{ STATIC_URL }}lib/ansible/api-loader.js"></script>
  <script src="{{ STATIC_URL }}lib/ansible/license.js"></script>
  <script src="{{ STATIC_URL }}lib/ansible/pwdmeter.js"></script>
  <script src="{{ STATIC_URL }}lib/ansible/InventoryTree.js"></script>
  <script src="{{ STATIC_URL }}lib/ansible/Timer.js"></script>
  <script src="{{ STATIC_URL }}js/controllers/Authentication.js"></script>
  <script src="{{ STATIC_URL }}js/controllers/Organizations.js"></script>
  <script src="{{ STATIC_URL }}js/controllers/Users.js"></script>
  <script src="{{ STATIC_URL }}js/controllers/Admins.js"></script>
  <script src="{{ STATIC_URL }}js/controllers/Inventories.js"></script>
  <script src="{{ STATIC_URL }}js/controllers/Home.js"></script>
  <script src="{{ STATIC_URL }}js/controllers/Teams.js"></script>
  <script src="{{ STATIC_URL }}js/controllers/Credentials.js"></script>
  <script src="{{ STATIC_URL }}js/controllers/JobTemplates.js"></script>
  <script src="{{ STATIC_URL }}js/controllers/Projects.js"></script>
  <script src="{{ STATIC_URL }}js/controllers/Jobs.js"></script>
  <script src="{{ STATIC_URL }}js/controllers/JobEvents.js"></script>
  <script src="{{ STATIC_URL }}js/controllers/JobHosts.js"></script>
  <script src="{{ STATIC_URL }}js/controllers/Permissions.js"></script>
  <script src="{{ STATIC_URL }}js/forms/Users.js"></script>
  <script src="{{ STATIC_URL }}js/forms/Organizations.js"></script>
  <script src="{{ STATIC_URL }}js/forms/Inventories.js"></script>
  <script src="{{ STATIC_URL }}js/forms/Teams.js"></script>
  <script src="{{ STATIC_URL }}js/forms/Hosts.js"></script>
  <script src="{{ STATIC_URL }}js/forms/Groups.js"></script>
  <script src="{{ STATIC_URL }}js/forms/Credentials.js"></script>
  <script src="{{ STATIC_URL }}js/forms/JobTemplates.js"></script>
  <script src="{{ STATIC_URL }}js/forms/Jobs.js"></script>
  <script src="{{ STATIC_URL }}js/forms/Projects.js"></script>
  <script src="{{ STATIC_URL }}js/forms/ProjectStatus.js"></script>
  <script src="{{ STATIC_URL }}js/forms/Permissions.js"></script>
  <script src="{{ STATIC_URL }}js/forms/JobEventData.js"></script>
  <script src="{{ STATIC_URL }}js/forms/HostGroups.js"></script>
  <script src="{{ STATIC_URL }}js/forms/InventoryStatus.js"></script>
  <script src="{{ STATIC_URL }}js/forms/ActivityDetail.js"></script>
  <script src="{{ STATIC_URL }}js/forms/JobSummary.js"></script>
  <script src="{{ STATIC_URL }}js/lists/Users.js"></script>
  <script src="{{ STATIC_URL }}js/lists/Organizations.js"></script>
  <script src="{{ STATIC_URL }}js/lists/Admins.js"></script>
  <script src="{{ STATIC_URL }}js/lists/Inventories.js"></script>
  <script src="{{ STATIC_URL }}js/lists/Teams.js"></script>
  <script src="{{ STATIC_URL }}js/lists/InventoryGroups.js"></script>
  <script src="{{ STATIC_URL }}js/lists/InventoryHosts.js"></script>
  <script src="{{ STATIC_URL }}js/lists/Credentials.js"></script>
  <script src="{{ STATIC_URL }}js/lists/JobTemplates.js"></script>
  <script src="{{ STATIC_URL }}js/lists/Projects.js"></script>
  <script src="{{ STATIC_URL }}js/lists/Jobs.js"></script>
  <script src="{{ STATIC_URL }}js/lists/JobEvents.js"></script>
  <script src="{{ STATIC_URL }}js/lists/JobHosts.js"></script>
  <script src="{{ STATIC_URL }}js/lists/Permissions.js"></script>
  <script src="{{ STATIC_URL }}js/lists/Streams.js"></script>
  <script src="{{ STATIC_URL }}js/lists/HomeGroups.js"></script>
  <script src="{{ STATIC_URL }}js/lists/HomeHosts.js"></script>
  <script src="{{ STATIC_URL }}js/lists/Groups.js"></script>
  <script src="{{ STATIC_URL }}js/lists/Hosts.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/refresh-related.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/related-paginate.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/related-search.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/refresh.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/search.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/paginate.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/inventory.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/teams.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/JobSubmission.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/Lookup.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/Parse.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/Events.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/Children.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/ProjectPath.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/md5.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/Access.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/Selection.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/Projects.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/Users.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/Jobs.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/Credentials.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/Permissions.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/Groups.js"></script>
  <script src="{{ STATIC_URL }}js/helpers/Hosts.js"></script>
  <script src="{{ STATIC_URL }}js/widgets/JobStatus.js"></script>
  <script src="{{ STATIC_URL }}js/widgets/InventorySyncStatus.js"></script>
  <script src="{{ STATIC_URL }}js/widgets/SCMSyncStatus.js"></script>
  <script src="{{ STATIC_URL }}js/widgets/ObjectCount.js"></script>
  <script src="{{ STATIC_URL }}js/widgets/Stream.js"></script>
  <script src="{{ STATIC_URL }}js/help/InventorySummary.js"></script>
  <script src="{{ STATIC_URL }}js/help/InventoryHosts.js"></script>
  <script src="{{ STATIC_URL }}lib/less/less-1.4.1.min.js"></script>

  {% endif %}
  
</head>
<body>

<div id="wrap">

    <div id="navbar-container">
        <div class="navbar navbar-inverse navbar-fixed-top main-menu" role="navigation">
           <div class="container">
             <div class="navbar-header">
                <a class="navbar-brand" href="#home"><img class="logo" src="{{ STATIC_URL }}img/tower_console_logo.png" /></a>
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
                </button>
             </div>
             <div class="collapse navbar-collapse navbar-responsive-collapse">
                <ul class="nav navbar-nav pull-right">
                  <li ng-show="current_user.username != null && current_user.username != undefined">
                     <a id="main_view_user" href="" ng-click="viewCurrentUser()" ng-bind="'Hello! ' + current_user.username"></a></li>
                  <li ng-show="userLoggedIn == true"><a id="main_view_license" href="" ng-click="viewLicense()">View License</a></li>
                  <li ng-show="userLoggedIn == true"><a id="main_contact_support" target="_blank"
                      href="https://ansibleworks.zendesk.com/anonymous_requests/new">Contact Support</a><li>
                  <li ng-show="userLoggedIn == true"><a id="main_logout" href="#/logout">Logout</a></li>
                </ul>
             </div><!-- nav-collapse -->
           </div>
        </div><!-- navbar -->
    </div>  
    <div class="container main-container" id="main">

    <div class="row">
      <div class="col-lg-12">
        <ul class="nav nav-tabs" id="main_tabs">
          <li class="active"><a href="#home" id="main_home_tab" data-toggle="tab">Home</a></li>
          <li><a href="#organizations" id="main_organizations_tab" data-toggle="tab">Organizations</a></li>
          <li><a href="#users" id="main_users_tab" data-toggle="tab">Users</a></li>
          <li><a href="#teams" id="main_teams_tab" data-toggle="tab">Teams</a></li>
          <li><a href="#credentials" id="main_credentials_tab" data-toggle="tab">Credentials</a></li>
          <li><a href="#projects" id="main_projects_tab" data-toggle="tab">Projects</a></li>
          <li><a href="#inventories" id="main_inventories_tab" data-toggle="tab">Inventories</a></li>
          <li><a href="#job_templates" id="main_job_templates_tab" data-toggle="tab">Job Templates</a></li>
          <li><a href="#jobs" id="main_jobs_tab" data-toggle="tab">Jobs</a></li>
        </ul>
     
        <div class="tab-content" id="tab-content-container">
          <div ng-view id="main-view"></div>
        </div>
      </div>
    </div>

    <!-- login modal -->
    <div id="login-modal" class="modal fade">
       <div class="modal-dialog">
          <div class="modal-content">
              <div class="modal-header login-header">
                <img src="{{ STATIC_URL }}img/tower_console_logo.png" />
              </div>
              <div class="modal-body">
                <div class="login-alert" ng-show="(sessionExpired == false)">Welcome to Ansible Tower! &nbsp;Please sign in.</div>
                <div class="login-alert" ng-show="(sessionExpired == true)">Your session timed out due to inactivity. Please sign in.</div>
                <form id="login-form" name="loginForm" class="form-horizontal" autocomplete="off" novalidate >
                  <div class="form-group">
                    <label class="control-label col-lg-3 prepend-asterisk">Username</label>
                    <div class="col-lg-8">
                      <input type="text" name="login_username" class="form-control" ng-model="login_username"
                          id="login-username" autocomplete="off" required>
                      <div class="error" ng-show="loginForm.login_username.$dirty && loginForm.login_username.$error.required">
                        A value is required!
                      </div>
                      <div class="error api-error" ng-bind="usernameError"></div>
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="control-label col-lg-3 prepend-asterisk">Password</label>
                    <div class="col-lg-8">
                      <input type="password" name="login_password" id="login-password" class="form-control"
                          ng-model="login_password" required autocomplete="off">
                          <div class="error" ng-show="loginForm.login_password.$dirty && loginForm.login_password.$error.required">
                            A value is required!
                          </div>
                      <div class="error api-error" ng-bind="passwordError"></div>
                    </div>
                  </div>
                </form>
              </div>
              <div class="modal-footer">
                <button ng-click="systemLogin(login_username, login_password)" id="login-button" class="btn btn-primary"><i class="fa fa-sign-in"></i> Sign In</button>
              </div>
          </div><!-- modal-content -->
       </div><!-- modal-dialog -->
    </div><!-- modal -->

    <!-- Password Dialog -->
    <div id="password-modal" class="modal fade">
       <div class="modal-dialog">
          <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" ng-click="cancelJob()" aria-hidden="true">&times;</button>
                <h3>Authentication Required</h3>
              </div>
              <div class="modal-body" id="password-body"></div>
              <div class="modal-footer">
                <a href="" ng-click="cancelJob()" class="btn btn-default" id="password_cancel_btn">Cancel</a>
                <a href="" ng-click="startJob()" class="btn btn-primary" id="password_continue_btn" ng-disabled="password_form.$pristine || password_form.$invalid">Continue</a>
              </div>
          </div><!-- modal-content -->
       </div><!-- modal-dialog -->
    </div><!-- modal -->

    <!-- Generic Form dialog -->
    <div id="form-modal" class="modal fade">
       <div class="modal-dialog">
          <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-target="#form-modal" 
                                data-dismiss="modal" aria-hidden="true">&times;</button>
                <h3 ng-bind-html-unsafe="formModalHeader"></h3>
              </div>
              <div class="modal-body" id="form-modal-body"></div>
              <div class="modal-footer">
                <button ng-show="formModalInfo !== undefined && formModalInfo != ''" ng-click="formModalInfoAction()" 
                    class="btn btn-sm pull-left"><i class="fa fa-search-plus"></i> <span ng-bind="formModalInfo"></span></button>
                <a href="#" ng-show="formModalCancelShow" data-target="#form-modal" ng-click="cancelModal()" data-dismiss="modal" id="form_cancel_btn" class="btn btn-default">Cancel</a>
                <a href="" ng-bind="formModalActionLabel" ng-click="formModalAction()" ng-disabled="formModalActionDisabled" id="form_ok_btn" class="btn btn-primary"></a>
              </div>
          </div><!-- modal-content -->
       </div><!-- modal-dialog -->
    </div><!-- modal -->

    <div id="form-modal2" class="modal fade">
       <div class="modal-dialog">
          <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-target="#form-modal2" 
                                data-dismiss="modal" aria-hidden="true">&times;</button>
                <h3 ng-bind-html-unsafe="formModal2Header"></h3>
              </div>
              <div class="modal-body" id="form-modal2-body"></div>
              <div class="modal-footer">
                <a href="" ng-bind="formModal2Info" ng-show="formModal2Info !== undefined && formModal2Info != ''" ng-click="formModal2InfoAction()" 
                    class="btn btn-default btn-sm pull-left"><i class="fa fa-search-plus"></i> <span ng-bind="formModal2Info"></span></a>
                <a href="#" ng-show="formModal2CancelShow" data-target="#form-modal2" data-dismiss="modal" id="form2_cancel_btn"
                    class="btn btn-default">Cancel</a>
                <a href="" ng-bind="formModal2ActionLabel" ng-click="formModal2Action()" id="form2_ok_btn" class="btn btn-primary"></a>
              </div>
          </div><!-- modal-content -->
       </div><!-- modal-dialog -->
    </div><!-- modal -->

    <!-- Lookup dialog. Use for attribute selection -->
    <div id="lookup-modal" class="modal fade">
       <div class="modal-dialog">
          <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-target="#lookup-modal" 
                                data-dismiss="modal" aria-hidden="true">&times;</button>
                <h3 ng-bind="lookupHeader"></h3>
              </div>
              <div class="modal-body" id="lookup-modal-body"></div>
              <div class="modal-footer">
                <a href="#" data-target="#lookup-modal" data-dismiss="modal" id="lookup_cancel_btn" class="btn btn-default">Cancel</a>
                <a href="" ng-click="selectAction()" id="lookup_select_btn" class="btn btn-primary">Select</a>
              </div>
          </div><!-- modal-content -->
       </div><!-- modal-dialog -->
    </div><!-- modal -->

    <!-- Confirmation Dialog -->
    <div id="prompt-modal" class="modal fade">
       <div class="modal-dialog">
          <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-target="#prompt-modal" 
                                data-dismiss="modal" aria-hidden="true">&times;</button>
                <h3 ng-bind="promptHeader" id="prompt-header"></h3>
              </div>
              <div class="modal-body" ng-bind-html-unsafe="promptBody" id="prompt-body">
              </div>
              <div class="modal-footer">
                <a href="#" data-target="#prompt-modal" data-dismiss="modal" id="prompt_cancel_btn" class="btn btn-default">No</a>
                <a href="" ng-class="promptActionBtnClass" ng-click="promptAction()" id="prompt_action_btn" class="btn btn-primary">Yes</a>
              </div>
          </div><!-- modal-content -->
       </div><!-- modal-dialog -->
    </div><!-- modal -->     

    <!-- Alerts/error handling dialogs -->
    <div id="alert-modal" class="modal fade">
       <div class="modal-dialog">
          <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" ng-hide="disableButtons" data-target="#alert-modal" 
                    data-dismiss="modal" class="modal" aria-hidden="true">&times;</button>
                <h3 ng-bind="alertHeader"></h3>
              </div>
              <div class="modal-body">
                <div class="alert" ng-class="alertClass" ng-bind-html-unsafe="alertBody"></div>
              </div>
              <div class="modal-footer">
                <a href="#" ng-hide="disableButtons" data-target="#form-modal" data-dismiss="modal" id="alert_ok_btn" class="btn btn-primary">OK</a>
              </div>
          </div><!-- modal-content -->
       </div><!-- modal-dialog -->
    </div><!-- modal -->

    <div id="alert-modal2" class="modal fade">
       <div class="modal-dialog">
          <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-target="#alert-modal2" 
                                data-dismiss="modal" ng-hide="disableButtons2" aria-hidden="true">&times;</button>
                <h3 ng-bind="alertHeader2"></h3>
              </div>
              <div class="modal-body">
                <div class="alert" ng-class="alertClass2" ng-bind-html-unsafe="alertBody2"></div>
              </div>
              <div class="modal-footer">
                <a href="#" ng-hide="disableButtons2" data-target="#form-modal2" data-dismiss="modal" id="alert2_ok_btn" class="btn btn-primary">OK</a>
              </div>
          </div><!-- modal-content -->
       </div><!-- modal-dialog -->
    </div><!-- modal -->

    <!-- Help dialog -->
    <div id="help-modal"></div>

  </div><!-- container -->
  
  <div class="overlay"></div>
  <div class="spinny"><i class="fa fa-cog fa-spin fa-2x"></i> <p>working...</p></div>

  <div id="push"></div>

</div><!-- wrap -->

  <div class="site-footer">
    <div class="container">
        <div class="row">
            <div class="col-lg-3 text-left help">
                <a href="https://support.ansible.com/anonymous_requests/new" target="_blank"><i class="fa fa-question-circle"></i> Contact Support</a>
            </div>
            <div class="col-lg-6 text-center copyright">
                <a href="http://www.ansible.com">Copyright &copy; 2014 AnsibleWorks, Inc. All rights reserved.</a>
            </div>
            <div class="col-lg-3">
                <div class="logo">
                    <a href="http://www.ansible.com" target="_blank"><img src="{{ STATIC_URL }}img/tower_console_bug.png" /></a>
                </div>
            </div>
        </div>
    </div>
  </div><!-- site footer --> 

  <!-- <script src="{{ STATIC_URL }}lib/jquery/jquery-ui-1.10.3.custom.min.js"></script> -->
  
  <script src="{{ STATIC_URL }}lib/twitter/bootstrap.min.js"></script>
  <script src="{{ STATIC_URL }}lib/js-yaml/js-yaml.min.js"></script>
  <script src="{{ STATIC_URL }}lib/md5/jquery.md5.js"></script>
  <script src="{{ STATIC_URL }}lib/select2/select2.js"></script>
  <script src="{{ STATIC_URL }}lib/jquery/jquery-ui-1.10.4.custom.min.js"></script>
  
  <script>
      $('a[data-toggle="tab"]').on('show.bs.tab', function (e) {
          var url = $(e.target).text();
          var regx = new RegExp('/\#\/' + url.toLowerCase().replace(/ /g,'_') + '/');
          var loc = window.location.toString();
          if (! regx.test(loc)) {
             window.location = '#/' + url.toLowerCase().replace(/ /g,'_');
          }
          });
  </script>

</body>
</html>
