Version 1
[yaffs-website] / web / modules / contrib / devel / webprofiler / templates / Collector / request.html.twig
1 {% block toolbar %}
2     {% set request_handler %}
3     <a href="{{ idelink(collector.controller.file, collector.controller.line)|raw }}">{{ abbr(collector.controller.class)|raw }}
4         ::{{ collector.controller.method }}</a>
5     {% endset %}
6
7     {% set request_status_code_color = (400 > collector.statuscode) ? ((200 == collector.statuscode) ? 'green' : 'yellow') : 'red' %}
8
9     {% set request_route = collector.route ? collector.route : 'NONE' %}
10
11     {% set icon %}
12     <a href="{{ url("webprofiler.dashboard", {profile: token}, {fragment: 'request'}) }}" title="{{ 'Request'|t }}">
13         <img width="28" height="28" alt="{{ 'Request'|t }}"
14              src="data:image/png;base64,{{ collector.icon }}">
15     <span class="sf-toolbar-status sf-toolbar-status-{{ request_status_code_color }}"
16           title="{{ collector.statustext }}">{{ collector.statuscode }}</span>
17     </a>
18     {% endset %}
19
20     {% set text %}
21     {% spaceless %}
22         <div class="sf-toolbar-info-piece">
23             <b>{{ 'Status'|t }}</b>
24             <span class="sf-toolbar-status sf-toolbar-status-{{ request_status_code_color }}">{{ collector.statuscode }}</span> {{ collector.statustext }}
25         </div>
26         <div class="sf-toolbar-info-piece">
27             <b>{{ 'Controller'|t }}</b>
28             {{ request_handler }}
29         </div>
30         <div class="sf-toolbar-info-piece">
31             <b>{{ 'Route name'|t }}</b>
32             <span>{{ request_route }}</span>
33         </div>
34     {% endspaceless %}
35     {% endset %}
36
37     <div class="sf-toolbar-block">
38         <div class="sf-toolbar-icon">{{ icon|default('') }}</div>
39         <div class="sf-toolbar-info">{{ text|default('') }}</div>
40     </div>
41 {% endblock %}
42
43 {% block panel %}
44     <script id="request" type="text/template">
45         <h2 class="panel__title">{{ 'Request'|t }}</h2>
46
47         <% if (!_.isEmpty(data.request_query)) { %>
48         <div class="panel__container">
49             <table class="table--duo">
50                 <thead>
51                 <th>{{ 'GET Parameters'|t }}</th>
52                 <th>{{ 'Value'|t }}</th>
53                 </thead>
54                 <tbody>
55                 <% _.each( data.request_query, function( item, key ){ %>
56                 <tr>
57                     <td><%- key %></td>
58                     <td><%- item %></td>
59                 </tr>
60                 <% }); %>
61                 </tbody>
62             </table>
63         </div>
64         <% } %>
65
66         <% if (!_.isEmpty(data.request_request)) { %>
67         <div class="panel__container">
68             <table class="table--duo">
69                 <thead>
70                 <th>{{ 'POST Parameters'|t }}</th>
71                 <th>{{ 'Value'|t }}</th>
72                 </thead>
73                 <tbody>
74                 <% _.each( data.request_request, function( item, key ){ %>
75                 <tr>
76                     <td><%- key %></td>
77                     <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
78                 </tr>
79                 <% }); %>
80                 </tbody>
81             </table>
82         </div>
83         <% } %>
84
85         <div class="panel__container">
86             <table class="table--duo">
87                 <thead>
88                 <th>{{ 'Attributes'|t }}</th>
89                 <th>{{ 'Value'|t }}</th>
90                 </thead>
91                 <tbody>
92                 <% _.each( data.request_attributes, function( item, key ){ %>
93                 <tr>
94                     <td><%- key %></td>
95
96                     <% if(key == '_controller') { %>
97                     <td><%= Drupal.webprofiler.helpers.classLink(data.controller) %></td>
98                     <% } else { %>
99                     <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
100                     <% } %>
101                 </tr>
102                 <% }); %>
103                 </tbody>
104             </table>
105         </div>
106
107         <% if (!_.isEmpty(data.request_cookies)) { %>
108         <div class="panel__container">
109             <table class="table--duo">
110                 <thead>
111                 <th>{{ 'Cookies'|t }}</th>
112                 <th>{{ 'Value'|t }}</th>
113                 </thead>
114                 <tbody>
115                 <% _.each( data.request_cookies, function( item, key ){ %>
116                 <tr>
117                     <td><%- key %></td>
118                     <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
119                 </tr>
120                 <% }); %>
121                 </tbody>
122             </table>
123         </div>
124         <% } %>
125
126         <div class="panel__container">
127             <table class="table--duo">
128                 <thead>
129                 <th>{{ 'Request headers'|t }}</th>
130                 <th>{{ 'Value'|t }}</th>
131                 </thead>
132                 <tbody>
133                 <% _.each( data.request_headers, function( item, key ){ %>
134                 <tr>
135                     <td><%- key %></td>
136                     <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
137                 </tr>
138                 <% }); %>
139                 </tbody>
140             </table>
141         </div>
142
143         <% if (!_.isEmpty(data.content)) { %>
144         <div class="panel__container">
145             <div class="h--word-broken"><%- data.content %></div>
146         </div>
147         <% } %>
148
149         <% if (!_.isEmpty(data.access_check)) { %>
150         <div class="panel__container">
151             <table class="table--duo">
152                 <thead>
153                 <th>{{ 'Path'|t }}</th>
154                 <th>{{ 'Access check'|t }}</th>
155                 </thead>
156                 <tbody>
157                 <% _.each(data.access_check, function(items, key){ %>
158                 <tr>
159                     <td><%- key %></td>
160                     <td>
161                         <% _.each(items, function(item){ %>
162                         <%- item.service_id %>
163                         <% }); %>
164                     </td>
165                 </tr>
166                 <% }); %>
167                 </tbody>
168             </table>
169         </div>
170         <% } %>
171
172         <div class="panel__container">
173             <table class="table--duo">
174                 <thead>
175                 <th>{{ 'Server Parameters'|t }}</th>
176                 <th>{{ 'Value'|t }}</th>
177                 </thead>
178                 <tbody>
179                 <% _.each( data.request_server, function( item, key ){ %>
180                 <tr>
181                     <td><%- key %></td>
182                     <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
183                 </tr>
184                 <% }); %>
185                 </tbody>
186             </table>
187         </div>
188
189         <div class="panel__container">
190             <table class="table--duo">
191                 <thead>
192                 <th>{{ 'Response headers'|t }}</th>
193                 <th>{{ 'Value'|t }}</th>
194                 </thead>
195                 <tbody>
196                 <% _.each( data.response_headers, function( item, key ){ %>
197                 <tr>
198                     <td><%- key %></td>
199                     <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
200                 </tr>
201                 <% }); %>
202                 </tbody>
203             </table>
204         </div>
205     </script>
206 {% endblock %}