aboutsummaryrefslogtreecommitdiffstats
path: root/templates/results2.html
blob: 10fe829110b6af14f3c36f74022703b15ff8c30c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{% if show_form == True %}
    {% include 'search_form.html' %}
{% else %}
    {% include 'header.html' %}
{% endif %}  

    <p><b>Počet nalezených subjektů: {{ results|length }}</b></p>
    {% for row in results %}
    
        {% set insolvency_notes = [] %}
        {% for i in range (row.insolvence|length) %}
            {% if row.insolvence[i].vymaz_datum == 0 %}
                {% set insolvency_notes = insolvency_notes.append(row.insolvence[i].insolvency_event) %}
            {% endif %}    
        {% endfor %}
        {% for i in range (row.konkurz|length) %}
            {% if row.konkurz[i].vymaz_datum == 0 %}
                {% set insolvency_notes = insolvency_notes.append(row.konkurz[i].konkurz_event) %}
            {% endif %}    
        {% endfor %}

        {% set criminal_notes = [] %}
        {% for i in range (row.criminal_record|length) %}
            {% set criminal_notes = criminal_notes.append(row.criminal_record[i].penalties) %}
        {% endfor %}

        {% if insolvency_notes|length > 0 or criminal_notes|length > 0 %}
            {% set table_style = "table table-danger" %}
        {% elif loop.index % 2 == 0 %}
            {% set table_style = "table table-light" %}
        {% else %}
            {% set table_style = "table table-secondary" %}
        {% endif %}
        
        {% if row.ico|length != 8 %}            
            {% set ico_buffer = [] %}
            {% for i in range (8 - row.ico|length) %}
                {% set ico_buffer = ico_buffer.append("0") %}
            {% endfor %}
            
        {% else %}
            {% set ico_buffer = "" %}
        {% endif %}
        
        {% set current_seat = [] %}
        {% for i in range (row.sidlo_text|length) %}
            {% if row.sidlo_text[i].vymaz_datum == 0 %}
                {% set current_seat = current_seat.append(row.sidlo_text[i]) %}
            {% endif %}    
        {% endfor %}        

    <table class= "{{table_style}}" style="width: 100%">
    <p></p>
    <tr>
        <td style="width:15%">Název subjektu:</td>
        <td style="width:50%"><b>{{ row.nazev }}</b></td>
        <td style="width:10%">IČO:</td>
        <td style="width:25%"><b>{{ ico_buffer|join("") }}{{ row.ico }}</b></td>
    </tr>
    <tr>
        <td>Spisová značka:</td>
        <!-- <td>{{ oddil|join("") }} {{ vlozka|join("") }} vedená u {{ soud|join("") }}</td> -->
        <td>{{row.oddil}} {{row.vlozka}} vedená u {{row.soud}}</td>
        <td>Den zápisu:</td>
        <td>{{row.zapis}}</td>
    </tr>
    <tr>
        <td>Sídlo:</td>
        <td>{% if current_seat|length != 0 %}{{ current_seat[0].sidlo_text }}{% else %}znepřístupněno podle § 25 odst. 2 zákona č. 304/2013 Sb.{% endif %}</td>
        <td><a href="/{{ row.ico }}">Úplný výpis</a></td>
        <td><a href="/{{ row.ico }}-actual">Aktuální výpis</a></td>
    </tr>
    
    {% if insolvency_notes|length > 0 %}
        {% for i in range (insolvency_notes|length) %}
        <tr>
            <td colspan="4">{{ insolvency_notes[i] }}</td>
        </tr>            
        {% endfor %}
    {% endif %}

    {% if criminal_notes|length > 0 %}
        {% for i in range (criminal_notes|length) %}
        <tr>
            <td colspan="4">Osoba byla odsouzena k následujícím trestům: {{ criminal_notes[i] }}</td>
        </tr>            
        {% endfor %}
    {% endif %}

    </table>
    {% endfor %}
    
{% include 'footer.html' %}