Skip to content

Commit

Permalink
Change Twig if statement to correct syntax in payment/pp_express_tran…
Browse files Browse the repository at this point in the history
…saction.twig

Close: #5906
  • Loading branch information
jamesallsup committed Aug 27, 2017
1 parent 347b7d7 commit e452fe0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</tr>
</thead>
<tbody>

{% if transactions %}
{% for transaction in transactions %}
<tr>
Expand All @@ -22,7 +22,7 @@
<td class="text-left">{{ transaction.pending_reason }}</td>
<td class="text-left">{{ transaction.date_added }}</td>
<td class="text-left"> {% if transaction.transaction_id %} <a href="{{ transaction.view }}" data-toggle="tooltip" title="{{ button_view }}" class="btn btn-info"><i class="fa fa-eye"></i></a>
{% if transaction.payment_type == 'instant' and (transaction.payment_status is 'Completed' or transaction.payment_status is 'Partially-Refunded') %}
{% if transaction.payment_type == 'instant' and (transaction.payment_status == 'Completed' or transaction.payment_status == 'Partially-Refunded') %}
<a href="{{ transaction.refund }}" data-toggle="tooltip" title="{{ button_refund }}" class="btn btn-danger"><i class="fa fa-reply"></i></a>&nbsp;
{% else %}
<button type="button" value="{{ transaction.resend }}" data-toggle="tooltip" title="{{ button_resend }}" class="btn btn-info"><i class="fa fa-refresh"></i></button>
Expand All @@ -35,5 +35,5 @@
</tr>
{% endif %}
</tbody>

</table>

3 comments on commit e452fe0

@fluffywiggle
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need another {% endif %} on line 29 to fix this completely

@venta7
Copy link

@venta7 venta7 commented on e452fe0 Nov 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made the corrections to the original file and still getting this Fatal error.
@fluffywiggle Please, could you explain where and why should I add another {% endif %} ?
In the current file there are 2 if statements and 2 closing {% endif %} - on line 29 and line 36.
Here is my file:

<table class="table table-striped table-bordered">
  <thead>
    <tr>
      <td class="text-left">{{ column_transaction }}</td>
      <td class="text-left">{{ column_amount }}</td>
      <td class="text-left">{{ column_type }}</td>
      <td class="text-left">{{ column_status }}</td>
      <td class="text-left">{{ column_pending_reason }}</td>
      <td class="text-left">{{ column_date_added }}</td>
      <td class="text-left">{{ column_action }}</td>
    </tr>
  </thead>
  <tbody>

  {% if transactions %}
  {% for transaction in transactions %}
  <tr>
    <td class="text-left">{{ transaction.transaction_id }}</td>
    <td class="text-left">{{ transaction.amount }}</td>
    <td class="text-left">{{ transaction.payment_type }}</td>
    <td class="text-left">{{ transaction.payment_status }}</td>
    <td class="text-left">{{ transaction.pending_reason }}</td>
    <td class="text-left">{{ transaction.date_added }}</td>
    <td class="text-left"> {% if transaction.transaction_id %} <a href="{{ transaction.view }}" data-toggle="tooltip" title="{{ button_view }}" class="btn btn-info"><i class="fa fa-eye"></i></a>
      {% if transaction.payment_type == 'instant' and (transaction.payment_status == 'Completed' or transaction.payment_status == 'Partially-Refunded') %}
      <a href="{{ transaction.refund }}" data-toggle="tooltip" title="{{ button_refund }}" class="btn btn-danger"><i class="fa fa-reply"></i></a>&nbsp;
      {% else %}
      <button type="button" value="{{ transaction.resend }}" data-toggle="tooltip" title="{{ button_resend }}" class="btn btn-info"><i class="fa fa-refresh"></i></button>
      {% endif %} </td>
  </tr>
  {% endfor %}
  {% else %}
  <tr>
    <td class="text-center" colspan="7">{{ text_no_results }}</td>
  </tr>
  {% endif %}
  </tbody>

</table>

@danijelGombac
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@venta7



<table class="table table-striped table-bordered">
  <thead>
    <tr>
      <td class="text-left">{{ column_transaction }}</td>
      <td class="text-left">{{ column_amount }}</td>
      <td class="text-left">{{ column_type }}</td>
      <td class="text-left">{{ column_status }}</td>
      <td class="text-left">{{ column_pending_reason }}</td>
      <td class="text-left">{{ column_date_added }}</td>
      <td class="text-left">{{ column_action }}</td>
    </tr>
  </thead>
  <tbody>
  {% if transactions %}
  {% for transaction in transactions %}
  <tr>
    <td class="text-left">{{ transaction.transaction_id }}</td>
    <td class="text-left">{{ transaction.amount }}</td>
    <td class="text-left">{{ transaction.payment_type }}</td>
    <td class="text-left">{{ transaction.payment_status }}</td>
    <td class="text-left">{{ transaction.pending_reason }}</td>
    <td class="text-left">{{ transaction.date_added }}</td>
    <td class="text-left">{% if transaction.transaction_id %}
      <a href="{{ transaction.view }}" data-toggle="tooltip" title="{{ button_view }}" class="btn btn-info"><i class="fa fa-eye"></i></a>
      {% if transaction.payment_type == 'instant' and (transaction.payment_status == 'Completed' or transaction.payment_status == 'Partially-Refunded') %}
      <a href="{{ transaction.refund }}" data-toggle="tooltip" title="{{ button_refund }}" class="btn btn-danger"><i class="fa fa-reply"></i></a>&nbsp;
      {% else %}
      <button type="button" value="{{ transaction.resend }}" data-toggle="tooltip" title="{{ button_resend }}" class="btn btn-info"><i class="fa fa-refresh"></i></button>
      {% endif %}
      {% endif %}</td>
  </tr>
  {% endfor %}
  {% else %}
  <tr>
    <td class="text-center" colspan="7">{{ text_no_results }}</td>
  </tr>
  {% endif %}
  </tbody>
</table>

Please sign in to comment.