<commit_before>%debug=False

%# Fetch page count preference for user, default is 25
%elts_per_page = datamgr.get_user_preferences(username, 'elts_per_page', 25)

<script type="text/javascript">
   // Periodical header refresh ... this function is called by the global refresh handler.
   function header_refresh() {
      if (refresh_logs) console.debug("Page header refresh");
      $.ajax({
         url: "/ping?action=refresh&template=_header_hosts_state"
      })
      .done(function(content, textStatus, jqXHR) {
         if (refresh_logs) console.debug("Refresh header - hosts state");
         $('#overall-hosts-states').html(content);
      });

      $.ajax({
         url: "/ping?action=refresh&template=_header_services_state"
      })
      .done(function(content, textStatus, jqXHR) {
         if (refresh_logs) console.debug("Refresh header - services state");
         $('#overall-services-states').html(content);
      });
   }

   $(document).ready(function(){
      // Start refresh periodical check ... every header_refresh_period second
      // header_refresh_period is defined in alignak_webui_refresh.js
      setInterval("header_refresh();", header_refresh_period*1000);
   });
</script>


<!-- Page header -->
<header>
   <nav id="topbar-menu" class="navbar navbar-default navbar-fixed-top">
      <div class="container-fluid">
         <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapsible-part">
               <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="/">
               <img src="/static/images/{{request.app.config.get('company_logo', 'default_company.png')}}" alt="{{_('Company logo')}}" />
            </a>
         </div>

         <!-- Right part ... -->
         <div id="navbar-collapsible-part" class="collapse navbar-collapse">
            <div class="hidden-xs">
               <!-- Page filtering ... -->
               %include("_filters.tpl")
            </div>

            <ul class="nav navbar-nav navbar-right">
               <li id="overall-hosts-states">
                  %include("_header_hosts_state.tpl")
               </li>

               <li id="overall-services-states">
                  %include("_header_services_state.tpl")
               </li>

               <li>
                  <a data-action="display-currently" data-toggle="tooltip" data-placement="bottom" title="{{_('Display fullscreen one-eye view.')}}" href="/currently">
                     <span class="fa fa-eye"></span>
                  </a>
               </li>

               %if request.app.config.get('play_sound', 'no') == 'yes':
               <li class="hidden-xs">
                  <a data-action="toggle-sound-alert" data-toggle="tooltip" data-placement="bottom" title="{{_('Sound alert on/off')}}" href="#">
                     <span id="sound_alerting" class="fa-stack" style="margin-top: -4px">
                       <i class="fa fa-music fa-stack-1x"></i>
                       <i class="fa fa-ban fa-stack-2x text-danger"></i>
                     </span>
                  </a>
               </li>
               %end

               %if refresh:
               <li>
                  <a data-action="toggle-page-refresh" data-toggle="tooltip" data-placement="bottom" title="{{_('Refresh page every %d seconds.') % (int(request.app.config.get('refresh_period', '60')))}}" href="#">
                     <span id="header_loading" class="fa fa-refresh"></span>
                  </a>
               </li>
               %end

               %if debug:
               <li class="dropdown">
                  <a href="#" class="dropdown-toggle" data-original-title="Debug" data-toggle="dropdown">
                     <span class="fa fa-bug"></span>
                     <span class="caret"></span>
                  </a>
                  <ul class="dropdown-menu">
                     <li>
                        <div class="panel panel-default">
                           <div class="panel-body">
                              <ul class="list-group">
                                 <li class="list-group-item"><small>Current user: {{current_user}}</small></li>
                                 <li class="list-group-item"><small>Target user: {{target_user}}</small></li>
                              </ul>
                              <div class="panel-footer">Total: {{datamgr.get_objects_count('user')}} users</div>
                           </div>
                        </div>
                     </li>
                  </ul>
               </li>
               %end

               <!-- User info -->
               <li class="dropdown user user-menu hidden-xs">
                  <a href="#" class="dropdown-toggle" data-original-title="{{_('User menu')}}" data-toggle="dropdown">
                     <i class="fa fa-user"></i>
                        %if not target_user.is_anonymous() and current_user.get_username() != target_user.get_username():
                        <span class="label label-warning" style="position:relative; left: 0px">{{target_user.get_username()}}</span>
                        %end
                        <span class="username hidden-sm hidden-xs hidden-md">{{current_user.get_name()}}</span>
                        <i class="caret"></i>
                  </a>

                  <ul class="dropdown-menu">
                     <li class="user-header">
                        %include("_select_target_user")
                     </li>
                     <li class="user-header">
                        <div class="panel panel-info" id="user_info">
                           <div class="panel-body panel-default">
                              <!-- User image / name -->
                              <p class="username">{{current_user.get_name()}}</p>
                              <p class="usercategory">
                                 <small>{{current_user.get_role(display=True)}}</small>
                              </p>
                              <img src="{{current_user.picture}}" class="img-circle user-logo" alt="{{_('Photo: %s') % current_user.get_name()}}" title="{{_('Photo: %s') % current_user.get_name()}}">
                           </div>
                           <div class="panel-footer">
                              <div class="btn-group" role="group">
                                 <a class="btn btn-default" href="#"
                                    data-action="about-box"
                                    title="{{_('Display application information')}}"
                                    >
                                    <span class="fa fa-question"></span>
                                 </a><commit_msg>Target user is a configuration parameter<commit_after>%debug=False

%# Fetch page count preference for user, default is 25
%elts_per_page = datamgr.get_user_preferences(username, 'elts_per_page', 25)

<script type="text/javascript">
   // Periodical header refresh ... this function is called by the global refresh handler.
   function header_refresh() {
      if (refresh_logs) console.debug("Page header refresh");
      $.ajax({
         url: "/ping?action=refresh&template=_header_hosts_state"
      })
      .done(function(content, textStatus, jqXHR) {
         if (refresh_logs) console.debug("Refresh header - hosts state");
         $('#overall-hosts-states').html(content);
      });

      $.ajax({
         url: "/ping?action=refresh&template=_header_services_state"
      })
      .done(function(content, textStatus, jqXHR) {
         if (refresh_logs) console.debug("Refresh header - services state");
         $('#overall-services-states').html(content);
      });
   }

   $(document).ready(function(){
      // Start refresh periodical check ... every header_refresh_period second
      // header_refresh_period is defined in alignak_webui_refresh.js
      setInterval("header_refresh();", header_refresh_period*1000);
   });
</script>


<!-- Page header -->
<header>
   <nav id="topbar-menu" class="navbar navbar-default navbar-fixed-top">
      <div class="container-fluid">
         <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapsible-part">
               <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="/">
               <img src="/static/images/{{request.app.config.get('company_logo', 'default_company.png')}}" alt="{{_('Company logo')}}" />
            </a>
         </div>

         <!-- Right part ... -->
         <div id="navbar-collapsible-part" class="collapse navbar-collapse">
            <div class="hidden-xs">
               <!-- Page filtering ... -->
               %include("_filters.tpl")
            </div>

            <ul class="nav navbar-nav navbar-right">
               <li id="overall-hosts-states">
                  %include("_header_hosts_state.tpl")
               </li>

               <li id="overall-services-states">
                  %include("_header_services_state.tpl")
               </li>

               <li>
                  <a data-action="display-currently" data-toggle="tooltip" data-placement="bottom" title="{{_('Display fullscreen one-eye view.')}}" href="/currently">
                     <span class="fa fa-eye"></span>
                  </a>
               </li>

               %if request.app.config.get('play_sound', 'no') == 'yes':
               <li class="hidden-xs">
                  <a data-action="toggle-sound-alert" data-toggle="tooltip" data-placement="bottom" title="{{_('Sound alert on/off')}}" href="#">
                     <span id="sound_alerting" class="fa-stack" style="margin-top: -4px">
                       <i class="fa fa-music fa-stack-1x"></i>
                       <i class="fa fa-ban fa-stack-2x text-danger"></i>
                     </span>
                  </a>
               </li>
               %end

               %if refresh:
               <li>
                  <a data-action="toggle-page-refresh" data-toggle="tooltip" data-placement="bottom" title="{{_('Refresh page every %d seconds.') % (int(request.app.config.get('refresh_period', '60')))}}" href="#">
                     <span id="header_loading" class="fa fa-refresh"></span>
                  </a>
               </li>
               %end

               %if debug:
               <li class="dropdown">
                  <a href="#" class="dropdown-toggle" data-original-title="Debug" data-toggle="dropdown">
                     <span class="fa fa-bug"></span>
                     <span class="caret"></span>
                  </a>
                  <ul class="dropdown-menu">
                     <li>
                        <div class="panel panel-default">
                           <div class="panel-body">
                              <ul class="list-group">
                                 <li class="list-group-item"><small>Current user: {{current_user}}</small></li>
                                 <li class="list-group-item"><small>Target user: {{target_user}}</small></li>
                              </ul>
                              <div class="panel-footer">Total: {{datamgr.get_objects_count('user')}} users</div>
                           </div>
                        </div>
                     </li>
                  </ul>
               </li>
               %end

               <!-- User info -->
               <li class="dropdown user user-menu hidden-xs">
                  <a href="#" class="dropdown-toggle" data-original-title="{{_('User menu')}}" data-toggle="dropdown">
                     <i class="fa fa-user"></i>
                        %if request.app.config.get('target_user', 'no') == 'yes':
                        %if not target_user.is_anonymous() and current_user.get_username() != target_user.get_username():
                        <span class="label label-warning" style="position:relative; left: 0px">{{target_user.get_username()}}</span>
                        %end
                        %end
                        <span class="username hidden-sm hidden-xs hidden-md">{{current_user.get_name()}}</span>
                        <i class="caret"></i>
                  </a>

                  <ul class="dropdown-menu">
                     %if request.app.config.get('target_user', 'no') == 'yes':
                     <li class="user-header">
                        %include("_select_target_user")
                     </li>
                     %end
                     <li class="user-header">
                        <div class="panel panel-info" id="user_info">
                           <div class="panel-body panel-default">
                              <!-- User image / name -->
                              <p class="username">{{current_user.get_name()}}</p>
                              <p class="usercategory">
                                 <small>{{current_user.get_role(display=True)}}</small>
                              </p>
                              <img src="{{current_user.picture}}" class="img-circle user-logo" alt="{{_('Photo: %s') % current_user.get_name()}}" title="{{_('Photo: %s') % current_user.get_name()}}">
                           </div>
                           <div class="panel-footer">
                              <div class="btn-group" role="group">
                                 <a class="btn btn-default" href="#"
                                    data-action="about-box"
                                    title="{{_('Display application information')}}"
                                    >
                                    <span class="fa fa-question"></span>
                                 </a>
{'fraction_non_alphanumeric': 0.15411706698598296, 'fraction_numerical': 0.0019722476579559062, 'mean_word_length': 1.4839048285514345, 'pattern_counts': {'":': 0, '<': 231, '<?xml version=': 0, '>': 231, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4376646', 'n_tokens_mistral': 3757, 'n_tokens_neox': 3588, 'n_words': 696}