Skip to content
Snippets Groups Projects
Commit 2b949a4a authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Merge branch 'develop' into 'spotit_multi_org'

# Conflicts:
#   forecasts/models.py
parents b9f1ef2e ec5d1eb1
No related branches found
No related tags found
1 merge request!4Giving season choice for multi org forecast list
...@@ -4,6 +4,7 @@ VIPSWeb/local_settings.py ...@@ -4,6 +4,7 @@ VIPSWeb/local_settings.py
.project .project
.pydevproject .pydevproject
*.pyc *.pyc
geckodriver.log
VIPSWeb/static/admin VIPSWeb/static/admin
VIPSWeb/static/test/2012-02-10.kml VIPSWeb/static/test/2012-02-10.kml
VIPSWeb/static/test/2012-02-10.kml~ VIPSWeb/static/test/2012-02-10.kml~
......
node {
try {
stage('Checkout') {
checkout scm
}
stage('Test'){
sh """
virtualenv --python=python2.7 env
. env/bin/activate
pip install -r requirements.txt
pip install selenium
cp VIPSWeb/local_settings_sample.py VIPSWeb/local_settings.py
./manage.py collectstatic
./manage.py runserver &
./manage.py test
"""
}
stage ('Build') {
}
}
catch (err) {
throw err
}
finally {
sh """
rm -rf static
"""
}
}
...@@ -32,7 +32,7 @@ MAINTENANCE_MODE = False ...@@ -32,7 +32,7 @@ MAINTENANCE_MODE = False
# Hosts/domain names that are valid for this site; required if DEBUG is False # Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
ALLOWED_HOSTS = ["www.example.com"] ALLOWED_HOSTS = ["localhost"]
SITE_ROOT = os.path.dirname(os.path.realpath(__file__)) SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
...@@ -41,7 +41,7 @@ SITE_ROOT = os.path.dirname(os.path.realpath(__file__)) ...@@ -41,7 +41,7 @@ SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
# in apps' "static/" subdirectories and in STATICFILES_DIRS. # in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/var/www/example.com/static/" # Example: "/var/www/example.com/static/"
# Use 'python manage.py collectstatic' to put stuff into here # Use 'python manage.py collectstatic' to put stuff into here
STATIC_ROOT = '/somewhere/VIPSWeb/static' STATIC_ROOT = SITE_ROOT + '/../static/'
# Make this unique, and don't share it with anybody. # Make this unique, and don't share it with anybody.
SECRET_KEY = '#### HIDDEN ###' SECRET_KEY = '#### HIDDEN ###'
...@@ -113,7 +113,7 @@ GOOGLE_ANALYTICS_SCRIPT = """ ...@@ -113,7 +113,7 @@ GOOGLE_ANALYTICS_SCRIPT = """
# The server name used for VIPSLogic # The server name used for VIPSLogic
VIPSLOGIC_SERVER_NAME = "vipslogic" VIPSLOGIC_SERVER_NAME = "vipslogic"
# VIPSLogic protocol # VIPSLogic protocol
VIPSLOGIC_PROTOCOL = "https" VIPSLOGIC_PROTOCOL = "http"
# This organization's ID in VIPSLogic/CoreManager # This organization's ID in VIPSLogic/CoreManager
VIPS_ORGANIZATION_ID = 1 VIPS_ORGANIZATION_ID = 1
# Use this if you want to override and show icons for stations belonging to several organizations # Use this if you want to override and show icons for stations belonging to several organizations
......
...@@ -533,9 +533,8 @@ var cachedPois; ...@@ -533,9 +533,8 @@ var cachedPois;
function cacheForecastSummaries() function cacheForecastSummaries()
{ {
//$.getJSON(settings.vipslogicProtocol + "://" + settings.vipslogicServerName + "/rest/forecastconfigurationsummaries/" + settings.vipsOrganizationId, function( json ) { //$.getJSON(settings.vipslogicProtocol + "://" + settings.vipslogicServerName + "/rest/forecastconfigurationsummaries/" + settings.vipsOrganizationId, function( json ) {
$.getJSON( "/vipslogicproxy/rest/forecastconfigurationsummaries/" + settings.vipsOrganizationId $.getJSON( "/vipslogicproxy/rest/forecastconfigurationsummaries/" + settings.vipsOrganizationId + "?foo=bar" + (settings.userUuid != null ? "&userUuid=" + settings.userUuid : "")
+ (settings.includeOrganizationIds != null ? "?includeOrganizationIds=" + settings.includeOrganizationIds.join(",") : "") + (settings.includeOrganizationIds != null ? "&includeOrganizationIds=" + settings.includeOrganizationIds.join(",") : ""), function( json ) {
, function( json ) {
cachedForecastSummaries = json; cachedForecastSummaries = json;
cachePrivateForecastSummaries(); cachePrivateForecastSummaries();
......
from django.test import TestCase
import unittest
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
options = Options()
options.headless = True
#Test suit
class SearchText(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox(options=options)
self.driver.implicitly_wait(10)
self.driver.get("http://localhost:8000")
def test_maintenance_mode(self):
assert "Site down for maintenance" in self.driver.page_source
def tearDown(self):
self.driver.quit()
if __name__ == '__main__':
unittest.main()
...@@ -231,7 +231,7 @@ class ForecastConfiguration: ...@@ -231,7 +231,7 @@ class ForecastConfiguration:
crop_organism_id_paramstring += "&cropOrganismId=%s" % crop_organism_id crop_organism_id_paramstring += "&cropOrganismId=%s" % crop_organism_id
request_result = None request_result = None
if settings.INCLUDE_ORGANIZATION_IDS == None: if settings.INCLUDE_ORGANIZATION_IDS == None or len(settings.INCLUDE_ORGANIZATION_IDS) == 1:
"""print "%s://%s/rest/organizationforecastconfigurations/%s?from=%s-01-01&to=%s-12-31%s" % ( """print "%s://%s/rest/organizationforecastconfigurations/%s?from=%s-01-01&to=%s-12-31%s" % (
settings.VIPSLOGIC_PROTOCOL, settings.VIPSLOGIC_PROTOCOL,
settings.VIPSLOGIC_SERVER_NAME, settings.VIPSLOGIC_SERVER_NAME,
......
...@@ -32,6 +32,7 @@ def index(request): ...@@ -32,6 +32,7 @@ def index(request):
season_range = range(2016, datetime.now().year + 1) season_range = range(2016, datetime.now().year + 1)
season = int(request.GET.get("season", (datetime.now() + relativedelta(months = settings.SYSTEM_TIME_OFFSET_MONTHS)).year)) season = int(request.GET.get("season", (datetime.now() + relativedelta(months = settings.SYSTEM_TIME_OFFSET_MONTHS)).year))
forecast_configurations = ForecastConfiguration.get_forecast_configurations_from_vipslogic(None, season).text forecast_configurations = ForecastConfiguration.get_forecast_configurations_from_vipslogic(None, season).text
#print forecast_configurations
private_forecast_configurations = None private_forecast_configurations = None
if request.session.get("user_uuid",None) != None: if request.session.get("user_uuid",None) != None:
private_forecast_configurations = ForecastConfiguration.get_private_forecast_configurations(request.session["user_uuid"]) private_forecast_configurations = ForecastConfiguration.get_private_forecast_configurations(request.session["user_uuid"])
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<p> <p>
Her kan du beregne tidspunkt for n&aring;r havren er i blomst og dermed n&aring;r Her kan du beregne tidspunkt for n&aring;r havren er i blomst og dermed n&aring;r
en eventuell behandling med soppmiddel mot Fusarium m&aring; utf&oslash;res. en eventuell behandling med soppmiddel mot Fusarium m&aring; utf&oslash;res.
<a href='http://gamlevips.nibio.no/information/if105s.jsp?HTTP_REFERRER=/information/if105s.jsp&BUTTON=kapittel&menyValg=4#blomstringsmodell_havre' target='new'>Les mer</a> <a href='/forecasts/models/OATFLOWERM/' target='new'>Les mer</a>
</p> </p>
<div id="oatFloweringModelForm" style="width:100%"></div> <div id="oatFloweringModelForm" style="width:100%"></div>
<div id="oatFloweringModelResults" style="width:100%;"></div> <div id="oatFloweringModelResults" style="width:100%;"></div>
......
...@@ -15,14 +15,17 @@ ...@@ -15,14 +15,17 @@
<h1>Let's say this is the EuroWheat web page</h1> <h1>Let's say this is the EuroWheat web page</h1>
<p>What you do is that you include the following code in your HTML</p> <p>What you do is that you include the following code in your HTML</p>
<code> <code>
&lt;div id="zymoGridMapContainer" style="width:800px;" data-language="dk"&gt;&lt;/div&gt;<br/> &lt;div id="nordicSeptoriaMapContainer" style="width:800px;" data-language="dk" data-mainmap-height="700px;"&gt;&lt;/div&gt;<br/>
&lt;script id="zymoGridMapScript" type="text/javascript" src="{{settings.VIPSLOGIC_PROTOCOL}}://{{settings.VIPSLOGIC_SERVER_NAME}}/public/nordic_septoria_whs/nordic_septoria_whs.js"/&gt;&lt;/script&gt; &lt;script id="nordicSeptoriaMapScript" type="text/javascript" src="{{settings.VIPSLOGIC_PROTOCOL}}://{{settings.VIPSLOGIC_SERVER_NAME}}/public/nordic_septoria_map/nordic_septoria_map.js"/&gt;&lt;/script&gt;
</code> </code>
<p>Then the application will look like this</p> <p>Then the application will look like this</p>
<div id="zymoGridMapContainer" style="width:800px;" data-language="dk"></div> <div id="nordicSeptoriaMapContainer" style="width:800px;" data-language="dk" data-mainmap-height="700px;"></div>
<script id="zymoGridMapScript" type="text/javascript" src="{{settings.VIPSLOGIC_PROTOCOL}}://{{settings.VIPSLOGIC_SERVER_NAME}}/public/nordic_septoria_whs/nordic_septoria_whs.js"/></script> <script id="nordicSeptoriaMapScript" type="text/javascript" src="{{settings.VIPSLOGIC_PROTOCOL}}://{{settings.VIPSLOGIC_SERVER_NAME}}/public/nordic_septoria_map/nordic_septoria_map.js"/></script>
<!--script id="zymoGridMapScript" type="text/javascript" src="http://restclienthtml/public/nordic_septoria_whs/nordic_septoria_whs.js"/></script--> <!--script id="zymoGridMapScript" type="text/javascript" src="http://restclienthtml/public/nordic_septoria_whs/nordic_septoria_whs.js"/></script-->
<p>If you omit the style attribute, the application will fill all available space</p> <ul>
<p>If you omit the data-language attribute, the default language (en) will be used. Currently supported languages are no, dk and en. </p> <li>If you omit the style attribute, the application will fill all available space</li>
<li>If you omit the data-language attribute, the default language (en) will be used. Currently supported languages are no, dk and en. </li>
<li>If you omit the data-mainmap-height attribute, the main map's height will be 450px.</li>
</ul>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -23,3 +23,4 @@ Pillow ...@@ -23,3 +23,4 @@ Pillow
requests==2.6.0 requests==2.6.0
django-tinymce==2.8.0 django-tinymce==2.8.0
python-dateutil==1.5 python-dateutil==1.5
selenium
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment