annotate views/hello_template.tpl @ 6:3acc5164369e

resize content in height too
author sean
date Wed, 22 Jul 2015 10:47:55 +0200
parents c49f7fe82743
children c8cb2aa0b72c
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
6
3acc5164369e resize content in height too
sean
parents: 5
diff changeset
27 number_of_rows = 2
5
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">
6
3acc5164369e resize content in height too
sean
parents: 5
diff changeset
47
5
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;
6
3acc5164369e resize content in height too
sean
parents: 5
diff changeset
52
5
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;
6
3acc5164369e resize content in height too
sean
parents: 5
diff changeset
56
5
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;
6
3acc5164369e resize content in height too
sean
parents: 5
diff changeset
59
5
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}});
6
3acc5164369e resize content in height too
sean
parents: 5
diff changeset
62 var distance = (space_between_tiles*2) + (border_width*2);
5
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 }
6
3acc5164369e resize content in height too
sean
parents: 5
diff changeset
66
3acc5164369e resize content in height too
sean
parents: 5
diff changeset
67 function calc_tile_height(){
3acc5164369e resize content in height too
sean
parents: 5
diff changeset
68 var distance = (space_between_tiles*2) + (border_width*2);
3acc5164369e resize content in height too
sean
parents: 5
diff changeset
69 var tile_height = ((global_height / {{number_of_rows}} ) - distance);
3acc5164369e resize content in height too
sean
parents: 5
diff changeset
70 return tile_height;
3acc5164369e resize content in height too
sean
parents: 5
diff changeset
71 }
3acc5164369e resize content in height too
sean
parents: 5
diff changeset
72
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
73 function resize_content(){
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
74 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
75 global_height = document.getElementById("content").clientHeight;
6
3acc5164369e resize content in height too
sean
parents: 5
diff changeset
76
3acc5164369e resize content in height too
sean
parents: 5
diff changeset
77
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
78 tile_width = calc_tile_with();
6
3acc5164369e resize content in height too
sean
parents: 5
diff changeset
79 tile_height = calc_tile_height();
3acc5164369e resize content in height too
sean
parents: 5
diff changeset
80
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
81 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
82 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
83 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
84 }
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
85 }
6
3acc5164369e resize content in height too
sean
parents: 5
diff changeset
86
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
87 window.onresize = function(){
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
88 resize_content();
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
89 }
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
90
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
91 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
92 resize_content();
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
93 });
6
3acc5164369e resize content in height too
sean
parents: 5
diff changeset
94
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
95 </script>
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
96
2
3671857d1dfe added views
sean
parents:
diff changeset
97 <style>
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
98 *{
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
99 margin: 0 auto;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
100 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
101 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
102 }
6
3acc5164369e resize content in height too
sean
parents: 5
diff changeset
103
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
104 body {
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
105 overflow: hidden;
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
106 }
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
107
2
3671857d1dfe added views
sean
parents:
diff changeset
108 #wrapper{
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
109 background-color: #F2F2F2;
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
110 color: black;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
111 min-width: 100%;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
112 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
113 }
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
114
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
115 #topbar{
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
116 min-width: auto;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
117 padding-left: 8px;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
118 padding-top: 8px;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
119 padding-bottom: 8px;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
120 /*height: 5%;*/
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
121 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
122 }
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
123
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
124 #content{
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
125 min-width: 100%;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
126 height:95%;
2
3671857d1dfe added views
sean
parents:
diff changeset
127 }
3671857d1dfe added views
sean
parents:
diff changeset
128
3671857d1dfe added views
sean
parents:
diff changeset
129 .tile{
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
130 float: left;
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
131 margin: 8px;
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
132 background-color: #FFFFFF;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
133 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
134 border: none;
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
135 text-align:center;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
136 vertical-align: middle;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
137 }
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
138
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
139 .clear{
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
140 height: 0px;
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
141 clear: both;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
142 }
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
143
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
144 /*tiles types*/
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
145
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
146 .statusmon{
2
3671857d1dfe added views
sean
parents:
diff changeset
147 color: white;
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
148 font-size: {{vp_size}};
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
149 }
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
150
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
151 .chart{
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
152 font-size: {{vp_size}};
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
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
155 .active{
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
156 border: 1px solid #00cc00;
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
157 background-color: #009900;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
158 }
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
159
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
160 .dead{
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
161 border: 1px solid #cc0000;
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
162 background-color: #990000;
2
3671857d1dfe added views
sean
parents:
diff changeset
163 }
3671857d1dfe added views
sean
parents:
diff changeset
164
3671857d1dfe added views
sean
parents:
diff changeset
165 </style>
3671857d1dfe added views
sean
parents:
diff changeset
166
3671857d1dfe added views
sean
parents:
diff changeset
167 <div id = "wrapper">
3671857d1dfe added views
sean
parents:
diff changeset
168
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
169 <div id = "topbar">
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
170 <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
171 </div>
2
3671857d1dfe added views
sean
parents:
diff changeset
172
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
173 <div id = "content">
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
174
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
175 <%
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
176 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
177 type = ""
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
178 text = ""
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
179 status = ""
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
180 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
181 type = "statusmon"
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
182 text = tile["source"]
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
183 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
184 status = "active"
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
185 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
186 status = "dead"
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
187 end
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
188 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
189 type = "chart"
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
190 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
191 end
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
192 %>
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
193 <div class = "tile {{type}} {{status}}">
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
194 {{text}}
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
195 </div>
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
196
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
197 % end
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
198
5
c49f7fe82743 changed the grid layout to a more responsive and compatible self-calculating JS based version
sean
parents: 4
diff changeset
199 </div>
6
3acc5164369e resize content in height too
sean
parents: 5
diff changeset
200 </div>
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)