Blame view

src/misc/templates/base_unlogged.html 8.68 KB
2c61f856   theopuhl   Url change to pat...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<html lang="en">
<head>

    {% load staticfiles %}
  
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Control center for the SVOM French GFT">
    <meta name="author" content="CNRS-IRAP">
    
    
    <title >Colibri Control Center</title>

    <!-- Bootstrap core CSS -->
    <link href={% static "bootstrap/css/bootstrap.css" %} rel="stylesheet">

    <link href={% static "bootstrap/css/sb-admin.css" %} rel="stylesheet">
    <link rel="stylesheet" href={% static "bootstrap/font-awesome/css/font-awesome.min.css" %}>

    <!-- Page Specific CSS -->
    <!--    <link rel="stylesheet" href="http://cdn.oesmith.co.uk/morris-0.4.3.min.css"> -->
    
    <!-- JsTree -->
    <link rel="stylesheet" href={% static "bootstrap/dist/themes/default/style.min.css" %}>
    <link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.10/css/all.css" integrity="sha384-+d0P83n9kaQMCwj8F4RJB66tzIwOKmrdb46+porD/OvrJ+37WqIM7UoBtwHO6Nlg" crossorigin="anonymous">
	
	{% block head %}
	<style> 
  #title {
    font-family: 'Montserra', sans-serif; 
    font-size: 50px;
  }
  </style>
	{% endblock %}

</head>

<body>
<style>

#page-wrapper {
  padding: 15px 60px;
}
d10a07d4   theopuhl   Update Images
47

2c61f856   theopuhl   Url change to pat...
48
#wrapper {
d10a07d4   theopuhl   Update Images
49
  padding-left: 10%; 
2c61f856   theopuhl   Url change to pat...
50
51
52
53
54
55
56
57
58
59
60
61
62
63
}

.side-nav {
  margin-left: -200px;
  left: 200px;
  width: 200px;
}

a {
  font-family: 'Montserra', sans-serif;

}

#fas {
d10a07d4   theopuhl   Update Images
64
  size: 18px;
2c61f856   theopuhl   Url change to pat...
65
}
d10a07d4   theopuhl   Update Images
66
67

#hour
2c61f856   theopuhl   Url change to pat...
68
{
d10a07d4   theopuhl   Update Images
69
70
    color: black;
    font-size: 14px;
2c61f856   theopuhl   Url change to pat...
71
72
}

d10a07d4   theopuhl   Update Images
73
74
75
#signin {
    color: black;
}
2c61f856   theopuhl   Url change to pat...
76

d10a07d4   theopuhl   Update Images
77
78
79
.nav>li>a:focus, .nav>li>a:hover {
    text-decoration: none;
    background-color: transparent !important;
2c61f856   theopuhl   Url change to pat...
80
}
d10a07d4   theopuhl   Update Images
81

2c61f856   theopuhl   Url change to pat...
82
83
84
85
86
87
88
89
90
</style>

{% load tags %}
<div id="wrapper">

      <!-- Sidebar -->
      <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
d10a07d4   theopuhl   Update Images
91
          <a class="navbar-brand" href={% url "index" %} style="color: black;">Colibri Control Center</a>
2c61f856   theopuhl   Url change to pat...
92
93
94
95
96
97
        </div>
           <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>



        <!-- Collect the nav links, forms, and other content for toggling -->
d10a07d4   theopuhl   Update Images
98
99
100
        <!-- #f9ff93 #6b69f3-->
        <div id="topbar" class="collapse navbar-collapse navbar-ex1-collapse navbar-dark bg-primary" style="background-color: #6b69f3;">
        <ul class="nav navbar-nav side-nav navbar-dark bg-primary" id="navbar_list">
2c61f856   theopuhl   Url change to pat...
101
102
103
104
105
106
107
            <li><a href="{% url "weather" %}">Weather</a></li>
            <li><a href="{% url "site" %}">Observatory</a></li>
            <li><a href="#">Webcams</a></li>
            <li><a href="{% url "alerts_list" %}">Alerts</a></li>
            <li><a href="{% url "current_schedule" %}">Schedule</a></li>
          </ul>
          <ul class="nav navbar-nav navbar-right navbar-user">
d10a07d4   theopuhl   Update Images
108
109
110
111
            <li><a class="nav-brand" id="hour"></a></li>
            <li><a class="nav-brand" id="day_night" href="{% url "weather" %}"><img id="day_night_img"></a></li>
            <li><a class="nav-brand" id="wind" href="{% url "weather" %}"><img id="wind_img"></a></li>
            <li><a class="nav-brand" id="weather" href="{% url "weather" %}"><img id="weather_img"></a></li>
2c61f856   theopuhl   Url change to pat...
112
            <li>
d10a07d4   theopuhl   Update Images
113
                <a class="nav-brand" id="globalmode" style="color: black;"> {% global_mode  request %} </a>              
2c61f856   theopuhl   Url change to pat...
114
115
            </li>
            <li>
d10a07d4   theopuhl   Update Images
116
              <a class="nav-link" id="signin" href="{% url "user_signin" %}" ><i class="fa fa-power-off"></i> Sign in</a>             
2c61f856   theopuhl   Url change to pat...
117
118
119
120
121
            </li>
          </ul>
            <script>
              var TOO_STRONG_WIND = 60; //Totally arbitrary values, just for demonstration
              var MAX_CLOUD_VALUE = 1;
