2023-04-23 19:57:47 +02:00
@ extends ( templates / layout_normal )
@ section ( main )
2023-05-01 19:18:48 +02:00
< h2 >
< a href = " <?= Container:: $routeCollection->getRoute ('community')->generateLink(['communityId' => $community->getId ()]) ?> " >< ? = $community -> getName () ?> </a> »
2023-05-01 23:37:30 +02:00
< a href = " <?= Container:: $routeCollection->getRoute ('community.settings')->generateLink(['communityId' => $community->getId ()]) ?> " > Settings </ a > »
2023-05-01 19:18:48 +02:00
Edit currencies
</ h2 >
< div class = " box compactBox " >
2023-04-23 19:57:47 +02:00
< table class = " fullWidth " >
< thead >
< tr >
< th style = " width: calc(100% / 3); text-align: left; " > Currency </ th >
< th style = " width: calc(100% / 3); text-align: left; " > Round digits </ th >
< th style = " width: calc(100% / 3); " ></ th >
</ tr >
</ thead >
< ? php foreach ( $currencies as $currency ) : ?>
< tr >
< td >
2023-05-02 00:02:38 +02:00
< form id = " editCurrency_<?= $currency->getId () ?> " action = " <?= Container:: $routeCollection->getRoute ('community.currencies.edit-action')->generateLink(['communityId' => $community->getId (), 'currency_id' => $currency->getId ()]) ?> " method = " post " data - reload - on - success = " true " data - observe - inputs = " code,round_digits " ></ form >
< form id = " deleteCurrency_<?= $currency->getId () ?> " action = " <?= Container:: $routeCollection->getRoute ('community.currencies.delete-action')->generateLink(['communityId' => $community->getId (), 'currency_id' => $currency->getId ()]) ?> " method = " post " data - reload - on - success = " true " ></ form >
2023-04-23 19:57:47 +02:00
< input type = " text " form = " editCurrency_<?= $currency->getId () ?> " class = " text fullWidth " name = " code " value = " <?= $currency->getCode () ?> " maxlength = " 3 " required >
</ td >
< td >
< input type = " number " form = " editCurrency_<?= $currency->getId () ?> " class = " text fullWidth " name = " round_digits " value = " <?= $currency->getRoundDigits () ?> " min = " 0 " max = " 9 " required >
</ td >
2023-04-28 21:06:18 +02:00
< td style = " text-align: right; font-size: 0; " >
2023-05-02 01:03:39 +02:00
< button type = " submit " form = " editCurrency_<?= $currency->getId () ?> " name = " submit_button " class = " small " disabled > Save </ button >
2023-04-28 21:06:18 +02:00
< ? php if ( $currency -> getId () !== $community -> getMainCurrencyId ()) : ?>
2023-05-02 01:03:39 +02:00
< button type = " submit " form = " deleteCurrency_<?= $currency->getId () ?> " name = " submit_button " data - confirmation = " Are you sure you want to delete this currency? " class = " small red marginLeft " > Delete </ button >
2023-04-28 21:06:18 +02:00
< ? php endif ; ?>
2023-04-23 19:57:47 +02:00
</ td >
</ tr >
< ? php endforeach ; ?>
< tr >
< td >
2023-05-02 00:02:38 +02:00
< form id = " newCurrency " action = " <?= Container:: $routeCollection->getRoute ('community.currencies.new-action')->generateLink(['communityId' => $community->getId ()]) ?> " method = " post " data - reload - on - success = " true " data - observe - inputs = " code,round_digits " ></ form >
2023-04-23 19:57:47 +02:00
< input type = " text " form = " newCurrency " class = " text fullWidth " name = " code " placeholder = " Currency " maxlength = " 3 " required >
</ td >
< td >
< input type = " number " form = " newCurrency " class = " text fullWidth " name = " round_digits " placeholder = " Round digits " min = " 0 " max = " 9 " required >
</ td >
< td style = " text-align: right; " >
2023-05-02 01:03:39 +02:00
< button type = " submit " form = " newCurrency " name = " submit_button " class = " small " disabled > Add </ button >
2023-04-23 19:57:47 +02:00
</ td >
</ tr >
</ table >
2023-04-23 20:19:38 +02:00
< p class = " formError justify marginTop " ></ p >
2023-04-23 19:57:47 +02:00
</ div >
@ endsection