2023-04-25 19:27:51 +02:00
@ extends ( templates / layout_normal )
@ section ( main )
2023-05-01 19:18:48 +02:00
< h2 >
2023-05-07 01:50:57 +02:00
< a href = " <?= Container:: $routeCollection->getRoute ('community')->generateLink(['communitySlug' => $community->getSlug ()]) ?> " >< ? = $community -> getName () ?> </a> »
< a href = " <?= Container:: $routeCollection->getRoute ('community.settings')->generateLink(['communitySlug' => $community->getSlug ()]) ?> " > Settings </ a > »
2023-05-01 19:18:48 +02:00
Exchange rates for < ? = $currency -> getCode () ?>
</ h2 >
< div class = " box compactBox " >
2023-04-25 19:27:51 +02:00
< table class = " fullWidth " >
< thead >
< tr >
< ? php if ( $editPermission ) : ?>
< th style = " width: 25%; text-align: left; " > Exchange rate </ th >
< th style = " width: 50%; text-align: left; " > Valid from </ th >
< th style = " width: 25%; " ></ th >
< ? php else : ?>
< th style = " width: 35%; text-align: left; " > Exchange rate </ th >
< th style = " width: 65%; text-align: left; " > Valid from </ th >
< ? php endif ; ?>
</ tr >
</ thead >
< ? php foreach ( $currencyExchangeRates as $currencyExchangeRate ) : ?>
< tr >
< ? php if ( $editPermission ) : ?>
< td >
2023-05-07 01:50:57 +02:00
< form id = " editExchangeRate_<?= $currencyExchangeRate->getId () ?> " action = " <?= Container:: $routeCollection->getRoute ('community.currencyExchangeRates.edit-action')->generateLink(['communitySlug' => $community->getSlug (), 'code' => $currency->getCode (), 'currency_exchange_rate_id' => $currencyExchangeRate->getId ()]) ?> " method = " post " data - reload - on - success = " true " data - observe - inputs = " exchange_rate,valid_from " ></ form >
< form id = " deleteCurrency_<?= $currencyExchangeRate->getId () ?> " action = " <?= Container:: $routeCollection->getRoute ('community.currencyExchangeRates.delete-action')->generateLink(['communitySlug' => $community->getSlug (), 'code' => $currency->getCode (), 'currency_exchange_rate_id' => $currencyExchangeRate->getId ()]) ?> " method = " post " data - reload - on - success = " true " ></ form >
2023-04-25 19:27:51 +02:00
< input type = " number " form = " editExchangeRate_<?= $currencyExchangeRate->getId () ?> " class = " text fullWidth " name = " exchange_rate " value = " <?= $currencyExchangeRate->getExchangeRate () ?> " min = " 0 " step = " 0.000000001 " required >
</ td >
< td >
< input type = " datetime-local " form = " editExchangeRate_<?= $currencyExchangeRate->getId () ?> " class = " text fullWidth " name = " valid_from " value = " <?= $currencyExchangeRate->getValidFromDate ()->format('Y-m-d \T H:i') ?> " required >
</ td >
< td style = " text-align: right; " >
2023-05-06 21:42:43 +02:00
< button type = " submit " form = " editExchangeRate_<?= $currencyExchangeRate->getId () ?> " name = " submit_button " class = " small marginRight " disabled >< i class = " fa-regular fa-floppy-disk " ></ i ></ button ><!--
-->< button type = " submit " form = " deleteCurrency_<?= $currencyExchangeRate->getId () ?> " name = " submit_button " data - confirmation = " Are you sure you want to delete this exchange rate? " data - confirmation - button = '<i class="fa-regular fa-trash-can"></i> Delete' class = " small red " >< i class = " fa-regular fa-trash-can " ></ i ></ button >
2023-04-25 19:27:51 +02:00
</ td >
< ? php else : ?>
< td >< ? = $currencyExchangeRate -> getExchangeRate () ?> </td>
< td >< ? = $currencyExchangeRate -> getValidFromDate () -> format ( 'Y-m-d H:i' ) ?> </td>
< ? php endif ; ?>
</ tr >
< ? php endforeach ; ?>
< ? php if ( $editPermission ) : ?>
< tr >
< td >
2023-05-07 01:50:57 +02:00
< form id = " newExchangeRate " action = " <?= Container:: $routeCollection->getRoute ('community.currencyExchangeRates.new-action')->generateLink(['communitySlug' => $community->getSlug (), 'code' => $currency->getCode ()]) ?> " method = " post " data - reload - on - success = " true " data - observe - inputs = " exchange_rate,valid_from " ></ form >
2023-05-02 19:51:15 +02:00
< input type = " number " form = " newExchangeRate " class = " text fullWidth " name = " exchange_rate " min = " 0 " step = " 0.000000001 " required >
2023-04-25 19:27:51 +02:00
</ td >
< td >
2023-05-02 19:51:15 +02:00
< input type = " datetime-local " form = " newExchangeRate " class = " text fullWidth " name = " valid_from " required >
2023-04-25 19:27:51 +02:00
</ td >
< td style = " text-align: right; " >
2023-05-06 21:42:43 +02:00
< button type = " submit " form = " newExchangeRate " name = " submit_button " class = " small " disabled >< i class = " fa-regular fa-plus " ></ i ></ button >
2023-04-25 19:27:51 +02:00
</ td >
</ tr >
< ? php endif ; ?>
</ table >
< p class = " formError justify marginTop " ></ p >
</ div >
@ endsection