<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>{% block title %}{% endblock %}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    {% block link %}{% endblock %}
    <!-- 新 Bootstrap4 核心 CSS 文件../static/css/bootstrap.min.css-->
    <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}">
    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="{{ url_for('static', filename='js/jquery-3.2.1.min.js') }}"></script>
    <!-- 最新的 Bootstrap4 核心 JavaScript 文件 -->
    <script src="{{ url_for('static', filename='js/bootstrap.bundle.min.js') }}"></script>
    <!-- Rita 網頁 title 旁邊的 icon -->
    <!-- 參考資料 https://codertw.com/%E5%89%8D%E7%AB%AF%E9%96%8B%E7%99%BC/26839/ -->
    <link rel="icon" href="{{ url_for('static', filename='img/coffee.svg') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/navbars.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/headers.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/modals.css') }}">
{% block script %}{% endblock %}

 <script>
        var status = '{{status}}';
 </script>       
{% block style %}{% endblock %}

</head>

<body>  
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
    <div class="container-fluid">
      <a class="navbar-brand text-white" >
      <span class="h3 mx-1">{{ title }}</span>
      </a>
      <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample05" aria-controls="navbarsExample05" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>

      <div class="collapse navbar-collapse" id="navbarsExample05">
        <ul class="navbar-nav col-lg-11 justify-content-lg-end">
          <li class="nav-item">
            <a class="nav-link" aria-current="page" href="/">首頁</a>
          </li>
          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="" data-bs-toggle="dropdown" aria-expanded="false">貨櫃狀態</a>
            <ul class="dropdown-menu">
              <li><a style="line-height: 20px;" class="dropdown-item" href="/demo">DEMO 貨櫃</a></li>
              <div class="dropdown-divider"></div>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/clean">清洗貨櫃</a></li>
              <div class="dropdown-divider"></div>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/ferment">發酵貨櫃</a></li>
              <div class="dropdown-divider"></div>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/dry">乾燥貨櫃</a></li>
              <div class="dropdown-divider"></div>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/board">板子燒錄</a></li>
            </ul>
          </li>
          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="" data-bs-toggle="dropdown" aria-expanded="false">感測器圖表</a>
            <ul class="dropdown-menu">
              <li><a style="line-height: 20px;" class="dropdown-item" href="/sensor_chart_CI/UltraSonic/1">清洗槽__入料</a></li>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/sensor_chart_C/UltraSonic/1">清洗槽__桶槽</a></li>
              <div class="dropdown-divider"></div>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/sensor_chart_R/UltraSonic/1">中水_桶槽</a></li>
              <div class="dropdown-divider"></div>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/sensor_chart_S/UltraSonic/1">色選機__桶槽</a></li>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/sensor_chart_SO/UltraSonic/1">色選機__出料</a></li>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/sensor_chart_P/UltraSonic/1">脫皮機__桶槽</a></li>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/sensor_chart_PO/UltraSonic/1">脫皮機__出料</a></li>
              <div class="dropdown-divider"></div>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/sensor_chart_FI/UltraSonic/1">發酵槽__入料</a></li>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/sensor_chart_F/UltraSonic/1">發酵槽__桶槽</a></li>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/sensor_chart_FO/UltraSonic/1">發酵槽__出料</a></li>
              <div class="dropdown-divider"></div>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/sensor_chart_DI/UltraSonic/1">乾燥槽__入料</a></li>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/sensor_chart_D/UltraSonic/1">乾燥槽__桶槽</a></li>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/sensor_chart_DO/UltraSonic/1">乾燥槽__出料</a></li> 
            </ul>
          </li>
          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="" data-bs-toggle="dropdown" aria-expanded="false">致動器圖表</a>
            <ul class="dropdown-menu">
              <li><a style="line-height: 20px;" class="dropdown-item" href="/actuator_chart_CI/vacuum/1">清洗槽__入料</a></li>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/actuator_chart_C/vacuum/1">清洗槽__桶槽</a></li>
              <div class="dropdown-divider"></div>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/actuator_chart_R/vacuum/1">中水_桶槽</a></li>
              <div class="dropdown-divider"></div>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/actuator_chart_S/vacuum/1">色選機__桶槽</a></li>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/actuator_chart_P/vacuum/1">脫皮機__桶槽</a></li>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/actuator_chart_PO/vacuum/1">脫皮機__出料</a></li>
              <div class="dropdown-divider"></div>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/actuator_chart_FI/vacuum/1">發酵槽__入料</a></li>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/actuator_chart_F/vacuum/1">發酵槽__桶槽</a></li>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/actuator_chart_FO/vacuum/1">發酵槽__出料</a></li>
              <div class="dropdown-divider"></div>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/actuator_chart_DI/vacuum/1">乾燥槽__入料</a></li>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/actuator_chart_D/vacuum/1">乾燥槽__桶槽</a></li>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/actuator_chart_DO/vacuum/1">乾燥槽__出料</a></li> 
            </ul>
          </li>
          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="" data-bs-toggle="dropdown" aria-expanded="false">攝影機畫面</a>
            <ul class="dropdown-menu">
              <li><a style="line-height: 20px;" class="dropdown-item" href="/camera_clean">清洗貨櫃</a></li>
              <div class="dropdown-divider"></div>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/camera_ferment">發酵貨櫃</a></li>
              <div class="dropdown-divider"></div>
              <li><a style="line-height: 20px;" class="dropdown-item" href="/camera_dry">乾燥貨櫃</a></li>        
            </ul>
          </li>
          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" aria-expanded="false">User</a>
            <ul class="dropdown-menu">
              {% if status == 0 %}
              <li><a style="line-height: 20px;" class="dropdown-item" href="#">權限:開發人員</a></li>
              <li><a style="line-height: 20px;" class="dropdown-item" href="#">修改使用者權限</a></li>
              <div class="dropdown-divider"></div>
              {% elif status == 1 %}
              <li><a style="line-height: 20px;" class="dropdown-item" href="#">權限:經銷商</a></li>
              <li><a style="line-height: 20px;" class="dropdown-item" href="#">修改使用者權限</a></li>
              <div class="dropdown-divider"></div>
              {% elif status == 2 %}
              <li><a style="line-height: 20px;" class="dropdown-item" href="#">權限:使用者</a></li>
              <div class="dropdown-divider"></div>
              {% endif %}
              <li><a style="line-height: 20px;" class="dropdown-item" href="/logout">帳號登出</a></li>
            </ul>
          </li>
        </ul>
      </div>
    </div>
  </nav>
    <main>
    <!-- 可供更改的部分 -->
    {% block main %}{% endblock %}
    </main>
  <footer class="py-3 my-4">
    <ul class="nav justify-content-center border-bottom pb-3 mb-3">
    <li class="nav-item"><a href="#" class="nav-link px-2 text-muted">關於</a></li>
    <li class="nav-item"><a class="nav-link px-2 text-muted">|</a></li>
    <li class="nav-item"><a href="#" class="nav-link px-2 text-muted">產品與經銷商</a></li>
    <li class="nav-item"><a class="nav-link px-2 text-muted">|</a></li>
    <li class="nav-item"><a href="/" class="nav-link px-2 text-muted">回首頁</a></li>
    </ul>
    <p class="text-center text-muted">&copy; Copyright © 2022 GOLD IN TECHNOLOGY INC. 保留一切權利。</p>
  </footer>
{% block script2 %}{% endblock %}
</body>

</html>