mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
add alert for not-in-household and actions in page
accompanyingCourse/summary * alert for people not in household for each accompanying course; * style for action in alert * form to members editor
This commit is contained in:
parent
1df759e970
commit
c40019da8f
@ -0,0 +1,10 @@
|
|||||||
|
/*
|
||||||
|
* when an alert is the first child of the page, with a banner, we do not want the alert to be merged with the banner
|
||||||
|
*/
|
||||||
|
div.container.content {
|
||||||
|
& > div {
|
||||||
|
div.alert:nth-child(2) {
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
|
||||||
|
div.alert.alert-with-actions {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
|
||||||
|
ul.record_actions {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
|
||||||
|
li:nth-child(1n+2) {
|
||||||
|
margin-top: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 1050px) {
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
ul.record_actions {
|
||||||
|
margin-top: 1rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -7,6 +7,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@import 'alert-first-child';
|
||||||
|
@import 'alert-with-actions';
|
||||||
|
|
||||||
|
|
||||||
/* [hack] /!\ Contourne le positionnement problématique du div#content_conainter suivant,
|
/* [hack] /!\ Contourne le positionnement problématique du div#content_conainter suivant,
|
||||||
* car sa position: relative le place au-dessus du bandeau et les liens sont incliquables */
|
* car sa position: relative le place au-dessus du bandeau et les liens sont incliquables */
|
||||||
div.subheader {
|
div.subheader {
|
||||||
|
@ -169,7 +169,7 @@
|
|||||||
$('.select2').select2({allowClear: true});
|
$('.select2').select2({allowClear: true});
|
||||||
chill.categoryLinkParentChildSelect();
|
chill.categoryLinkParentChildSelect();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% block js%}<!-- nothing added to js -->{% endblock %}
|
{% block js%}<!-- nothing added to js -->{% endblock %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -86,8 +86,19 @@ class AccompanyingCourseController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function indexAction(AccompanyingPeriod $accompanyingCourse): Response
|
public function indexAction(AccompanyingPeriod $accompanyingCourse): Response
|
||||||
{
|
{
|
||||||
|
// compute some warnings
|
||||||
|
// get persons without household
|
||||||
|
$withoutHousehold = [];
|
||||||
|
foreach ($accompanyingCourse->getParticipations() as
|
||||||
|
$p) {
|
||||||
|
if (FALSE === $p->getPerson()->isSharingHousehold()) {
|
||||||
|
$withoutHousehold[] = $p->getPerson();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $this->render('@ChillPerson/AccompanyingCourse/index.html.twig', [
|
return $this->render('@ChillPerson/AccompanyingCourse/index.html.twig', [
|
||||||
'accompanyingCourse' => $accompanyingCourse
|
'accompanyingCourse' => $accompanyingCourse,
|
||||||
|
'withoutHousehold' => $withoutHousehold
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,6 +162,8 @@ const store = createStore({
|
|||||||
},
|
},
|
||||||
setWarnings(state, warnings) {
|
setWarnings(state, warnings) {
|
||||||
state.warnings = warnings;
|
state.warnings = warnings;
|
||||||
|
// reset errors, which should come from servers
|
||||||
|
state.errors.splice(0, state.errors.length);
|
||||||
},
|
},
|
||||||
setErrors(state, errors) {
|
setErrors(state, errors) {
|
||||||
state.errors = errors;
|
state.errors = errors;
|
||||||
@ -176,8 +178,9 @@ const store = createStore({
|
|||||||
commit('markPosition', { person_id, position_id });
|
commit('markPosition', { person_id, position_id });
|
||||||
dispatch('computeWarnings');
|
dispatch('computeWarnings');
|
||||||
},
|
},
|
||||||
toggleHolder({ commit }, conc) {
|
toggleHolder({ commit, dispatch }, conc) {
|
||||||
commit('toggleHolder', conc);
|
commit('toggleHolder', conc);
|
||||||
|
dispatch('computeWarnings');
|
||||||
},
|
},
|
||||||
removePosition({ commit, dispatch }, conc) {
|
removePosition({ commit, dispatch }, conc) {
|
||||||
commit('removePosition', conc);
|
commit('removePosition', conc);
|
||||||
@ -195,8 +198,9 @@ const store = createStore({
|
|||||||
commit('forceLeaveWithoutHousehold');
|
commit('forceLeaveWithoutHousehold');
|
||||||
dispatch('computeWarnings');
|
dispatch('computeWarnings');
|
||||||
},
|
},
|
||||||
setStartDate({ commit }, date) {
|
setStartDate({ commit, dispatch }, date) {
|
||||||
commit('setStartDate', date);
|
commit('setStartDate', date);
|
||||||
|
dispatch('computeWarnings');
|
||||||
},
|
},
|
||||||
setComment({ commit }, payload) {
|
setComment({ commit }, payload) {
|
||||||
commit('setComment', payload);
|
commit('setComment', payload);
|
||||||
@ -240,8 +244,9 @@ const store = createStore({
|
|||||||
} else {
|
} else {
|
||||||
// we assume the answer was 422...
|
// we assume the answer was 422...
|
||||||
error = household;
|
error = household;
|
||||||
for (let e in error.violations) {
|
for (let i in error.violations) {
|
||||||
errors.push('TODO');
|
let e = error.violations[i];
|
||||||
|
errors.push(e.title);
|
||||||
}
|
}
|
||||||
|
|
||||||
commit('setErrors', errors);
|
commit('setErrors', errors);
|
||||||
|
@ -18,6 +18,45 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if withoutHousehold|length > 0 %}
|
||||||
|
<div class="alert alert-danger alert-with-actions">
|
||||||
|
<div class="message">
|
||||||
|
{{ 'Some peoples does not belong to any household currently. Add them to an household soon'|trans }}
|
||||||
|
</div>
|
||||||
|
<ul class="record_actions">
|
||||||
|
<li>
|
||||||
|
<button class="btn btn-primary" data-toggle="collapse" href="#withoutHouseholdList">
|
||||||
|
{{ 'Add to household now'|trans }}
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="withoutHouseholdList" class="collapse">
|
||||||
|
<form method="GET" action="{{ chill_path_add_return_path('chill_person_household_members_editor') }}">
|
||||||
|
|
||||||
|
<h3>{{ 'household.Select people to move'|trans }}</h3>
|
||||||
|
<ul>
|
||||||
|
{% for p in withoutHousehold %}
|
||||||
|
<li>
|
||||||
|
<input type="checkbox" name="persons[]" value="{{ p.id }}" />
|
||||||
|
{{ p|chill_entity_render_box }}
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<ul class="record_actions">
|
||||||
|
<li>
|
||||||
|
<button type="submit" class="sc-button bt-edit">
|
||||||
|
{{ 'household.Household editor'|trans }}
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<h2>{{ 'Associated peoples'|trans }}</h2>
|
<h2>{{ 'Associated peoples'|trans }}</h2>
|
||||||
<div class="flex-table">
|
<div class="flex-table">
|
||||||
{% for p in accompanyingCourse.participations %}
|
{% for p in accompanyingCourse.participations %}
|
||||||
|
@ -36,8 +36,8 @@ class MaxHolderValidator extends ConstraintValidator
|
|||||||
|
|
||||||
$this->context->buildViolation($msg)
|
$this->context->buildViolation($msg)
|
||||||
->setParameters([
|
->setParameters([
|
||||||
'start' => $start->format('d-m-Y'), // TODO fix when MessageParameter works with timezone
|
'{{ start }}' => $start->format('d-m-Y'), // TODO fix when MessageParameter works with timezone
|
||||||
'end' => $end === null ? null : $end->format('d-m-Y')
|
'{{ end }}' => $end === null ? null : $end->format('d-m-Y')
|
||||||
])
|
])
|
||||||
->addViolation();
|
->addViolation();
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,8 @@ Born the date: >-
|
|||||||
household:
|
household:
|
||||||
Household: Ménage
|
Household: Ménage
|
||||||
Household members: Membres du ménage
|
Household members: Membres du ménage
|
||||||
|
Household editor: Modifier l'appartenance
|
||||||
|
Select people to move: Choisir les usagers
|
||||||
Show future or past memberships: >-
|
Show future or past memberships: >-
|
||||||
{length, plural,
|
{length, plural,
|
||||||
one {Montrer une ancienne appartenance}
|
one {Montrer une ancienne appartenance}
|
||||||
|
@ -178,6 +178,8 @@ Edit & activate accompanying course: Modifier et valider
|
|||||||
See accompanying periods: Voir les périodes d'accompagnement
|
See accompanying periods: Voir les périodes d'accompagnement
|
||||||
See accompanying period: Voir cette période d'accompagnement
|
See accompanying period: Voir cette période d'accompagnement
|
||||||
Referrer: Référent
|
Referrer: Référent
|
||||||
|
Some peoples does not belong to any household currently. Add them to an household soon: Certaines personnes n'appartiennent à aucun ménage actuellement. Renseignez leur appartenance à un ménage dès que possible.
|
||||||
|
Add to household now: Ajouter à un ménage
|
||||||
|
|
||||||
# pickAPersonType
|
# pickAPersonType
|
||||||
Pick a person: Choisir une personne
|
Pick a person: Choisir une personne
|
||||||
|
@ -33,3 +33,8 @@ You should select an option: Une option doit être choisie.
|
|||||||
|
|
||||||
# aggregator by age
|
# aggregator by age
|
||||||
The date should not be empty: La date ne doit pas être vide
|
The date should not be empty: La date ne doit pas être vide
|
||||||
|
|
||||||
|
# household
|
||||||
|
household:
|
||||||
|
max_holder_overflowed_infinity: Il ne peut pas y avoir plus de deux titulaires simultanément. Or, avec cette modification, ce nombre sera dépassé à partir du {{ start }}.
|
||||||
|
max_holder_overflowed: Il ne peut y avoir plus de deux titulaires simultanément. Or, avec cette modification, ce nombre sera dépassé entre le {{ start }} et le {{ end }}.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user