<!DOCTYPE html>
<html lang="en" ng-app="Tower">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <title>Ansible Tower</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/ansible-bootstrap.min.css" />
  <link rel="stylesheet" href="{{ STATIC_URL }}lib/components-font-awesome/css/font-awesome.min.css" />
  <link rel="stylesheet" href="{{ STATIC_URL }}lib/select2/dist/css/select2.css" />
  <link rel="stylesheet" href="{{ STATIC_URL }}lib/select2/dist/css/select2-bootstrap.css" />

  <link rel="stylesheet" href="{{ STATIC_URL }}lib/codemirror/lib/codemirror.css" />
  <link rel="stylesheet" href="{{ STATIC_URL }}lib/codemirror/theme/elegant.css" />
  <link rel="stylesheet" href="{{ STATIC_URL }}lib/codemirror/addon/lint/lint.css" />
  <link rel="stylesheet" href="{{ STATIC_URL }}lib/nvd3/build/nv.d3.css"  type="text/css">

  <link rel="stylesheet" href="{{ STATIC_URL }}tower.min.css?v={{version}}"  type="text/css">

  <link rel="shortcut icon" href="{{ STATIC_URL }}img/favicon.ico" />
  <script>
      var $basePath = "{{ STATIC_URL }}";
  </script>

  <script src="{{ STATIC_URL }}tower.concat.js?v={{version}}"></script>

