aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSix <unknown>2011-05-03 21:05:01 -0400
committerSix <unknown>2011-05-03 21:05:01 -0400
commitbde9e79fd5aa1d46f2ecf2351dcaa31a6bd7f9d4 (patch)
tree9ea47213867675dbeb2af29eaf529785c6e0cffa
parent43e904ceedbc363980d4c1caaf3d0b2b2d6b6cff (diff)
parent9b783925131e86615e2cd6fdef68583e411431c8 (diff)
downloadd2-bde9e79fd5aa1d46f2ecf2351dcaa31a6bd7f9d4.tar.bz2
d2-bde9e79fd5aa1d46f2ecf2351dcaa31a6bd7f9d4.tar.xz
d2-bde9e79fd5aa1d46f2ecf2351dcaa31a6bd7f9d4.zip
merge
-rw-r--r--lib/d2/app/controllers/index.py3
-rw-r--r--templates/index.html88
2 files changed, 58 insertions, 33 deletions
diff --git a/lib/d2/app/controllers/index.py b/lib/d2/app/controllers/index.py
index 440bc56..23f7b5e 100644
--- a/lib/d2/app/controllers/index.py
+++ b/lib/d2/app/controllers/index.py
@@ -47,7 +47,8 @@ class IndexController(BaseController):
47 self.render('index.html', 47 self.render('index.html',
48 mode="map", 48 mode="map",
49 details=details, 49 details=details,
50 plots=plots) 50 plots=plots,
51 forges=forges)
51 else: 52 else:
52 self.render('index.html', mode="get") 53 self.render('index.html', mode="get")
53 54
diff --git a/templates/index.html b/templates/index.html
index 467cd7d..5977438 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -10,7 +10,7 @@
10 <link rel="stylesheet" href="/static/css/style_search.css" type="text/css" /> 10 <link rel="stylesheet" href="/static/css/style_search.css" type="text/css" />
11{% end %} 11{% end %}
12 12
13{% if mode == 'map' %} 13{% if mode == 'map' and len(plots) > 0 %}
14 <script src="/static/js/openlayers2.10/OpenLayers.js"></script> 14 <script src="/static/js/openlayers2.10/OpenLayers.js"></script>
15 <script src="/static/js/openlayers2.10/lib/OpenLayers/Tile/InlineXhtml.js"></script> 15 <script src="/static/js/openlayers2.10/lib/OpenLayers/Tile/InlineXhtml.js"></script>
16 <script src="/static/js/openlayers2.10/lib/OpenLayers/Layer/WMS/InlineXhtml.js"></script> 16 <script src="/static/js/openlayers2.10/lib/OpenLayers/Layer/WMS/InlineXhtml.js"></script>
@@ -78,6 +78,16 @@
78 78
79 function emphasize() 79 function emphasize()
80 { 80 {
81 {% if (len(forges) > 0) %}
82 var e = document.getElementById("{{forges[0].occupant_id}}");
83 if (e)
84 {
85 e.setAttributeNS(null, "fill", "red");
86 e.style.fontFamily = "Arial";
87 e.style.fontSize = 20;
88 setCenter();
89 }
90 {% end %}
81 } 91 }
82 92
83 //Note: origin is set at the bottom left corner for OpenLayers !!! 93 //Note: origin is set at the bottom left corner for OpenLayers !!!
@@ -92,7 +102,7 @@
92{% end %} 102{% end %}
93</head> 103</head>
94 104
95{% if mode == 'map' %} 105{% if mode == 'map' and len(plots) > 0 %}
96 <body onload="init();"> 106 <body onload="init();">
97{% else %} 107{% else %}
98 <body> 108 <body>
@@ -109,41 +119,55 @@
109</div> 119</div>
110 120
111{% if mode == 'post' %} 121{% if mode == 'post' %}
112{% if details %} 122 {% if details %}
123 <div id="result">
124 Found:
125 {% for detail in details %}
126 <ul id="result-list">
127 {% if detail.id_type == u'occupant' %}
128 <li><a href="/occupant/{{detail.id}}">{{detail.label}}</a></li>
129 {% else %}
130 <li><a href="/plot/{{detail.id}}">{{detail.label}} </a></li>
131 {% end %}
132 </ul>
133 {% end %}
134 </div>
135 {% else %}
113 <div id="result"> 136 <div id="result">
114 Found: 137 Sorry, no match found. Please try to broaden your search by entering less in t he search field above.
115 {% for detail in details %}
116 <ul id="result-list">
117 {% if detail.id_type == u'occupant' %}
118 <li><a href="/occupant/{{detail.id}}">{{detail.label}}</a></li>
119 {% else %}
120 <li><a href="/plot/{{detail.id}}">{{detail.label}} </a></li>
121 {% end %}
122 </ul>
123 {% end %}
124 </div> 138 </div>
139 {% end %}
125{% else %} 140{% else %}
126<div id="result"> 141 {% if mode == 'map' %}
127Sorry, no match found. Please try to broaden your search by entering less in t he search field above. 142 {% if len(plots) > 0 %}
128</div> 143 <div id="content">
129{% end %} 144 <div id="mapdiv">
130{% else %} 145 <div id="map"></div>
131{% if mode == 'map' %} 146 </div>
132 <div id="content"> 147 <div id="infodiv">
133 <div id="mapdiv"> 148 <h2>{{details[0]}}</h2>
134 <div id="map"></div> 149 <ul id="details">
150 <li>Location: {{plots[0].map.location.name}} </li>
151 {% for i in xrange(3, len(details._fields)) %}
152 <li>{{getattr(details, details._fields[i]).name}}: {{getattr(details, details._fields[i]).data}}</li>
153 {% end %}
154 </ul>
155 </div>
135 </div> 156 </div>
136 <div id="infodiv"> 157 {% else %}
137 <h2>{{details[0]}}</h2> 158 <div id="content">
138 <ul id="details"> 159 Sorry, unable to locate in the map
139 <li>Location: {{plots[0].map.location.name}} </li> 160 <div id="infodiv">
140 {% for i in xrange(3, len(details._fields)) %} 161 <h2>{{details[0]}}</h2>
141 <li>{{getattr(details, details._fields[i]).name}}: {{getattr(details, details._fields[i]).data}}</li> 162 <ul id="details">
142 {% end %} 163 {% for i in xrange(3, len(details._fields)) %}
143 </ul> 164 <li>{{getattr(details, details._fields[i]).name}}: {{getattr(details, details._fields[i]).data}}</li>
165 {% end %}
166 </ul>
167 </div>
144 </div> 168 </div>
145 </div> 169 {% end %}
146{% end %} 170 {% end %}
147{% end %} 171{% end %}
148<div id="footer"> 172<div id="footer">
149 <span id="footer-text">Brought you by team:</span> 173 <span id="footer-text">Brought you by team:</span>