2023-04-16 03:31:40 +02:00
@ extends ( templates / layout_normal )
@ section ( main )
2023-04-23 20:46:11 +02:00
< h2 >
< ? php if ( isset ( $community )) : ?>
2023-05-07 01:50:57 +02:00
< a href = " <?= Container:: $routeCollection->getRoute ('community')->generateLink(['communitySlug' => $community->getSlug ()]) ?> " >< ? = $community -> getName () ?> </a> »
2023-05-01 19:18:48 +02:00
Edit
2023-04-23 20:46:11 +02:00
< ? php else : ?>
New community
< ? php endif ; ?>
</ h2 >
2023-05-01 19:18:48 +02:00
< div class = " box compactBox " >
2023-04-16 03:31:40 +02:00
< ? php
$formAction = isset ( $community ) ?
2023-05-07 01:50:57 +02:00
Container :: $routeCollection -> getRoute ( 'community.edit-action' ) -> generateLink ([ 'communitySlug' => $community -> getSlug ()]) :
2023-05-02 00:02:38 +02:00
Container :: $routeCollection -> getRoute ( 'community.new-action' ) -> generateLink ();
2023-04-16 03:31:40 +02:00
?>
2023-04-16 20:54:29 +02:00
< form id = " communityForm " action = " <?= $formAction ?> " method = " post " data - redirect - on - success = " true " >
2023-05-02 19:51:15 +02:00
< p class = " formLabel " > Name </ p >
< input type = " text " class = " text big fullWidth " name = " name " value = " <?= isset( $community ) ? $community->getName () : '' ?> " required >
2023-04-28 21:06:18 +02:00
< ? php if ( ! isset ( $community )) : ?>
2023-05-02 19:51:15 +02:00
< p class = " formLabel marginTop " > Main currency code </ p >
< input type = " text " class = " text big fullWidth " name = " main_currency_code " maxlength = " 3 " required >
< p class = " formLabel marginTop " > Main currency round digits </ p >
< input type = " number " class = " text big fullWidth " name = " main_currency_round_digits " min = " 0 " max = " 9 " required >
2023-04-28 21:06:18 +02:00
< ? php endif ; ?>
2023-04-23 19:59:48 +02:00
< p id = " communityFormError " class = " formError justify marginTop " ></ p >
2023-06-16 21:29:59 +02:00
< div class = " right marginTop " style = " font-size: 0; " >
2023-05-06 21:42:43 +02:00
< button type = " submit " name = " submit_button " >< ? = isset ( $community ) ? '<i class="fa-regular fa-floppy-disk"></i> Save' : '<i class="fa-regular fa-plus"></i> Create' ?> </button>
2023-06-16 21:29:59 +02:00
< ? php if ( isset ( $community )) : ?>
< button type = " submit " form = " deleteCommunity " name = " submit_button " data - confirmation = " Are you sure you want to delete this community? " class = " red marginLeft " >< i class = " fa-regular fa-trash-can " ></ i > Delete </ button >
< ? php endif ; ?>
2023-04-16 03:31:40 +02:00
</ div >
</ form >
2023-06-16 21:29:59 +02:00
< ? php if ( isset ( $community )) : ?>
< form id = " deleteCommunity " action = " <?= Container:: $routeCollection->getRoute ('community.delete-action')->generateLink(['communitySlug' => $community->getSlug ()]) ?> " method = " post " data - redirect - on - success = " <?= Container:: $routeCollection->getRoute ('home')->generateLink() ?> " ></ form >
< ? php endif ; ?>
2023-04-16 03:31:40 +02:00
</ div >
@ endsection