</head>
<body>

    <nav class="cbp-spmenu cbp-spmenu-vertical cbp-spmenu-right" id="ansible-mobile-menu">
        <h3>Hello, <span ng-bind="current_user.username"></span></h3>
        <a href="#home" id="mobile_home_link" ng-hide="portalMode===true">Home</a></li>
        <a href="#organizations" id="mobile_organizations_link" ng-hide="portalMode===true">Organizations</a></li>
        <a href="#users" id="mobile_users_link"  ng-hide="portalMode===true">Users</a></li>
        <a href="#teams" id="mobile_teams_link" ng-hide="portalMode===true">Teams</a></li>
        <a href="#credentials" id="mobile_credentials_link" ng-hide="portalMode===true">Credentials</a></li>
        <a href="#projects" id="mobile_projects_link" ng-hide="portalMode===true">Projects</a></li>
        <a href="#inventories" id="mobile_inventories_link" ng-hide="portalMode===true">Inventories</a></li>
        <a href="#job_templates" id="mobile_job_templates_link"  ng-hide="portalMode===true">Job Templates</a></li>
        <a href="#jobs" id="mobile_jobs_link" ng-hide="portalMode===true">Jobs</a></li>

        <a href="" id="mobile_about" ng-click ="viewAboutTower()" >About Tower</a> </li>
        <a href="" id="mobile_view_user" ng-click="viewCurrentUser()" ng-hide="portalMode===true">Account Settings</a></li>
        <a href="https://ansibleworks.zendesk.com/anonymous_requests/new" id="mobile_contact_support" target="_blank" ng-hide="portalMode===true">Contact Support</a></li>
        <a id="mobile_custom_inv"  ng-click="createCustomInv()" ng-show="user_is_superuser" href="" ng-hide="portalMode===true">Inventory Scripts</a></li>
        <a id="mobile_configure_tower"  ng-click="configureTower()" ng-show="user_is_superuser" href="" ng-hide="portalMode===true">Management Jobs</a></li>
        <a id="mobile_munin" target="_blank"  ng-show="user_is_superuser" href="/munin" ng-hide="portalMode===true">Monitor Tower</a></li>
        <a href="#portal" id="mobile_portal_link" ng-hide="portalMode===true">Portal Mode</a></li>
        <a href="" id="mobile_view_license" ng-click="viewLicense()" ng-hide="portalMode===true">View License</a></li>
        <a href="" id="mobile_view_leave_portal" ng-click="leavePortal()" ng-show="portalMode===true">Exit Portal</a></li>
        <a href="#/logout" id="mobile_logout">Logout</a>
    </nav>

    <div id="main-menu-container">
        <div class="navbar navbar-default navbar-fixed-top" role="navigation">
            <div class="container-fluid">
                <div class="navbar-header">
                    <div id="socket-beacon-div"></div>
                    <button type="button" class="navbar-toggle toggle-menu menu-right" id="main-menu-toggle-button">
                      <span class="sr-only">Toggle navigation</span>
                      <span class="icon-bar"></span>
                      <span class="icon-bar"></span>
                      <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="#home"><img id="ansible-brand-logo" src="{{ STATIC_URL }}img/ansible_tower_logo_minimalc.png" /></a>
                    <div id="ansible-list-title"></div> <!-- title to show on list pages when menu collapses. value set in app.js -->
                </div>
                <div class="navbar-collapse collapse" id="main-navbar-collapse">
                    <ul class="nav navbar-nav" id="ansible-main-menu">
                        <!-- <li id="home" class="active"><a href="#home" id="main_home_link" >Home</a></li> -->
                        <li id="organizations"><a href="#organizations" id="main_organizations_link" ng-hide="portalMode===true">Organizations</a></li>
                        <li id="users"><a href="#users" id="main_users_link" ng-hide="portalMode===true">Users</a></li>
                        <li id="teams"><a href="#teams" id="main_teams_link" ng-hide="portalMode===true">Teams</a></li>
                        <li id="credentials"><a href="#credentials" id="main_credentials_link" ng-hide="portalMode===true">Credentials</a></li>
                        <li id="projects"><a href="#projects" id="main_projects_link" ng-hide="portalMode===true">Projects</a></li>
                        <li id="inventories"><a href="#inventories" id="main_inventories_link" ng-hide="portalMode===true">Inventories</a></li>
                        <li id="job_templates"><a href="#job_templates" id="main_job_templates_link" ng-hide="portalMode===true">Job Templates</a></li>
                        <li id="jobs"><a href="#jobs" id="main_jobs_link" ng-hide="portalMode===true">Jobs</a></li>
                        <li id="portal"><a href="#portal" id="main_portal_link" ng-show="portalMode===true">Portal</a></li>
                        <li class="collapsed-option"><a href="#/login" id="main_login_link" ng-show="!current_user.username">Login</a></li>
                        <li ng-show="current_user.username" class="collapsed-option">
                            <a href="" id="account-menu-link">Hello, <span ng-bind="current_user.username"></span> <span class="caret"></span></a>
                            <ul class="nav navbar-nav" id="account-submenu">
                               <li><a href="" id="main_about" ng-click ="viewAboutTower()" ng-hide="portalMode===true">About Tower</a> </li>
                               <li><a id="main_view_user" href="" ng-click="viewCurrentUser()" ng-hide="portalMode===true">Account Settings</a></li>
                               <li><a id="main_contact_support" target="_blank" href="https://ansibleworks.zendesk.com/anonymous_requests/new" ng-hide="portalMode===true">Contact Support</a></li>
                               <li> <a id="main_custom_inv"  ng-click="createCustomInv()" ng-show="user_is_superuser" href="" ng-hide="portalMode===true">Inventory Scripts</a></li>
                                <li><a id="main_configure_tower"  ng-click="configureTower()" ng-show="user_is_superuser" href="" ng-hide="portalMode===true">Management Jobs</a></li>
                               <li><a id="main_munin" target="_blank"  ng-show="user_is_superuser" href="/munin" ng-hide="portalMode===true">Monitor Tower</a></li>
                               <li><a href="#portal" id="main_view_portal_link" >Portal Mode</a></li>
                               <li><a id="main_view_license" href="" ng-click="viewLicense()" ng-hide="portalMode===true">View License</a></li>
                               <li><a id="main_view_leave_portal" href="" ng-click="leavePortal()" ng-show="portalMode===true">Exit Portal</a></li>
                               <li class="divider"></li>
                               <li><a id="main_logout" href="#/logout">Logout</a></li>
                            </ul>
                        </li>
                    </ul>
                    <ul class="nav navbar-nav navbar-right" id="account-menu">
                        <li id="socket-beacon-li"></li>
                        <li><a href="#/login" id="main_login_link" ng-show="!current_user.username">Login</a></li>
                        <li class="dropdown" ng-show="current_user.username">
                            <a href="" id="account-menu-link" class="dropdown-toggle" data-toggle="dropdown">Hello, <span ng-bind="current_user.username"></span> <span class="caret"></span></a>
                            <ul class="dropdown-menu" id="account-submenu">
                               <li><a href="" id="main_about" ng-click ="viewAboutTower()" >About Tower</a> </li>
                               <li><a id="main_view_user" href="" ng-click="viewCurrentUser()" ng-hide="portalMode===true">Account Settings</a></li>
                               <li><a id="main_contact_support" target="_blank" href="https://ansibleworks.zendesk.com/anonymous_requests/new" ng-hide="portalMode===true">Contact Support</a></li>
                               <li> <a id="main_custom_inv"  ng-click="createCustomInv()" ng-show="user_is_superuser" href="" ng-hide="portalMode===true">Inventory Scripts</a></li>
                               <li><a id="configure_tower"  ng-click="configureTower()" ng-show="user_is_superuser" href="" ng-hide="portalMode===true">Management Jobs</a></li>
                               <li><a id="main_munin" target="_blank"  ng-show="user_is_superuser" href="/munin" ng-hide="portalMode===true">Monitor Tower</a></li>
                               <li><a href="#portal" id="main_view_portal_link" ng-hide="portalMode===true">Portal Mode</a></li>
                               <li><a id="main_view_license" href="" ng-click="viewLicense()" ng-hide="portalMode===true">View License</a></li>
                               <li><a id="main_view_leave_portal" href="" ng-click="leavePortal()" ng-show="portalMode===true">Exit Portal</a></li>


                               <li class="divider"></li>
                               <li><a id="main_logout" href="#/logout">Logout</a></li>
                            </ul>
                        </li>
                    </ul>
                </div><!--/.nav-collapse -->
            </div>
        </div>
    </div>
    <div class="container-fluid" id="#content-container">
      <div class="row">
          <div class="col-lg-12">
              <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" id="login-modal-content"></div><!-- modal-content -->
       </div><!-- modal-dialog -->
    </div><!-- modal -->

    <!-- Password Dialog -->
    <div id="password-modal" style="display: none;"></div>

    <!-- 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" ng-click="cancelModal()">&times;</button>
                <h3 ng-bind-html="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="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 -->

    <!-- 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="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">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 id= "alertHeader" ng-bind="alertHeader"></h3>
              </div>
              <div class="modal-body">
                <div id="alert-modal-msg" class="alert" ng-bind-html="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 id="alertHeader2" ng-bind="alertHeader2"></h3>
              </div>
              <div class="modal-body">
                <div id="alert2-modal-msg" class="alert" ng-bind-html="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 -->

    <div id="login-modal-dialog" style="display: none;"></div>
    <div id="help-modal-dialog" style="display: none;"></div>
    <div id="license-modal-dialog" style="display: none;"></div>
    <div id="about-modal-dialog" style="display: none;" ng-include=" '{{ STATIC_URL }}partials/cowsay-about.html ' "></div>
    <div id="custom-script-dialog" style="display:none;" > </div>
    <div id='configure-tower-dialog' style="display:none" >
      <div id="configure-jobs" ></div>
      <div class="tab-pane" id="configure-schedules-tab">
            <div id="configure-schedules-overlay"></div>
            <div id="configure-schedules-list"></div>
            <div id="configure-schedules-form-container">
                <div id="configure-schedules-title">
                    <h4 ng-bind="schedulesTitle"></h4>
                    <button type="button"  class="close pull-right" ng-click="cancelScheduleForm()">x</button>
                </div>
                <div id="configure-schedules-form-container-body">
                    <div id="configure-schedules-form"></div>
                    <div id="configure-schedules-detail"></div>
                </div>
                <div id="configure-schedules-buttons" >
                    <a id="configure-schedules-flip-link" ng-show="formShowing" ng-click="showScheduleDetail()" href=""><i class="fa fa-search-plus"></i> View Details</a>
                    <a id="configure-schedules-flip-link" ng-show="!formShowing" ng-click="showScheduleDetail()" href=""><i class="fa fa-arrow-circle-left"></i> Back to options</a>
                    <button type="button" class="btn btn-default btn-sm" id="configure-schedule-delete-button" ng-show="mode==='edit'" ng-click="deleteSystemSchedule($event)"><i class="fa fa-trash-o"></i> Delete</button>
                    <button type="button" class="btn btn-default btn-sm" id="configure-cancel-button" ng-click="cancelScheduleForm()"><i class="fa fa-times"></i> Cancel</button>
                    <!-- <button type="button" class="btn btn-primary btn-sm" id="configure-save-button" ng-click="saveScheduleForm()"><i class="fa fa-check"></i> Save</button> -->
                </div>
            </div>
        </div>
    </div>
    <div id="prompt-for-days" style="display:none">
      <form name="prompt_for_days_form" id="prompt_for_days_form">
            How many days of data would you like to <b>keep</b>? <br>
            <input type="number" id="days_to_keep" name="days_to_keep" ng-model="days_to_keep" ng-required="true" class="form-control" aw-min=0 aw-max=9999 style="margin-top:10px;" integer></input>
            <div class="error" ng-show="prompt_for_days_form.days_to_keep.$dirty && prompt_for_days_form.days_to_keep.$error.required">Please enter the number of days you would like to keep this data.</div>
            <div class="error survey_error" ng-show="prompt_for_days_form.days_to_keep.$error.number || prompt_for_days_form.days_to_keep.$error.integer" >Please enter a valid number.</div>
            <div class="error survey_error" ng-show="prompt_for_days_form.days_to_keep.$error.awMin">Please enter a non-negative number.</div>
            <div class="error survey_error" ng-show="prompt_for_days_form.days_to_keep.$error.awMax">Please enter a number smaller than 9999.</div>
            </form>
    </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>

<!--
<div class="navbar navbar-inverse site-footer fade-in">
    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-3 text-left help">
                <a href="https://ansibleworks.zendesk.com/anonymous_requests/new"
                    target="_blank"><i class="fa fa-question-circle"></i> Contact Support</a>
            </div>
            <div class="col-sm-6 text-center copyright">
                <a href="http://www.ansible.com">Ansible Tower <span ng-bind="version"></span><br />Copyright &copy; 2014 Ansible, Inc. All rights reserved.</a>
            </div>
            <div class="col-sm-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>
-->
<div class="site-footer"></div>


  <script>
        // HACK: Need this to support global-dependent
        //  config-loading behavior
        var $AnsibleConfig;

        require('tower/app');
      $('#main-menu-toggle-button').jPushMenu();
  </script>

</body>
</html>
