rvr-nextgen/views/communities/community_edit.php

31 lines
1.6 KiB
PHP
Raw Normal View History

2023-04-16 03:31:40 +02:00
@extends(templates/layout_normal)
@section(main)
<h2>
<?php if (isset($community)): ?>
2023-05-01 19:18:48 +02:00
<a href="<?= Container::$routeCollection->getRoute('community')->generateLink(['communityId' => $community->getId()]) ?>"><?= $community->getName() ?></a> »
Edit
<?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-02 00:02:38 +02:00
Container::$routeCollection->getRoute('community.edit-action')->generateLink(['communityId' => $community->getId()]) :
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-04-16 03:31:40 +02:00
<input type="text" class="text big fullWidth" name="name" placeholder="Name" value="<?= isset($community) ? $community->getName() : '' ?>" required>
<?php if (!isset($community)): ?>
<input type="text" class="text big fullWidth marginTop" name="main_currency_code" placeholder="Main currency" maxlength="3" required>
<input type="number" class="text big fullWidth marginTop" name="main_currency_round_digits" placeholder="Main currency round digits" min="0" max="9" required>
<?php endif; ?>
2023-04-23 19:59:48 +02:00
<p id="communityFormError" class="formError justify marginTop"></p>
2023-04-16 03:31:40 +02:00
<div class="right marginTop">
<button type="submit" name="submit"><?= isset($community) ? 'Save' : 'Create' ?></button>
</div>
</form>
</div>
@endsection