mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Add context for household member editor form:
* add context for accompanying period, if indicated in a query parameter; * expand automatically household suggestion, if indicated in a query parameter
This commit is contained in:
@@ -5,7 +5,7 @@ const appMessages = {
|
||||
fr: {
|
||||
household_members_editor: {
|
||||
household: {
|
||||
no_household_choose_one: "Aucun ménage de destination. Choisissez un ménage.",
|
||||
no_household_choose_one: "Aucun ménage de destination. Choisissez un ménage. Les usagers concernés par la modification apparaitront ensuite.",
|
||||
new_household: "Nouveau ménage",
|
||||
create_household: "Créer un ménage",
|
||||
search_household: "Chercher un ménage",
|
||||
|
@@ -14,6 +14,8 @@ const concerned = window.household_members_editor_data.persons.map(p => {
|
||||
};
|
||||
});
|
||||
|
||||
console.log('expand suggestions', window.household_members_editor_expand_suggestions === 1);
|
||||
|
||||
const store = createStore({
|
||||
strict: debug,
|
||||
state: {
|
||||
@@ -34,7 +36,7 @@ const store = createStore({
|
||||
allowLeaveWithoutHousehold: window.household_members_editor_data.allowLeaveWithoutHousehold,
|
||||
forceLeaveWithoutHousehold: false,
|
||||
householdSuggestionByAccompanyingPeriod: [],
|
||||
showHouseholdSuggestion: false,
|
||||
showHouseholdSuggestion: window.household_members_editor_expand_suggestions === 1,
|
||||
warnings: [],
|
||||
errors: []
|
||||
},
|
||||
|
@@ -39,12 +39,15 @@
|
||||
<ul>
|
||||
{% for p in withoutHousehold %}
|
||||
<li>
|
||||
<input type="checkbox" name="persons[]" value="{{ p.id }}" />
|
||||
<input type="checkbox" name="persons[]" value="{{ p.id }}" checked />
|
||||
{{ p|chill_entity_render_box }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<input type="hidden" name="expand_suggestions" value="true" />
|
||||
<input type="hidden" name="accompanying_period_id", value="{{ accompanyingCourse.id }}" />
|
||||
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button type="submit" class="sc-button bt-edit">
|
||||
|
@@ -1,4 +1,5 @@
|
||||
{% extends '@ChillMain/layout.html.twig' %}
|
||||
{% extends accompanyingCourse != null ? '@ChillPerson/AccompanyingCourse/layout.html.twig'
|
||||
: '@ChillMain/layout.html.twig' %}
|
||||
|
||||
{% block title 'household.Edit household members'|trans %}
|
||||
|
||||
@@ -14,6 +15,7 @@
|
||||
{% block js %}
|
||||
<script type="text/javascript">
|
||||
window.household_members_editor_data = {{ data|json_encode|raw }};
|
||||
window.household_members_editor_expand_suggestions = {{ expandSuggestions }};
|
||||
</script>
|
||||
{{ encore_entry_script_tags('household_members_editor') }}
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user