Skip to content

Commit

Permalink
Merge branch 'mapasculturais:develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
lpirola authored May 15, 2024
2 parents 9174404 + f83815a commit c9f8af1
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 24 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ e este projeto adere ao [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- possibilidade de passar vários termos para a busca por palavra-chave, separando-os por ponto e vírgula
- melhoria de performance na criação de novas revisões, deixando o salvamento de todas as entidades mais rápidas
- log de hooks agora exibe um backtrace
- Faz com que seja possivel clicar no nome da entidade para acessar a single da mesma
- Em oportunidades multifases, redireciona o usuário para primeira fase caso ele tente acessar via url a edição de oportunidades posteriores

### Correções
- Corrige seleção de relacionamentos OneToOne
Expand Down
8 changes: 5 additions & 3 deletions src/modules/Components/components/entity-card/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
<mc-avatar :entity="entity" size="small"></mc-avatar>
</slot>
<div class="user-info" :class="{'with-labels': useLabels, 'without-labels': !useLabels}">
<slot name="title">
<mc-title tag="h2" :shortLength="55" :longLength="71" class="bold">{{entity.name}}</mc-title>
</slot>
<a :href="entity.singleUrl">
<slot name="title">
<mc-title tag="h2" :shortLength="55" :longLength="71" class="bold">{{entity.name}}</mc-title>
</slot>
</a>
<slot name="type">
<div v-if="entity.type" class="user-info__attr">
<?php i::_e('Tipo:') ?> {{entity.type.name}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
<div class="entity-card__header occurrence-card__header">
<mc-avatar :entity="event" size="medium"></mc-avatar>
<div class="user-info">
<mc-title tag="h2" class="bold">
{{event.name}}
</mc-title>
<a :href="event.singleUrl">
<mc-title tag="h2" class="bold">
{{event.name}}
</mc-title>
</a>
<div class="user-info__attr">
<span> {{event.subTitle}} </span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
<mc-avatar :entity="entity" size="medium"></mc-avatar>

<div class="evaluation-card__group">
<mc-title tag="h3" size="medium" :short-length="100" :long-length="130" class="evaluation-card__title">{{entity.parent?.name || entity.name}}</mc-title>

<mc-link route="opportunity/userEvaluations" :params="[entity.id]">
<mc-title tag="h3" size="medium" :short-length="100" :long-length="130" class="evaluation-card__title">{{entity.parent?.name || entity.name}}</mc-title>
</mc-link>
<div class="evaluation-card__infos">
<div class="evaluation-card__info">
<span v-if="entity.parent"><?= i::__('FASE') ?>: <strong> {{entity.name}} </strong></span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
<div class="col-12 grid-12 opportunity-list__card">
<div class="col-12 opportunity-list__cardheader">
<mc-avatar :entity="opp" size="xsmall"></mc-avatar>
<p class="opportunity-list__name opportunity__color bold"> {{opp.name}}</p>
<p class="opportunity-list__name opportunity__color bold">
<mc-link :entity="opp" class="opportunity-list__link primary__color bold">
{{opp.name}}
</mc-link>
</p>
</div>
<div v-if="!opp.isLastPhase && opp.registrationFrom.isFuture()" class="col-12">
<p v-if="opp.registrationTo" class="semibold opportunity-list__registration"> <?= i::__('Inscrições de') ?> <span v-if="opp.registrationFrom"> {{opp.registrationFrom.date('2-digit year')}} às {{opp.registrationFrom.hour('2-digit')}}h </span> <?= i::__('até') ?> {{opp.registrationTo.date('2-digit year')}} às {{opp.registrationTo.hour('2-digit')}}h</p>
Expand Down
6 changes: 0 additions & 6 deletions src/modules/Opportunities/views/opportunity/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@

use MapasCulturais\i;

$entity = $this->controller->requestedEntity;
if(!$entity->isFirstPhase){
$url = $app->createUrl("opportunity","edit",[$entity->firstPhase->id]);
$app->redirect($url);
}

$this->layout = 'entity';

$this->import('
Expand Down
11 changes: 10 additions & 1 deletion src/modules/OpportunityPhases/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,16 @@ function _init () {
$app = App::i();
$self = $this;
$registration_repository = $app->repo('Registration');


// Redireciona o usuario sempre para a primeira fase
$app->hook("GET(opportunity.<<single|edit>>):<<*>>", function() use ($app) {
$entity = $this->requestedEntity;
if(!$entity->isFirstPhase){
$url = $app->createUrl("opportunity",$this->action,[$entity->firstPhase->id]);
$app->redirect($url);
}
});

$app->hook('view.partial(singles/registration-edit--categories).params', function(&$params, &$template) use ($app) {
if($this->controller->requestedEntity->opportunity->isOpportunityPhase && !$this->controller->requestedEntity->preview) {
$template = '_empty';
Expand Down
10 changes: 6 additions & 4 deletions src/modules/Panel/components/panel--entity-card/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@
</slot>
<div class="panel-entity-card__header--info">
<slot name="title" :entity="entity">
<mc-title tag="h2" :shortLength="100" :longLength="110">
{{ entity.name || entity.email || entity.number || entity.id }}
</mc-title>
<a :href="entity.singleUrl" class="panel-entity-card__header--info-link">
<mc-title tag="h2" :shortLength="100" :longLength="110">
{{ entity.name || entity.email || entity.number || entity.id }}
</mc-title>
</a>
</slot>
<p class="panel-entity-card__header--info-subtitle">
<slot name="subtitle" :entity="entity"></slot>
</p>
</div>
</div>
</div>
<div class="right">
<div class="panel-entity-card__header-actions">
Expand Down
4 changes: 3 additions & 1 deletion src/modules/Panel/components/panel--last-edited/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
<slide v-for="entity in entities" :key="entity.id">
<panel--entity-card :key="entity.id" :entity="entity" class="card">
<template #title="{entity}">
<mc-title size="small" tag="h4" :shortLength="0" :longLength="1000" class="bold">{{entity.name}}</mc-title>
<a :href="entity.singleUrl" class="panel-entity-card__header--info-link">
<mc-title size="small" tag="h4" :shortLength="0" :longLength="1000" class="bold">{{entity.name}}</mc-title>
</a>
</template>
<template #header-actions="{entity}">
<div :class="[entity.__objectType+'__background', 'card-actions--tag']">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
<slide v-for="entity in entities" :key="entity.id">
<div class="card">
<div class="card__content">
<label class="card__content--title"> {{entity.opportunity.name}} </label>
<a target="__blank" :href="entity.singleUrl">
<label class="card__content--title"> {{entity.opportunity.name}} </label>
</a>
<div class="card__content--description date">
<label><?= i::_e('Data de inscrição') ?></label>
<strong>{{entity.opportunity.registrationFrom?.format()}} <?= i::_e('às') ?> {{entity.opportunity.registrationFrom?.hour()}}h</strong>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@


<template #title>
<mc-title small tag="h4" :shortLength="0" :longlength="1000" class="bold">{{entity.parent?.name || entity.name}}</mc-title>
<mc-link :entity="entity" route="userEvaluations">
<mc-title small tag="h4" :shortLength="0" :longlength="1000" class="bold">{{entity.parent?.name || entity.name}}</mc-title>
</mc-link>
<h5 class="panel--pending-evaluations__phase-name opportunity__color--dark">{{entity.phaseName}}</h5>
</template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
<panel--entity-card :entity="entity">
<template #title>
<?php $this->applyComponentHook('title', 'begin') ?>
<slot v-if="entity.profile" name="card-title" :entity="entity">{{username}}</slot>
<slot v-if="entity.profile" name="card-title" :entity="entity">
<mc-link route="panel/user-detail" :params="[entity.id]">
{{username}}
</mc-link>
</slot>
<?php $this->applyComponentHook('title', 'end') ?>
</template>
<template #header-actions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
</div>
</section>
</div>

<template #title>
<slot name="title" :entity="entity">
<mc-title tag="h2" :shortLength="100" :longLength="110">
{{ entity.name || entity.email || entity.number || entity.id }}
</mc-title>
</slot>
</template>

<template #entity-actions-left>
<mc-confirm-button
Expand Down

0 comments on commit c9f8af1

Please sign in to comment.