我导入JSON供稿来构建表格。我想重命名表中的状态变量。例如,当{{r.status}}变量的输出为“ cancelled”时,我想在“ abgebrochen”中进行更改。我已经尝试了一些if语句,但无法弄清楚为什么它不起作用。
<div class="table-responsive">
<table class="table table-striped table-condensed">
<thead>
<tr>
<th>Number</th>
<th>Company</th>
<th>From</th>
<th>Arrival</th>
<th>Status</th>
<th>Gate</th>
</tr>
</thead>
<tbody>
{% for r in response %}
<tr>
<td>{{r.flight.iata_number}}</td>
<td>{{r.airline.name}}</td>
<td>{{r.departure.iata_code}}</td>
<td>{{r.arrival.scheduled_time | date("H:i") }}</td>
<td> {{r.status}}</td>
<td>{{r.arrival.gate}}</td>
</tr>
{% endfor %}
</tbody>
</div>
</table>