Skip to content
Snippets Groups Projects
Commit 3a934823 authored by Bucknell, Mary S.'s avatar Bucknell, Mary S.
Browse files

Merge branch 'main' of code.usgs.gov:wma/iow/waterdataui into wdfn-618

parents 4e39c8a7 414cf627
No related branches found
No related tags found
1 merge request!31Wdfn 618 - Change data loading to be asynchronous
certifi==2021.5.30
Flask==1.1.4
Flask==2.0.1
Markdown==3.3.4
MarkupSafe==2.0.1
pendulum==2.1.2
......@@ -11,3 +11,4 @@ requests==2.26.0
requests-mock==1.9.3
six==1.16.0
SaltPyLint==2020.9.28
ua-parser==0.10.0
......@@ -9,7 +9,7 @@
{% endblock %}
{% block body %}
{% if request.user_agent.browser == 'msie' %}
{% if browser == 'IE' %}
<script src="{{ 'scripts/wdfnviz.js' | asset_url }}"></script>
{% else %}
<script async src="{{ 'network-bundle.js' | asset_url }}"></script>
......
......@@ -49,7 +49,7 @@
{% set body_id = 'monitoring-location' %}
{% block body %}
{% if request.user_agent.browser == 'msie' %}
{% if browser == 'IE' %}
<script src="{{ 'scripts/wdfnviz.js' | asset_url }}"></script>
<script type="application/javascript">
document.addEventListener('DOMContentLoaded', function() {
......@@ -143,12 +143,12 @@
{{ components.QuestionTooltip('classic', 'View all current conditions values on the classic Water Data for the Nation interface.', True) }}
</div>
<p id="site-description">{{ components.Description(stations[0].site_no, location_with_values, parm_grp_summary) }}
{% if request.user_agent.browser == 'msie' %}
{% if browser == 'IE' %}
{{ components.DescriptionInternetExplorerLinks(stations[0].site_no, location_with_values, parm_grp_summary) }}
{% endif %}
</p>
</div>
{% if request.user_agent.browser == 'msie' %}
{% if browser == 'IE' %}
<div id="static-graph-div"></div>
<div class="usa-alert usa-alert--warning">
<div class="usa-alert__body">
......@@ -160,7 +160,7 @@
</div>
</div>
{% endif %}
{% if request.user_agent.browser != 'msie' %}
{% if browser != 'IE' %}
{{ components.TimeSeriesComponent(stations[0], default_parameter_code, iv_period_of_record, gw_period_of_record) }}
{% if cameras %}
{{ components.CameraComponent(cameras) }}
......
......@@ -6,6 +6,8 @@ import datetime
import json
import smtplib
from ua_parser import user_agent_parser
from flask import abort, render_template, redirect, request, Markup, make_response, url_for
from markdown import markdown
......@@ -177,8 +179,8 @@ async def monitoring_location(site_no):
# Get the time zone for the location
time_zone = time_zone_service.get_iana_time_zone(unique_site.get('dec_lat_va', ''),
unique_site.get('dec_long_va', ''))
context = {
'browser': user_agent_parser.Parse(request.user_agent.string)['user_agent']['family'],
'status_code': site_status,
'stations': site_data,
'location_with_values': location_with_values,
......@@ -301,6 +303,7 @@ def networks(network_cd):
return render_template(
'networks.html',
browser=user_agent_parser.Parse(request.user_agent.string)['user_agent']['family'],
http_code=http_code,
network_cd=network_cd,
collection=collection,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment