-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpanel-event.php
51 lines (46 loc) · 3.24 KB
/
panel-event.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
use MapasCulturais\Entities\Event;
use MapasCulturais\i;
$event = $app->repo('Event')->find($entity->id);
?>
<article class="objeto clearfix">
<h1><a href="<?php echo $entity->singleUrl; ?>"><?php echo $entity->name; ?></a></h1>
<div class="objeto-meta">
<?php $this->applyTemplateHook('panel-new-fields-before','begin', [ $entity ]); ?>
<?php $this->applyTemplateHook('panel-new-fields-before','end'); ?>
<?php $linguagem = isset($entity->terms->linguagem)?$entity->terms->linguagem: $entity->terms['linguagem'];?>
<div><span class="label"><?php \MapasCulturais\i::_e("Linguagens: ");?></span> <?php echo implode(', ', $linguagem)?></div>
<?php if($entity->classificacaoEtaria): ?>
<div><span class="label"><?php \MapasCulturais\i::_e("Classificação:");?></span> <?php echo $entity->classificacaoEtaria; ?></div>
<?php endif; ?>
<?php if(isset($entity->originSiteUrl) && !empty($entity->originSiteUrl)): ?>
<div><span class="label">Url: </span> <?php echo $entity->originSiteUrl;?></div>
<?php endif; ?>
</div>
<div class="entity-actions">
<?php $this->applyTemplateHook('entity-actions','begin', [ $entity ]); ?>
<a class="btn btn-small btn-primary" href="<?php echo $entity->editUrl; ?>"><?php \MapasCulturais\i::_e("editar");?></a>
<?php if(!isset($only_edit_button)): ?>
<?php if($entity->status === \MapasCulturais\Entities\Event::STATUS_ENABLED): ?>
<a class="btn btn-small btn-warning" href="<?php echo $entity->unpublishUrl; ?>"><?php \MapasCulturais\i::_e("tornar rascunho");?></a>
<?php if($event->canUser('remove')): ?>
<a class="btn btn-small btn-danger" href="<?php echo $entity->deleteUrl; ?>"><?php \MapasCulturais\i::_e("excluir");?></a>
<?php endif; ?>
<a class="btn btn-small btn-success" href="<?php echo $entity->archiveUrl; ?>"><?php \MapasCulturais\i::_e("arquivar");?></a>
<?php elseif ($entity->status === \MapasCulturais\Entities\Event::STATUS_DRAFT): ?>
<a class="btn btn-small btn-warning" href="<?php echo $entity->publishUrl; ?>"><?php \MapasCulturais\i::_e("publicar");?></a>
<a class="btn btn-small btn-danger" href="<?php echo $entity->deleteUrl; ?>"><?php \MapasCulturais\i::_e("excluir");?></a>
<?php elseif ($entity->status === \MapasCulturais\Entities\Event::STATUS_ARCHIVED): ?>
<a class="btn btn-small btn-success" href="<?php echo $entity->unarchiveUrl; ?>"><?php \MapasCulturais\i::_e("desarquivar");?></a>
<?php else: ?>
<a class="btn btn-small btn-success" href="<?php echo $entity->undeleteUrl; ?>"><?php \MapasCulturais\i::_e("recuperar");?></a>
<?php if($entity->permissionTo->destroy): ?>
<?php if($event->canUser('destroy')): ?>
<a class="btn btn-small btn-danger" href="<?php echo $entity->destroyUrl; ?>"><?php \MapasCulturais\i::_e("excluir definitivamente");?></a>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php $this->applyTemplateHook('entity-actions','end', [ $entity ]); ?>
</div>
</article>