Skip to content

Commit

Permalink
updated views
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Dec 6, 2017
1 parent 080f3a2 commit dfcd919
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 40 deletions.
4 changes: 3 additions & 1 deletion Controller/PaymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ public function indexAction(Request $request)
$paymentRepository = $this->container->get('loevgaard_dandomain_altapay.payment_repository');

/** @var Payment[] $payments */
$payments = $paymentRepository->findAllWithPaging($request->query->getInt('page', 1));
$payments = $paymentRepository->findAllWithPaging($request->query->getInt('page', 1), 100, [
'e.id' => 'desc'
]);

return $this->render('@LoevgaardDandomainAltapay/payment/index.html.twig', [
'payments' => $payments,
Expand Down
2 changes: 2 additions & 0 deletions Resources/translations/LoevgaardDandomainAltapayBundle.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,14 @@ payment:
name: Name
vat: VAT
price: Price
price_incl_vat: Price incl. VAT
developer_info:
heading: Developer information

label:
id: Id
order_id: Order id
payment_method: Payment method
customer_name: Customer
customer_email: Customer email
customer_phone: Customer phone
Expand Down
9 changes: 3 additions & 6 deletions Resources/views/payment/index_content.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
<table class="table table-hover table-striped">
<thead>
<tr>
<th>{{ 'payment.label.id'|trans }}</th>
<th>{{ 'payment.label.order_id'|trans }}</th>
<th>{{ 'payment.label.payment_method'|trans }}</th>
<th>{{ 'payment.label.customer_name'|trans }}</th>
<th>{{ 'payment.label.customer_email'|trans }}</th>
<th>{{ 'payment.label.customer_phone'|trans }}</th>
<th>{{ 'payment.label.total'|trans }}</th>
<th>{{ 'payment.label.refunded_amount'|trans }}</th>
<th>{{ 'layout.actions'|trans }}</th>
Expand All @@ -19,11 +17,9 @@
<tbody>
{% for payment in payments %}
<tr>
<td>{{ payment.id }}</td>
<td>{{ payment.orderId }}</td>
<td>{{ payment.paymentMethod }}</td>
<td>{{ payment.customerName }}</td>
<td><a href="mailto:{{ payment.customerEmail }}">{{ payment.customerEmail }}</a></td>
<td>{{ payment.customerPhone }}</td>
<td>{{ payment.totalAmount|money_localized_format }}</td>
<td>{{ payment.refundedAmount|money_localized_format }}</td>
<td nowrap>
Expand All @@ -42,6 +38,7 @@
{% endfor %}
</tbody>
</table>
{{ knp_pagination_render(payments) }}
{% else %}
<div class="alert alert-info">{{ 'payment.index.empty_collection'|trans }}</div>
{% endif %}
Expand Down
48 changes: 22 additions & 26 deletions Resources/views/payment/show_content.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ set delivery_fields = [
<td>{{ 'payment.show.data.refundable_amount'|trans }}</td>
<td>{{ payment.refundableAmount|money_localized_format }}</td>
</tr>
<tr>
<td>{{ 'payment.show.data.reserved_amount'|trans }}</td>
<td>{{ payment.reservedAmount|money_localized_format }}</td>
</tr>
<tr>
<td>{{ 'payment.show.data.captured_amount'|trans }}</td>
<td>{{ payment.capturedAmount|money_localized_format }}</td>
Expand Down Expand Up @@ -120,23 +116,25 @@ set delivery_fields = [
</table>
</div>
<div class="col-md-6">
<h2>{{ 'payment.show.delivery_info.heading'|trans }}</h2>
<table class="table table-hover table-bordered">
{% for item in delivery_fields %}
{% if attribute(payment, item.getter) is not empty %}
<tr>
<td>{{ item.label }}</td>
<td>
{% if attribute(item, 'type') is defined and attribute(item, 'type') == 'email' %}
<a href="mailto:{{ attribute(payment, item.getter) }}">{{ attribute(payment, item.getter) }}</a>
{% else %}
{{ attribute(payment, item.getter) }}
{% endif %}
</td>
</tr>
{% endif %}
{% endfor %}
</table>
{% if payment.deliveryName %}
<h2>{{ 'payment.show.delivery_info.heading'|trans }}</h2>
<table class="table table-hover table-bordered">
{% for item in delivery_fields %}
{% if attribute(payment, item.getter) is not empty %}
<tr>
<td>{{ item.label }}</td>
<td>
{% if attribute(item, 'type') is defined and attribute(item, 'type') == 'email' %}
<a href="mailto:{{ attribute(payment, item.getter) }}">{{ attribute(payment, item.getter) }}</a>
{% else %}
{{ attribute(payment, item.getter) }}
{% endif %}
</td>
</tr>
{% endif %}
{% endfor %}
</table>
{% endif %}
</div>
</div>
<div class="row">
Expand All @@ -153,10 +151,6 @@ set delivery_fields = [
<td>{{ payment.paymentFee|money_localized_format }}</td>
</tr>
{% endif %}
<tr>
<td>{{ ('payment.show.payment_info.payment_nature')|trans }}</td>
<td>{{ payment.paymentNature }}</td>
</tr>
</table>
</div>
<div class="col-md-6">
Expand Down Expand Up @@ -185,6 +179,7 @@ set delivery_fields = [
<th>{{ 'payment.show.payment_lines.name'|trans }}</th>
<th>{{ 'payment.show.payment_lines.vat'|trans }}</th>
<th>{{ 'payment.show.payment_lines.price'|trans }}</th>
<th>{{ 'payment.show.payment_lines.price_incl_vat'|trans }}</th>
</tr>
</thead>
<tbody>
Expand All @@ -193,8 +188,9 @@ set delivery_fields = [
<td>{{ paymentLine.quantity }}</td>
<td>{{ paymentLine.productNumber }}</td>
<td>{{ paymentLine.name }}</td>
<td>{{ paymentLine.vat }}</td>
<td>{{ paymentLine.vatAmount|money_localized_format }}</td>
<td>{{ paymentLine.price|money_localized_format }}</td>
<td>{{ paymentLine.priceInclVat|money_localized_format }}</td>
</tr>
{% endfor %}
</tbody>
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,32 @@
"doctrine/doctrine-bundle": "^1.6",
"doctrine/orm": "^2.5",
"friendsofsymfony/rest-bundle": "^2.0",
"guzzlehttp/guzzle": "~6.0",
"guzzlehttp/guzzle": "^6.0",
"jms/serializer-bundle": "^2.2",
"knplabs/doctrine-behaviors": "~1.1",
"knplabs/doctrine-behaviors": "^1.1",
"knplabs/knp-paginator-bundle": "^2.6",
"loevgaard/altapay-php-sdk": "^3.0",
"loevgaard/dandomain-pay-php-sdk": "^3.4",
"loevgaard/dandomain-pay-php-sdk": "^3.4.1",
"sensio/framework-extra-bundle": "^3.0",
"symfony/console": "^3.2",
"symfony/form": "^3.0",
"symfony/framework-bundle": "^3.0",
"symfony/intl": "^3.0",
"symfony/lock": "^3.4",
"symfony/monolog-bundle": "^3.0",
"symfony/psr-http-message-bridge": "~1.0",
"symfony/psr-http-message-bridge": "^1.0",
"symfony/translation": "^3.0",
"symfony/twig-bundle": "^3.0",
"symfony/validator": "^3.0",
"symfony/yaml": "^3.0",
"tbbc/money-bundle": "^3.1",
"twig/extensions": "^1.5",
"zendframework/zend-diactoros": "~1.0"
"zendframework/zend-diactoros": "^1.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.0",
"phpunit/phpunit": "~5.5||~6.0",
"psr/http-message": "~1.0",
"phpunit/phpunit": "^5.5||^6.0",
"psr/http-message": "^1.0",
"symfony/phpunit-bridge": "^3.0"
},
"autoload": {
Expand Down

0 comments on commit dfcd919

Please sign in to comment.