File size: 2,757 Bytes
d2897cd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<div class="col-md-4">
    <div class="panel panel-default report-list">
        <div class="panel-heading">
                <h3 class="panel-title">
                    {{ graph.name|trans }}
                    <div class="pull-right">
                        <span class="fa {{ graph.iconClass|default('') }}"></span>
                    </div>
                </h3>
        </div>
        {% if graph.data|length > 0 %}
            <div class="table-responsive panel-collapse pull out">
                {# We need to dynamically create the table headers based on the result set #}
                <table class="table table-hover report-list" id="reportTable">
                    <thead>
                        <tr>
                            {% for key, value in graph.data[0]|filter((v, k) => 'id' != k) %}
                              <th class="col-report-count">{{ key|capitalize }}</th>
                            {% endfor %}
                        </tr>
                    </thead>
                    <tbody>
                        {% for rowKey, row in graph.data %}
                            {% if row['id']|default(null) is not null %}
                                <tr>
                                    {% for cellName, cell in row %}
                                        {% if graph.data[0].id is defined and 'title' == cellName and graph.link is defined %}
                                            <td>
                                                <a href="{{ path(graph.link, {'objectAction': 'view', 'objectId': row.id}) }}" data-toggle="ajax">
                                                    {{ cell }}
                                                </a>
                                            </td>
                                        {% elseif 'id' != cellName %}
                                            <td>
                                                {% if cell is numeric %}
                                                    {{ cell }}
                                                {% else %}
                                                    {{ assetMakeLinks(cell) }}
                                                {% endif %}
                                            </td>
                                        {% endif %}
                                    {% endfor %}
                                </tr>
                            {% endif %}
                        {% endfor %}
                    </tbody>
                </table>
            </div>
        {% else %}
            <div class="panel-body box-layout">
                <p class="text-muted">{{ 'mautic.report.table.noresults'|trans }}</p>
            </div>
        {% endif %}
    </div>
</div>