Initial import of animal_management module
This commit is contained in:
42
views/widgets/searchAnimalProfilesBlock.php
Normal file
42
views/widgets/searchAnimalProfilesBlock.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use humhub\modules\animal_management\models\Animal;
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var Animal[] $animals */
|
||||
/* @var \humhub\modules\content\components\ContentContainerActiveRecord $contentContainer */
|
||||
/* @var string $queryValue */
|
||||
?>
|
||||
|
||||
<form method="get" action="<?= Html::encode($contentContainer->createUrl('/animal_management/animals/index')) ?>" style="margin-bottom:10px;">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="q" value="<?= Html::encode($queryValue) ?>" placeholder="<?= Yii::t('AnimalManagementModule.base', 'Search by name, species, or ID') ?>">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="submit"><?= Yii::t('AnimalManagementModule.base', 'Search') ?></button>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php if (empty($animals)): ?>
|
||||
<div class="text-muted" style="margin-bottom:8px;">
|
||||
<?= Yii::t('AnimalManagementModule.base', 'No animals found yet.') ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<ul class="list-unstyled" style="margin-bottom:10px;">
|
||||
<?php foreach ($animals as $animal): ?>
|
||||
<li style="padding:6px 0;border-bottom:1px solid #f0f0f0;">
|
||||
<strong><?= Html::encode($animal->getDisplayName()) ?></strong>
|
||||
<div class="text-muted" style="font-size:12px;">
|
||||
<?= Html::encode($animal->animal_uid) ?>
|
||||
<?php if (!empty($animal->species)): ?>
|
||||
· <?= Html::encode($animal->species) ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
<a class="btn btn-primary btn-sm" href="<?= Html::encode($contentContainer->createUrl('/animal_management/animals/index')) ?>">
|
||||
<?= Yii::t('AnimalManagementModule.base', 'Open Animals') ?>
|
||||
</a>
|
||||
Reference in New Issue
Block a user