9f3db1a3   Quentin Durand   plc_mode in progr...
122
              var REFRESH_ICONS_FREQUENCE_MILLISECONDS = 1000;
2c61f856   theopuhl   Url change to pat...
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
              var MAX_RAIN_RATE = 10;

              $( document ).ready(function() {
              get_hour();
              setInterval(function() {get_hour();}, 900);

              function get_hour()
              {
                  $("#hour").text("Site time: " + moment().tz("America/Tijuana").format('LTS (Z UTC)'));
              }

              ajax_request();
              interval = setInterval(function() {ajax_request();}, REFRESH_ICONS_FREQUENCE_MILLISECONDS);

              function ajax_request() {
                  $.get("{% url 'retrieve_env_navbar' %}", function (weather_status) {
                      if (weather_status)
                      {
                          /*
                          *** totally arbitrary method for day/night cycle, just for demonstration
                           */
                          var hour = new Date().getTime();
                          var site_time = new Date(hour - 9 * 3600 * 1000).getHours();
                          var _img_day_night =document.createElement('img');
                          if (site_time > 5 && site_time < 20)
d10a07d4   theopuhl   Update Images
148
                              _img_day_night.src ="{% static 'media/rising_sun.png' %}";
2c61f856   theopuhl   Url change to pat...
149
                          else
d10a07d4   theopuhl   Update Images
150
151
152
                              _img_day_night.src ="{% static 'media/moon.png' %}";
                          _img_day_night.width = 18;
                          _img_day_night.height = 18;
2c61f856   theopuhl   Url change to pat...
153
154
155
156
157
                          _img_day_night.id ="day_night_img";
                          _img_day_night.alt="html5";
                          $("#day_night_img").replaceWith(_img_day_night);

                          var _img = document.createElement('img');
d10a07d4   theopuhl   Update Images
158
159
                          _img.width = 18;
                          _img.height = 18;
2c61f856   theopuhl   Url change to pat...
160
161
                          _img.id ="weather_img";
                          if(parseInt(weather_status[0]['fields']['rain']) > MAX_RAIN_RATE)
d10a07d4   theopuhl   Update Images
162
                              _img.src = "{% static 'media/rain.png' %}";
2c61f856   theopuhl   Url change to pat...
163
                          else if (parseInt(weather_status[0]['fields']['cloud']) > MAX_CLOUD_VALUE)
d10a07d4   theopuhl   Update Images
164
                              _img.src = "{% static 'media/cloud.png' %}";
2c61f856   theopuhl   Url change to pat...
165
                          else
d10a07d4   theopuhl   Update Images
166
167
168
                              _img.src = "{% static 'media/sun.png' %}";
                              _img.width = 18;
                              _img.height = 18;
2c61f856   theopuhl   Url change to pat...
169
170
171
172
                              _img.alt = "html5";
                          $("#weather_img").replaceWith(_img);

                          var _im = document.createElement('img');
d10a07d4   theopuhl   Update Images
173
174
                          _im.width = 18;
                          _im.height = 18;
2c61f856   theopuhl   Url change to pat...
175
176
                          _im.id="wind_img";
                          if (parseInt(weather_status[0]['fields']['wind']) >= TOO_STRONG_WIND)
d10a07d4   theopuhl   Update Images
177
                            _im.src = "{% static 'media/wind.png' %}";
2c61f856   theopuhl   Url change to pat...
178
                          else
d10a07d4   theopuhl   Update Images
179
                            _im.src= "{% static 'media/windsock_nowind.png' %}";
2c61f856   theopuhl   Url change to pat...
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
                          $("#wind_img").replaceWith(_im);
                      }
                  }, 'json')
                      .fail(function () {
                          console.log('Ajax error: GET request failed\n');
                      })
              }});
          </script>

        </div><!-- /.navbar-collapse -->

      </nav>

      <div id="page-wrapper">
      
      
      	<div class="row">      	
			<center><h2 id="title">{% block title %}  {% endblock %}</h2></center>
		</div>
	
		{% block content %}
		   
		   
		{% endblock %}
        

      </div><!-- /#page-wrapper -->

    </div><!-- /#wrapper -->

        <!-- Javascript function refreshing weather icons on the navbar -->


    
    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
    <script  src="{% static "/js/moment.min.js" %}"></script>
    <script  src="{% static "/js/moment-timezone.min.js" %}"></script>
    <script  src="{% static "/js/moment-timezone-with-data.min.js" %}"></script>


    <script src={% static "bootstrap/js/bootstrap.min.js" %}></script>

    <!-- JavaScript -->
{#    <script src={% static "bootstrap/js/jquery-1.10.2.js" %}></script>#}
{#    <script src={% static "bootstrap/js/bootstrap.js" %}></script>#}
        <script src={% static "bootstrap/js/jquery.formset.js" %}></script>

    <!-- Page Specific Plugins -->
    <script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
    <!--    <script src="http://cdn.oesmith.co.uk/morris-0.4.3.min.js"></script>    -->
    <script src={% static "bootstrap/js/morris/chart-data-morris.js" %}></script>
    <script src={% static "bootstrap/js/tablesorter/jquery.tablesorter.js" %}></script>
    <script src={% static "bootstrap/js/tablesorter/tables.js" %}></script>
    
    
</body>
</html>