chg: [domains explorer] unsafe tag default image

This commit is contained in:
Terrtia 2023-06-02 10:36:27 +02:00
parent 302f65fb06
commit 550ca3abe6
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0
2 changed files with 72 additions and 63 deletions

View file

@ -1,18 +1,26 @@
{% for dict_domain in l_dict_domains %} {% for dict_domain in l_dict_domains %}
{% if loop.index0 % 4 == 0 %} {% if loop.index0 % 4 == 0 %}
<div class="card-deck mt-3"> <div class="card-deck mt-3">
{% endif %} {% endif %}
<div class="card {% if dict_domain["status"] %}border-success{% else %}border-danger{% endif %}"> <div class="card {% if dict_domain["status"] %}border-success{% else %}border-danger{% endif %}">
<div class="text-center"> <div class="text-center">
{% if dict_domain["is_tags_safe"] %}
<canvas id="canvas_{{loop.index0}}" style="max-height: 400px; max-width: 100%;"></canvas> <canvas id="canvas_{{loop.index0}}" style="max-height: 400px; max-width: 100%;"></canvas>
{% else %}
<span class="my-2 fa-stack fa-8x">
<i class="fas fa-stack-1x fa-image"></i>
<i class="fas fa-stack-2x fa-ban" style="color:Red"></i>
</span>
{% endif %}
</div> </div>
<div class="card-body pb-0"> <div class="card-body pb-0">
<h5 class="card-title"> <h5 class="card-title">
<a target="_blank" href="{{ url_for('crawler_splash.showDomain') }}?domain={{dict_domain["id"]}}"> <a target="_blank" href="{{ url_for('crawler_splash.showDomain') }}?domain={{dict_domain["id"]}}">
{% if 'hl-start' in dict_domain %} {% if 'hl-start' in dict_domain %}
{{dict_domain["id"][:dict_domain['hl-start']]}}<span class="hg-text">{{dict_domain["id"][dict_domain['hl-start']:dict_domain['hl-end']]}}</span>{{dict_domain["id"][dict_domain['hl-end']:]}} {{dict_domain["id"][:dict_domain['hl-start']]}}
<span class="hg-text">{{dict_domain["id"][dict_domain['hl-start']:dict_domain['hl-end']]}}</span>
{{dict_domain["id"][dict_domain['hl-end']:]}}
{% else %} {% else %}
{{dict_domain["id"]}} {{dict_domain["id"]}}
{% endif %} {% endif %}
@ -47,12 +55,14 @@
</div> </div>
<p class="card-text"> <p class="card-text">
<small class="text-muted"> <small class="text-muted">
<b>
{% if dict_domain['languages'] %} {% if dict_domain['languages'] %}
Languages: Languages:
{% for language in dict_domain['languages'] %} {% for language in dict_domain['languages'] %}
<span class="badge badge-secondary" style="font-size: 0.75rem;">{{ language }}</span> <span class="badge badge-secondary" style="font-size: 0.75rem;">{{ language }}</span>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
</b>
</small> </small>
</p> </p>
@ -67,6 +77,7 @@
{% with obj_type='domain', obj_id=dict_domain["id"], obj_lvl=0%} {% with obj_type='domain', obj_id=dict_domain["id"], obj_lvl=0%}
{% include 'import_export/block_add_user_object_to_export_small.html' %} {% include 'import_export/block_add_user_object_to_export_small.html' %}
{% endwith %} {% endwith %}
</div> </div>
{% if loop.index0 % 4 == 3 %} {% if loop.index0 % 4 == 3 %}

View file

@ -172,14 +172,12 @@ function img_error(canevas_id) {
blocks.addEventListener('change', pixelate_all, false); blocks.addEventListener('change', pixelate_all, false);
{% for dict_domain in l_dict_domains['list_elem'] %} {% for dict_domain in l_dict_domains['list_elem'] %}
{% if 'screenshot' in dict_domain %}
{% if dict_domain['is_tags_safe'] %} {% if dict_domain['is_tags_safe'] %}
{% if 'screenshot' in dict_domain %}
var screenshot_url = "{{ url_for('objects_item.screenshot', filename="") }}{{dict_domain['screenshot']}}"; var screenshot_url = "{{ url_for('objects_item.screenshot', filename="") }}{{dict_domain['screenshot']}}";
{% else %}
var screenshot_url = "{{ url_for('static', filename='image/AIL.png') }}";
{% endif %}
init_canevas_blurr_img("canvas_{{loop.index0}}", screenshot_url); init_canevas_blurr_img("canvas_{{loop.index0}}", screenshot_url);
{% endif %} {% endif %}
{% endif %}
{% endfor %} {% endfor %}
</script> </script>