From d67a25eb3d388e5926376e6d0f7842028d1cd7f0 Mon Sep 17 00:00:00 2001
From: Tor-Einar Skog <tor-einar.skog@bioforsk.no>
Date: Fri, 15 Apr 2016 16:05:28 +0200
Subject: [PATCH] Improved view of apple fruit moth forecasts

---
 applefruitmoth/locale/nb/LC_MESSAGES/django.mo | Bin 632 -> 1399 bytes
 applefruitmoth/locale/nb/LC_MESSAGES/django.po |  16 +++++++++++++---
 applefruitmoth/static/applefruitmoth/js/map.js |   7 ++++++-
 .../templates/applefruitmoth/index.html        |  12 +++++++++++-
 4 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/applefruitmoth/locale/nb/LC_MESSAGES/django.mo b/applefruitmoth/locale/nb/LC_MESSAGES/django.mo
index 8059c528026978fb9ef90f9de92b26a52f068b24..b6c02177ed3b8f418c78baebe963c3324881bb81 100644
GIT binary patch
delta 844
zcmeyt@||mf51$${1A`kA0|O@m14AzB#HjrohNcRJ##V-wn-v*V87J#AiPfj(DWn!D
zq?RZYC*~#=C8cJjDCDN*<mBfn<m6{3=A<eV9bTG}o>`V!l&X-akXBThU6PVnTvC*o
zU6PuYs*s<q;OFV&>942YsgPKjURqqDkb8J(UTTU$Nor0`YLP-pDuzLMsS1gCC5bsX
z3Q33Smlb8_Bo?O@DHI%Ds*synl%1$hl$w@Wl$ckXT2gd)S&>3wnL<&1dY+zwOR7S~
z;T^>#sYM{imSm=6rYof8DI^_UR#Z@Qct=^PLUDesLUC$dN@}q}NoEerWo|`@3Mr|1
zd8tTB^AyrD^YT)Q>J`c|6%zB(i&6`U(~A;QV78@#OwB#KBPT~86KuUgT7Hp2Mj6PV
zAlKv<rxuqa7H8#y-BqHHlv<RUo|jszke^<Bc&S2SUP@|?LP26tVsU0kNor9^D%cQ&
zsd@^bC7|%Ehr2B^FD<_)7i?r|o<eqFo<eSFUV2Ju9-2<DC-civi^?+dN{Uj86cY1_
za}F;p)>Cjhydx(a<a>p(!%K@G5l{>d>YV&sP|zWTc1o&3aeZQLZYo-c=cVd^;<YRj
z><W-~z<yIGEm0^-EGkaTNiES+a0Nwei9%j}wn7r7(I5w;=7BtzUzCxblLC$oNTjEN
zQV1wqL6MbFpID@T@Jxx0LRn@Gnuk;K6hKC#Dio)tgUtbjKgfY8sU-?YIhjQYnc3N(
zBn65@Jq4%4qEv;9vdm%yxI8H8axzOG@efXDAR`h%b}1@=BRMq>oCq=tQWa7Qa#Hme
Od{c8$GV{_?ix>dLa71VT

delta 73
zcmey)^@C-C51%>%1A`kA0|O@m14ACu#Hjro1{Mm2W>!WPn-v*V83mkDi?fR|%TjZS
dQxy`+6pAJrFp2V}<}vuD=A>lirKc7#005YN6L|mt

diff --git a/applefruitmoth/locale/nb/LC_MESSAGES/django.po b/applefruitmoth/locale/nb/LC_MESSAGES/django.po
index 78fbdcee..f17043c2 100644
--- a/applefruitmoth/locale/nb/LC_MESSAGES/django.po
+++ b/applefruitmoth/locale/nb/LC_MESSAGES/django.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-04-08 16:28+0200\n"
+"POT-Creation-Date: 2016-04-15 13:19+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -25,9 +25,19 @@ msgstr "Rognebærmøllvarsling"
 
 #: templates/applefruitmoth/index.html:32
 msgid "Description of apple fruit moth forecasting"
-msgstr "Beskrivelse av rognebærmøllvarslingen"
+msgstr ""
+"Rognebærmøllvarslingen er et samarbeid mellom lokale rådgivere i "
+"fruktdistriktene og NIBIO. I august måned teller de lokale rådgiverne antall "
+"bærklaser på merka referansetrær av rogn. De høster samtidig en bærprøve som "
+"sendes til NIBIO. Fra denne bærprøven finner vi angrepsgrad av rognebærmøll "
+"i rogn for hver prognosestasjon. Det beregnes også andel parasitterte "
+"rognebærmøll. Ut i fra denne informasjonen kan mengden rognebærmøll som "
+"overvintrer anslås. Følgende vår telles antall blomsterklaser på de samme "
+"referansetrærne, og vi kan så regne ut varselet. Er det nok blomsterklaser "
+"på våren i forhold til antallet møll som har overvintret, vil rognebærmøllen "
+"holde seg til rogn og det blir ikke angrep. Bare hvis det blir for lite bær "
+"på rogna vil møllen angripe eple."
 
 #: templates/applefruitmoth/index.html:33
 msgid "Messages"
 msgstr "Meldinger"
-
diff --git a/applefruitmoth/static/applefruitmoth/js/map.js b/applefruitmoth/static/applefruitmoth/js/map.js
index 628a76b4..705d893c 100644
--- a/applefruitmoth/static/applefruitmoth/js/map.js
+++ b/applefruitmoth/static/applefruitmoth/js/map.js
@@ -84,7 +84,7 @@ var initMap = function(container, mapAttribution)
 	          		html: true,
 	          		placement: "auto top",
 	          		title: feature.get("name"),
-	          		content: feature.get("description")
+	          		content: generatePopupContents(feature.get("warningStatus"), feature.get("description"))
 	          	});
 	          	
 	          	poiDetails.popover('show');
@@ -98,4 +98,9 @@ var initMap = function(container, mapAttribution)
 			var pixel = map.getEventPixel(evt.originalEvent);
 			  displayFeatureDetails(pixel);
 			});
+}
+
+function generatePopupContents(warningStatus, description)
+{
+	return "<img src='http://" + settings.vipslogicServerName + "/public/images/station_icon_status_" + warningStatus + ".png'/> " + description;
 }
\ No newline at end of file
diff --git a/applefruitmoth/templates/applefruitmoth/index.html b/applefruitmoth/templates/applefruitmoth/index.html
index 89b4d1c5..55ae10cc 100644
--- a/applefruitmoth/templates/applefruitmoth/index.html
+++ b/applefruitmoth/templates/applefruitmoth/index.html
@@ -52,7 +52,17 @@
 
 		</div> 
 		<div class="col-md-6">
-			<div id="appleFruitMothForecastMap" class="map" style="height: 600px;"><div id="popover"></div></div>
+			<div id="appleFruitMothForecastMap" class="map" style="height: 600px;">
+				<div id="popover"></div>
+				<div id="warningLegend" class="mapBoxPlacement_2"> 
+			        <ul>
+			            <li class="warning_4"><span>{% trans "High risk of infection" %}</span></li>
+			            <li class="warning_3"><span>{% trans "Medium risk of infection" %}</span></li>
+			            <li class="warning_2"><span>{% trans "No risk of infection" %}</span></li>
+			            <li class="warning_0"><span>{% trans "No forecast available" %}</span></li>
+			        </ul>
+			    </div>
+			</div>
 		</div>
 	</div>
 </div>
-- 
GitLab