rvr-nextgen/views/communities/community_edit.php

34 lines
1.8 KiB
PHP

@extends(templates/layout_normal)
@section(main)
<h2>
<?php if (isset($community)): ?>
<a href="<?= Container::$routeCollection->getRoute('community')->generateLink(['communitySlug' => $community->getSlug()]) ?>"><?= $community->getName() ?></a> »
Edit
<?php else: ?>
New community
<?php endif; ?>
</h2>
<div class="box compactBox">
<?php
$formAction = isset($community) ?
Container::$routeCollection->getRoute('community.edit-action')->generateLink(['communitySlug' => $community->getSlug()]) :
Container::$routeCollection->getRoute('community.new-action')->generateLink();
?>
<form id="communityForm" action="<?= $formAction ?>" method="post" data-redirect-on-success="true">
<p class="formLabel">Name</p>
<input type="text" class="text big fullWidth" name="name" value="<?= isset($community) ? $community->getName() : '' ?>" required>
<?php if (!isset($community)): ?>
<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>
<?php endif; ?>
<p id="communityFormError" class="formError justify marginTop"></p>
<div class="right marginTop">
<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>
</div>
</form>
</div>
@endsection