annotate views/hello_template.tpl @ 5:c49f7fe82743

changed the grid layout to a more responsive and compatible self-calculating JS based version
author sean
date Wed, 22 Jul 2015 10:25:27 +0200
parents 3e66e2f92770
children 3acc5164369e
rev   line source
4
3e66e2f92770 added LICENSE and license headers in the sourcecode. Added readme
sean
parents: 3
diff changeset
1 <!-- This tempalte is a part of bottledash
3e66e2f92770 added LICENSE and license headers in the sourcecode. Added readme
sean
parents: 3
diff changeset
2 author: sean engelhardt >sean.engelhardt@intevation.de
3e66e2f92770 added LICENSE and license headers in the sourcecode. Added readme
sean
parents: 3
diff changeset
3 License: GNU GPL >= v2. See LICENSE for details. -->
3e66e2f92770 added LICENSE and license headers in the sourcecode. Added readme
sean
parents: 3
diff changeset
4
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
5 <%
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
6
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
7 import math
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
8 from datetime import date
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
9
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
10 #################
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
11 # date and time #
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
12 #################
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
13
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
14
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
15 today = date.today()
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
16 weekday = ("Montag", "Dienstag", "Mittwoch", "Donnerstag",
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
17 "Freitag", "Samstag", "Sonntag")[today.weekday()]
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
18 month_name = ("Januar", "Februar", "März", "Aprill", "Mai",
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
19 "Juni", "Juli", "August", "September", "Oktober",
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
20 "November", "Dezember")[today.month-1]
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
21
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
22
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
23 ##################
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
24 # size of tiles #
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
25 ##################
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
26
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
27 number_of_rows = 3
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
28
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
29 #################
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
30 # viewport size #
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
31 #################
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
32
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
33 vp_size = "12px"
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
34
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
35 #if len(tiles) <= 2:
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
36 # vp_size = "6vw"
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
37 #elif len(tiles) >2 and len(tiles) <=4 :
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
38 # vp_size = "5vw"
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
39 #elif len(tiles) >4 and len(tiles) <=6 :
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
40 # vp_size = "4vw"
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
41 #elif len(tiles) >6 and len(tiles) <=8 :
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
42 # vp_size = "3vw"
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
43 #end
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
44 %>
2
3671857d1dfe added views
sean
parents:
diff changeset
45
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
46 <script type="text/javascript">
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
47
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
48 var global_width;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
49 var global_height;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
50 var tile_width;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
51 var tile_height;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
52
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
53 var tiles = document.getElementsByClassName("tile");
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
54 var border_width = 1;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
55 var space_between_tiles = 8;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
56
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
57 var space_lr_borders;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
58 var space_lr_margin;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
59
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
60 function calc_tile_with(){
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
61 var tiles_per_row = Math.floor(tiles.length / {{number_of_rows}});
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
62 var distance = (space_between_tiles*2) + (border_width*2)
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
63 var tile_width = ((global_width / tiles_per_row ) - distance);
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
64 return tile_width;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
65 }
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
66
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
67 function resize_content(){
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
68 global_width = document.getElementById("content").clientWidth;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
69 global_height = document.getElementById("content").clientHeight;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
70
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
71
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
72 tile_width = calc_tile_with();
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
73 tile_height = (global_height / {{number_of_rows}});
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
74
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
75 for(var tile = 0; tile < tiles.length; tile++){
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
76 tiles[tile].style.width= tile_width + 'px';
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
77 tiles[tile].style.height= tile_height + 'px';
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
78 }
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
79 }
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
80
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
81 window.onresize = function(){
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
82 resize_content();
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
83 }
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
84
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
85 document.addEventListener("DOMContentLoaded", function(event) {
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
86 resize_content();
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
87 });
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
88
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
89 </script>
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
90
2
3671857d1dfe added views
sean
parents:
diff changeset
91 <style>
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
92 *{
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
93 margin: 0 auto;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
94 padding: 0 auto;
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
95 font-family: "Lucida Console", Monaco, monospace;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
96 }
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
97
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
98 body {
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
99 overflow: hidden;
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
100 }
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
101
2
3671857d1dfe added views
sean
parents:
diff changeset
102 #wrapper{
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
103 background-color: #F2F2F2;
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
104 color: black;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
105 min-width: 100%;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
106 min-height: 100%;
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
107 }
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
108
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
109 #topbar{
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
110 min-width: auto;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
111 padding-left: 8px;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
112 padding-top: 8px;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
113 padding-bottom: 8px;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
114 /*height: 5%;*/
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
115 font-family: Arial, Helvetica, sans-serif;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
116 }
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
117
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
118 #content{
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
119 min-width: 100%;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
120 height:95%;
2
3671857d1dfe added views
sean
parents:
diff changeset
121 }
3671857d1dfe added views
sean
parents:
diff changeset
122
3671857d1dfe added views
sean
parents:
diff changeset
123 .tile{
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
124 float: left;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
125 margin: 8px;
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
126 background-color: #FFFFFF;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
127 border: 1px solid #999999;
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
128 border: none;
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
129 text-align:center;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
130 vertical-align: middle;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
131 }
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
132
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
133 .clear{
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
134 height: 0px;
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
135 clear: both;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
136 }
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
137
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
138 /*tiles types*/
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
139
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
140 .statusmon{
2
3671857d1dfe added views
sean
parents:
diff changeset
141 color: white;
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
142 font-size: {{vp_size}};
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
143 }
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
144
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
145 .chart{
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
146 font-size: {{vp_size}};
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
147 }
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
148
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
149 .active{
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
150 border: 1px solid #00cc00;
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
151 background-color: #009900;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
152 }
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
153
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
154 .dead{
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
155 border: 1px solid #cc0000;
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
156 background-color: #990000;
2
3671857d1dfe added views
sean
parents:
diff changeset
157 }
3671857d1dfe added views
sean
parents:
diff changeset
158
3671857d1dfe added views
sean
parents:
diff changeset
159 </style>
3671857d1dfe added views
sean
parents:
diff changeset
160
3671857d1dfe added views
sean
parents:
diff changeset
161 <div id = "wrapper">
3671857d1dfe added views
sean
parents:
diff changeset
162
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
163 <div id = "topbar">
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
164 <b>{{weekday}}</b> {{today.day}}. {{month_name}}
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
165 </div>
2
3671857d1dfe added views
sean
parents:
diff changeset
166
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
167 <div id = "content">
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
168
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
169 <%
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
170 for tile in tiles :
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
171 type = ""
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
172 text = ""
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
173 status = ""
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
174 if tile["type"] == "mon" :
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
175 type = "statusmon"
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
176 text = tile["source"]
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
177 if tile["status"] == "up" :
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
178 status = "active"
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
179 elif tile["status"] == "down" :
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
180 status = "dead"
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
181 end
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
182 elif tile["type"] == "d3.js" :
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
183 type = "chart"
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
184 text = "place for a chart!"
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
185 end
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
186 %>
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
187 <div class = "tile {{type}} {{status}}">
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
188 {{text}}
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
189 </div>
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
190
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
191 % end
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
192
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
193 </div>
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
194 </div>
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)