<div id="main_menu" class="page_{{@page_data['page']}}">
  <div id="user_info">
    <button type="button" class="send_ajax right" title="Выход" href="/users/logout">
      <i class="fas fa-door-open"></i>
      <div class="small">Выход</div>
    </button>
    <a id="fullscreen">
      <i class="fas fa-expand-arrows-alt" title="Во весь экран"></i>
      <i class="fas fa-compress-arrows-alt" title="Выйти из полноэкранного режима"></i>
    </a>
    {{@authorization_user.short_name}}<br>
    <small class="gray">{{@authorization_user.group_title}}</small>
  </div>
  <ul class="menu" id="settings_menu">
    <li class="first_menu">
      <button type="button">
        <span class="gear {{@alert>0?'false':''}}">
          <img src="/ui/css/img/logo.svg" width="90%">
        </span>
      </button>
      <div class="menu_list">
        <ul class="menu_list_ul">
        <repeat group="{{@menu.settings}}" key="{{@href}}" value="{{@m}}">
          <a href="{{@href}}" class='{{@m.class}}'><li class="{{@PATH==@href?'select':''}}">{{@m.title | raw}}</li></a>
        </repeat>
        <a class="order_show">
          <li class="send_ajax" href="/users/logout"><i class="fas fa-door-open"></i> Выход из учетной записи</li>
        </a>
        </ul>
      </div>
    </li>
  </ul>
  <ul class="menu">
    <li class="first_menu">
      <button type="button" {{@return?'class="false"':''}}>Разделы <i class="fas fa-exclamation-circle remote_receipts false" style="{{@remote_receipts>0?'display: inline;':''}}""></i></button>
      <div class="menu_list">
        <ul class="menu_list_ul">
      <repeat group="{{@menu.menu}}" key="{{@href}}" value="{{@m}}">
        <a class="{{@m['class']}}" href="{{@href}}"><li class="{{@PATH==@href?'select':''}}">{{@m['title'] | raw}}</li></a>
      </repeat>
      <check if="{{!@base_settings['autonomous'] && @api_data['domen']}}">
      <a class="order_show">
        <li class="show_window" href="/receipts/walk">Отметить проход сотрудника</li>
      </a>
      </check>
      </ul>
      </div>
    </li>
  </ul>
  <check if="{{(isset(@room) && isset(@receipt)) || @PATH=='/settings/rooms'}}">
  <ul class="menu" id="room_menu">
    <li class="first_menu {{!@room?'no_arrow':''}}">
      <check if="{{@PATH=='/settings/rooms'}}">
        <true>
          <check if="{{@room['title']!=''}}">
            <true>
              <button type="button">{{@room['title']}}</button>
            </true>
          </check>
        </true>
        <false>
          <a class="room_item" href='/?room_id={{@room["id"]}}'>
            <button type="button">Залы</button>
          </a>
        </false>
      </check>
      <check if="{{(isset(@rooms) && count(@rooms)>0) || (@PATH=='/settings/rooms' && @room['title']!='')}}">
      <div class="menu_list">
        <ul class="menu_list_ul">
        <check if="{{@PATH=='/settings/rooms'}}">
        <a href="/rooms/add?id={{@room['id']}}" class='show_window'><li>Редактировать зал</li></a>
        <a href="/messages/continue?uri={{urlencode("/rooms/delete?id=".@room['id'])}}" class="show_window"><li>Удалить зал</li></a>
        </check>
        </ul>
      </div>
      </check>
    </li>
  </ul>
  </check>

  <check if="{{isset(@room) && @PATH!='/settings/rooms' && !isset(@open_receipts)}}">
  <ul class="menu">
    <li class="first_menu no_arrow">
      <a href="/receipts/all_open" class="show_window"><button type="button">Показать все открытые чеки</button></a>
    </li>
  </ul>
  </check>


  <check if="{{isset(@open_receipts)}}">
    <true>
  <ul class="menu" id="receipt_menu">
    <li class="first_menu">
      <button type="button">
      <check if="{{@base_settings['cafe_mode']==1}}">
        {{@receipt['table']['title']}}
      </check>
        Чек №{{@COOKIE.receipt_id}}
      </button>
      <div class="menu_list">
        <ul class="menu_list_ul">
      <repeat group="{{@menu.receipts}}" key="{{@href}}" value="{{@m}}">
        <check if="{{@href!='/receipts/move' || @tables_count>1}}">
        <a href="{{@href}}" class='{{@m.class}}'><li>{{@m.title}}</li></a>
        </check>
      </repeat>
      <repeat group="{{@open_receipts}}" value="{{@r}}">
        <check if="{{@COOKIE.receipt_id!=@r['id']}}">
          <a href="/receipts/switch?id={{@r['id']}}&table_id={{@r['id']}}" class="send_ajax"><li>Чек №{{@r['id']}}</li></a>
        </check>
      </repeat>
        </ul>
      </div>
    </li>
  </ul>
    </true>
  </check>
  <check if="{{mb_strpos(@PATH, '/egais/')!==false}}">
  <ul class="menu">
    <li class="first_menu">
      <button type="button">ЕГАИС</button>
      <div class="menu_list">
        <ul class="menu_list_ul">
      <repeat group="{{@menu.egais}}" key="{{@href}}" value="{{@m}}">
        <a class="{{@m['class']}}" href="{{@href}}"><li class="{{@PATH==@href?'select':''}}">{{@m['title'] | raw}}</li></a>
      </repeat>
        </ul>
      </div>
    </li>
  </ul>  
  </check>

  <check if="{{!@base_settings['autonomous'] && @api_data['domen']}}">
  <div id="worker_walk">
    <a title="Отметить проход сотрудника" class="show_window" href="/receipts/walk">
      <i class="fas fa-walking"></i>
    </a>
  </div>
  </check>
  <check if="{{isset(@room) && !isset(@receipt) && @PATH!='/settings/rooms'}}">
  <audio id="neworder" src="/ui/sounds/neworder.mp3" preload="auto"></audio>
  <div class="online_order">
    <i class="fas fa-cart-arrow-down"></i>
    <span class="small neworders_count hide">(<b>0</b>)</span>
    <span class="small">Заказы</span>
  </div>
  </check>
</div>
