|
7 | 7 | </tr>
|
8 | 8 | {% endmacro %}
|
9 | 9 |
|
| 10 | +{% macro operationTable(object, name, actualOperationName) %} |
| 11 | + {% import _self as apiPlatform %} |
| 12 | + <table> |
| 13 | + <thead> |
| 14 | + <tr> |
| 15 | + <th scope="col" class="key">{{- name|capitalize }} operations</th> |
| 16 | + <th scope="col">Attributes</th> |
| 17 | + </tr> |
| 18 | + </thead> |
| 19 | + |
| 20 | + <tbody> |
| 21 | + {% for key, itemOperation in object %} |
| 22 | + {{ apiPlatform.operationLine(key, itemOperation, actualOperationName) }} |
| 23 | + {% else %} |
| 24 | + <tr> |
| 25 | + <td colspan="2" class="text-muted"> |
| 26 | + No available {{ name|lower }} operation for this resource. |
| 27 | + </td> |
| 28 | + </tr> |
| 29 | + {% endfor %} |
| 30 | + </tbody> |
| 31 | + </table> |
| 32 | +{% endmacro %} |
| 33 | + |
10 | 34 | {% macro providerTable(object, name) %}
|
11 | 35 | {% if object.responses is empty %}
|
12 | 36 | <div class="empty">
|
|
99 | 123 | <h3 class="tab-title">Resource Metadata</h3>
|
100 | 124 | <div class="tab-content">
|
101 | 125 | <h3>Short name: "{{ collector.resourceMetadata.shortName }}"</h3>
|
| 126 | + {{ apiPlatform.operationTable(collector.resourceMetadata.itemOperations, 'item', collector.requestAttributes.item_operation_name|default('')) }} |
| 127 | + {{ apiPlatform.operationTable(collector.resourceMetadata.collectionOperations, 'collection', collector.requestAttributes.collection_operation_name|default('')) }} |
102 | 128 | <table>
|
103 | 129 | <thead>
|
104 | 130 | <tr>
|
105 |
| - <th scope="col" class="key"> |
106 |
| - Item operations |
107 |
| - </th> |
108 |
| - <th scope="col"> |
109 |
| - Attributes |
110 |
| - </th> |
111 |
| - </tr> |
112 |
| - </thead> |
113 |
| - |
114 |
| - <tbody> |
115 |
| - {% for key, itemOperation in collector.resourceMetadata.itemOperations %} |
116 |
| - {{ apiPlatform.operationLine(key, itemOperation, collector.requestAttributes.item_operation_name|default('')) }} |
117 |
| - {% endfor %} |
118 |
| - </tbody> |
119 |
| - </table> |
120 |
| - |
121 |
| - <table> |
122 |
| - <thead> |
123 |
| - <tr> |
124 |
| - <th scope="col" class="key"> |
125 |
| - Collection operations |
126 |
| - </th> |
127 |
| - <th scope="col"> |
128 |
| - Attributes |
129 |
| - </th> |
130 |
| - </tr> |
131 |
| - </thead> |
132 |
| - |
133 |
| - <tbody> |
134 |
| - {% for key, collectionOperation in collector.resourceMetadata.collectionOperations %} |
135 |
| - {{ apiPlatform.operationLine(key, collectionOperation, collector.requestAttributes.collection_operation_name|default('')) }} |
136 |
| - {% else %} |
137 |
| - <tr> |
138 |
| - <td colspan="2" class="text-muted"> |
139 |
| - No available collection operation for this resource. |
140 |
| - </td> |
141 |
| - </tr> |
142 |
| - {% endfor %} |
143 |
| - </tbody> |
144 |
| - </table> |
145 |
| - |
146 |
| - <table> |
147 |
| - <thead> |
148 |
| - <tr> |
149 |
| - <th scope="col"> |
150 |
| - Filters |
151 |
| - </th> |
| 131 | + <th scope="col" class="key">Filters</th> |
| 132 | + <th scope="col"></th> |
152 | 133 | </tr>
|
153 | 134 | </thead>
|
154 | 135 | <tbody>
|
|
177 | 158 | <table>
|
178 | 159 | <thead>
|
179 | 160 | <tr>
|
180 |
| - <th scope="col" class="key"> |
181 |
| - Attributes |
182 |
| - </th> |
| 161 | + <th scope="col" class="key">Attributes</th> |
183 | 162 | <th scope="col"></th>
|
184 | 163 | </tr>
|
185 | 164 | </thead>
|
186 | 165 |
|
187 | 166 | <tbody>
|
188 | 167 | {% for key, value in collector.resourceMetadata.attributes if key != 'filters' %}
|
189 | 168 | <tr>
|
190 |
| - <th scope="row"> |
191 |
| - {{ key }} |
192 |
| - </th> |
193 |
| - <td> |
194 |
| - {{- profiler_dump(value, 2) -}} |
195 |
| - </td> |
| 169 | + <th scope="row">{{ key }}</th> |
| 170 | + <td>{{- profiler_dump(value, 2) -}}</td> |
196 | 171 | </tr>
|
197 | 172 | {% endfor %}
|
198 | 173 | </tbody>
|
|
0 commit comments