annotate views/hello_template.tpl @ 4:3e66e2f92770

added LICENSE and license headers in the sourcecode. Added readme
author sean
date Wed, 15 Jul 2015 15:13:07 +0200
parents 3f5bcad45756
children c49f7fe82743
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 import math
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
7 break_tile_lines = math.ceil(len(tiles)/2)
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
8 tilecounter = 1
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
9 vp_size = 1;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
10
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
11 if len(tiles) <= 2:
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
12 vp_size = "6vw"
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
13 elif len(tiles) >2 and len(tiles) <=4 :
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
14 vp_size = "5vw"
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
15 elif len(tiles) >4 and len(tiles) <=6 :
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
16 vp_size = "4vw"
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
17 elif len(tiles) >6 and len(tiles) <=8 :
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
18 vp_size = "3vw"
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
19 end
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
20 %>
2
3671857d1dfe added views
sean
parents:
diff changeset
21
3671857d1dfe added views
sean
parents:
diff changeset
22 <style>
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
23 *{
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
24 margin: 0 auto;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
25 padding: 0 auto;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
26 }
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
27
2
3671857d1dfe added views
sean
parents:
diff changeset
28 #wrapper{
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
29 display: table;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
30 color: black;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
31 background-color: #F2F2F2;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
32 min-width: 100%;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
33 min-height: 100%;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
34 border-spacing: 10px;
2
3671857d1dfe added views
sean
parents:
diff changeset
35 }
3671857d1dfe added views
sean
parents:
diff changeset
36
3671857d1dfe added views
sean
parents:
diff changeset
37 .tile{
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
38 background-color: #FFFFFF;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
39 display:table-cell;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
40
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
41 width: auto;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
42 height: auto;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
43 border: 1px solid #999999;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
44 text-align:center;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
45 vertical-align: middle;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
46
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
47 -webkit-box-shadow: 0px 0px 3px 3px rgba(0,0,0,0.4);
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
48 -moz-box-shadow: 0px 0px 3px 3px rgba(0,0,0,0.4);
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
49 box-shadow: 0px 0px 3px 3px rgba(0,0,0,0.4);
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
50
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
51 }
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
52
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
53 .clear{
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
54 display: table-row;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
55 clear: both;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
56 margin: 0;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
57 padding: 0;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
58 height: 0;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
59 overflow: hidden;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
60 }
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
61
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
62 .statusmon{
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
63 border: 1px solid #000000;
2
3671857d1dfe added views
sean
parents:
diff changeset
64 color: white;
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
65 font-size: {{vp_size}};
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
66 font-family: "Lucida Console", Monaco, monospace;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
67 }
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
68
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
69 .chart{
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
70 font-size: {{vp_size}};
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
71 font-family: "Lucida Console", Monaco, monospace;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
72 }
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
73
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
74 .active{
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
75 background-color: #009900;
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
76 }
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
77
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
78 .dead{
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
79 background-color: #990000;
2
3671857d1dfe added views
sean
parents:
diff changeset
80 }
3671857d1dfe added views
sean
parents:
diff changeset
81
3671857d1dfe added views
sean
parents:
diff changeset
82 </style>
3671857d1dfe added views
sean
parents:
diff changeset
83
3671857d1dfe added views
sean
parents:
diff changeset
84 <div id = "wrapper">
3671857d1dfe added views
sean
parents:
diff changeset
85
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
86 % for tile in tiles :
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
87 % type = ""
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
88 % text = ""
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
89 % status = ""
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
90 % if tile["type"] == "mon" :
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
91 % type = "statusmon"
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
92 % text = tile["source"]
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
93 % if tile["status"] == "up" :
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
94 % status = "active"
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
95 % elif tile["status"] == "down" :
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
96 % status = "dead"
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
97 % end
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
98 % elif tile["type"] == "d3.js" :
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
99 % type = "chart"
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
100 % text = "place for a chart!"
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
101 % end
2
3671857d1dfe added views
sean
parents:
diff changeset
102
3
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
103 <div class = "tile {{type}} {{status}}">
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
104 {{text}}
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
105 </div>
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 % if tilecounter == break_tile_lines:
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
108 <div class = "clear"></div>
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
109 % end
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
110
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
111 % tilecounter += 1
3f5bcad45756 pars a .conf | dynamic adding of divs | dynamiv VP scaling
sean
parents: 2
diff changeset
112 % end
2
3671857d1dfe added views
sean
parents:
diff changeset
113
3671857d1dfe added views
sean
parents:
diff changeset
114 </div>
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)