Verified Commit 8117d0ba authored by Elger Jonker's avatar Elger Jonker

bugfix loading report, small bugfixes

parent 53246d30
Pipeline #39723769 passed with stages
in 20 minutes and 17 seconds
......@@ -585,7 +585,7 @@ const report_mixin = {
self.urls = data.calculation["organization"]["urls"];
self.points = data.rating;
self.high = data.calculation["organization"]["high"];
self.medium = data.calculation["orgaselected_categorynization"]["medium"];
self.medium = data.calculation["organization"]["medium"];
self.low = data.calculation["organization"]["low"];
self.when = data.when;
self.name = data.name;
......
......@@ -307,7 +307,7 @@
target="_blank"> <i class="fas fa-rss"></i> {% trans "rss feed" %}</a>.</li>
<li>
{% trans "Report ask domains leader" %} <a
:href="'mailto:' + mailto + '?subject={% trans "Report ask domains subject" %}' + name + '&body={% trans "Report ask domains body" %}'">{% trans "Report ask sendin domains" %}</a><br/>
:href="'mailto:{{ config.PROJECT_ISSUE_MAIL }}?subject={% trans "Report ask domains subject" %}' + name + '&body={% trans "Report ask domains body" %}'">{% trans "Report ask sendin domains" %}</a><br/>
</li>
</ul>
<br style="clear: both">
......@@ -391,7 +391,7 @@
<div class="col-md-8">
<span v-html="total_awarded_points(url.high, url.medium, url.low)"> </span>
<span class="faildomain" :class="colorize(url.high, url.medium, url.low)" :data-tooltip-content="idizetag(url.url)">{{ url.url }}</span><br/>
<a :href="'mailto:' + mailto + '?subject={% endverbatim %}{% trans "Incorrect finding on mail subject" %}{% verbatim %}' + url.url + '&body={% endverbatim %}{% trans "Incorrect finding on mail body" %}{% verbatim %}'" class="btn btn-secondary btn-sm" style="margin-top: 11px;" role="button">
<a :href="'mailto:{% endverbatim %}{{ config.PROJECT_ISSUE_MAIL }}{% verbatim %}?subject={% endverbatim %}{% trans "Incorrect finding on mail subject" %}{% verbatim %}' + url.url + '&body={% endverbatim %}{% trans "Incorrect finding on mail body" %}{% verbatim %}'" class="btn btn-secondary btn-sm" style="margin-top: 11px;" role="button">
{% endverbatim %}{% trans "Report incorrect finding" %}</a>
</div>
</div>
......@@ -1256,30 +1256,30 @@
<table style="width:100%" class="table table-striped">
<thead>
<tr>
<th colspan="2"><h3><i class="fas fa-chart-pie"></i> {% verbatim %}{{ translate("category_menu_" + category) }}{% endverbatim %}</h3></th>
<th colspan="2"><h3><i class="fas fa-chart-pie"></i> {% verbatim %}{{ translate("category_menu_" + layer) }}{% endverbatim %}</h3></th>
</tr>
</thead>
<tbody>
<tr>
<th><i class="fas fa-list-ul"></i> {% trans "Only urls" %}</th>
<td>⬇️ <a :href="create_link(category, 'urls_only')">{% trans "Download" %}</a></td>
<td>⬇️ <a :href="create_link(layer, 'urls_only')">{% trans "Download" %}</a></td>
</tr><tr>
<th><i class="fas fa-city"></i> {% trans "Organization types" %}*</th>
<td>⬇️ <a :href="create_link(category, 'organization_types')">{% trans "Download" %}</a></td>
<td>⬇️ <a :href="create_link(layer, 'organization_types')">{% trans "Download" %}</a></td>
</tr><tr>
<th><i class="fas fa-building"></i> {% trans "Organizations" %}*</th>
<td>⬇️ <a :href="create_link(category, 'organizations')">{% trans "Download" %}</a></td>
<td>⬇️ <a :href="create_link(layer, 'organizations')">{% trans "Download" %}</a></td>
</tr><tr>
<th><i class="fas fa-map-marker-alt"></i> {% trans "Map Data" %}*</th>
<td>⬇️ <a :href="create_link(category, 'coordinates')">{% trans "Download" %}</a></td>
<td>⬇️ <a :href="create_link(layer, 'coordinates')">{% trans "Download" %}</a></td>
</tr><tr>
<th><i class="far fa-compass"></i> {% trans "Urls" %}*</th>
<td>⬇️ <a :href="create_link(category, 'urls')">{% trans "Download" %}</a></td>
<td>⬇️ <a :href="create_link(layer, 'urls')">{% trans "Download" %}</a></td>
</tr>
{% if config.SHOW_COMPLY_OR_EXPLAIN %}
<tr>
<th><i class="fas fa-comments"></i> {% trans "Explanations" %}</th>
<td>⬇️ <a :href="create_link(category, 'explains')">{% trans "Download" %}️</a></td>
<td>⬇️ <a :href="create_link(layer, 'explains')">{% trans "Download" %}️</a></td>
</tr>
{% endif %}
</tbody>
......@@ -1465,7 +1465,7 @@
target="_blank"> <i class="fas fa-rss"></i> {% trans "rss feed" %}</a>.</li>
<li>
{% trans "Report ask domains leader" %} <a
:href="'mailto:' + mailto + '?subject={% trans "Report ask domains subject" %}' + name + '&body={% trans "Report ask domains body" %}'">{% trans "Report ask sendin domains" %}</a><br/>
:href="'mailto:{{ config.PROJECT_ISSUE_MAIL }}?subject={% trans "Report ask domains subject" %}' + name + '&body={% trans "Report ask domains body" %}'">{% trans "Report ask sendin domains" %}</a><br/>
</li>
</ul>
<br/>
......@@ -1480,7 +1480,7 @@
<div class="col-md-8">
<span v-html="total_awarded_points(url.high, url.medium, url.low)"> </span>
<span class="faildomain" :class="colorize(url.high, url.medium, url.low)" :data-tooltip-content="idizetag(url.url)">{{ url.url }}</span><br/>
<a :href="'mailto:' + mailto + '?subject={% endverbatim %}{% trans "Incorrect finding on mail subject" %}{% verbatim %}' + url.url + '&body={% endverbatim %}{% trans "Incorrect finding on mail body" %}{% verbatim %}'" class="btn btn-secondary btn-sm" style="margin-top: 11px;" role="button">
<a :href="'mailto:{% endverbatim %}{{ config.PROJECT_ISSUE_MAIL }}{% verbatim %}?subject={% endverbatim %}{% trans "Incorrect finding on mail subject" %}{% verbatim %}' + url.url + '&body={% endverbatim %}{% trans "Incorrect finding on mail body" %}{% verbatim %}'" class="btn btn-secondary btn-sm" style="margin-top: 11px;" role="button">
{% endverbatim %}{% trans "Report incorrect finding" %}</a>
</div>
</div>
......
......@@ -92,7 +92,7 @@ def get_defaults(request, ):
).order_by('display_order').values('country', 'organization_type__name').first()
if not data:
return JsonResponse({'country': "NL", 'category': "municipality"}, safe=False, encoder=JSEncoder)
return JsonResponse({'country': "NL", 'layer': "municipality"}, safe=False, encoder=JSEncoder)
return JsonResponse({'country': data['country'], 'layer': data['organization_type__name']},
safe=False, encoder=JSEncoder)
......@@ -154,12 +154,12 @@ def get_countries(request,):
def get_layers(request, country: str = "NL"):
categories = Configuration.objects.all().filter(
layers = Configuration.objects.all().filter(
country=get_country(country),
is_displayed=True
).order_by('display_order').values_list('organization_type__name', flat=True)
return JsonResponse(list(categories), safe=False, encoder=JSEncoder)
return JsonResponse(list(layers), safe=False, encoder=JSEncoder)
def generic_export(query, set, country: str = "NL", organization_type="municipality", file_format: str = "json"):
......@@ -753,7 +753,7 @@ def stats(request, country: str = "NL", organization_type="municipality", weeks_
'included_organizations': 0, 'endpoints': 0,
"endpoint": collections.OrderedDict(), "explained": {}}
# todo: filter out dead organizations and make sure it's the correct category.
# todo: filter out dead organizations and make sure it's the correct layer.
sql = """SELECT * FROM
map_organizationrating
INNER JOIN
......@@ -935,7 +935,7 @@ def organization_vulnerability_timeline(request, organization_id: int, organizat
def organization_vulnerability_timeline_via_name(request, organization_name: str,
organization_type: str = "", country: str = ""):
log.debug("Country: %s Category: %s Name: %s" % (country, organization_type, organization_name))
log.debug("Country: %s Layer: %s Name: %s" % (country, organization_type, organization_name))
if not organization_type or not country:
# getting defaults
......@@ -945,14 +945,14 @@ def organization_vulnerability_timeline_via_name(request, organization_name: str
).order_by('display_order').values('country', 'organization_type').first()
country = data['country']
category = data['organization_type']
layer = data['organization_type']
else:
country = get_country(code=country)
category = get_organization_type(name=organization_type)
layer = get_organization_type(name=organization_type)
log.debug("Country: %s Category: %s Name: %s" % (country, category, organization_name))
log.debug("Country: %s Layer: %s Name: %s" % (country, layer, organization_name))
organization = Organization.objects.all().filter(country=country, type=category,
organization = Organization.objects.all().filter(country=country, type=layer,
name=organization_name,
is_dead=False).first()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment