mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
activity: avoid existing entities being added in Users, ThirdParties, Persons
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<concerned-groups></concerned-groups>
|
||||
<social-issues-acc></social-issues-acc>
|
||||
<location></location>
|
||||
<concerned-groups v-if="hasPerson"></concerned-groups>
|
||||
<social-issues-acc v-if="hasSocialIssues"></social-issues-acc>
|
||||
<location v-if="hasLocation"></location>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -11,6 +11,7 @@ import Location from './components/Location.vue';
|
||||
|
||||
export default {
|
||||
name: "App",
|
||||
props: ['hasSocialIssues', 'hasLocation', 'hasPerson'],
|
||||
components: {
|
||||
ConcernedGroups,
|
||||
SocialIssuesAcc,
|
||||
|
@@ -7,8 +7,19 @@ import App from './App.vue';
|
||||
|
||||
const i18n = _createI18n(activityMessages);
|
||||
|
||||
const hasSocialIssues = document.querySelector('#social-issues-acc') !== null;
|
||||
const hasLocation = document.querySelector('#location') !== null;
|
||||
const hasPerson = document.querySelector('#add-persons') !== null;
|
||||
|
||||
const app = createApp({
|
||||
template: `<app></app>`,
|
||||
template: `<app :hasSocialIssues="hasSocialIssues", :hasLocation="hasLocation", :hasPerson="hasPerson"></app>`,
|
||||
data() {
|
||||
return {
|
||||
hasSocialIssues,
|
||||
hasLocation,
|
||||
hasPerson,
|
||||
};
|
||||
}
|
||||
})
|
||||
.use(store)
|
||||
.use(i18n)
|
||||
|
@@ -28,7 +28,9 @@
|
||||
{{ form_row(edit_form.socialActions) }}
|
||||
{% endif %}
|
||||
|
||||
{%- if edit_form.socialIssues is defined or edit_form.socialIssues is defined -%}
|
||||
<div id="social-issues-acc"></div>
|
||||
{% endif %}
|
||||
|
||||
{%- if edit_form.reasons is defined -%}
|
||||
{{ form_row(edit_form.reasons) }}
|
||||
@@ -46,9 +48,10 @@
|
||||
{%- if edit_form.users is defined -%}
|
||||
{{ form_widget(edit_form.users) }}
|
||||
{% endif %}
|
||||
|
||||
<div id="add-persons"></div>
|
||||
{% endif %}
|
||||
|
||||
<div id="add-persons"></div>
|
||||
|
||||
<h2 class="chill-red">{{ 'Activity data'|trans }}</h2>
|
||||
|
||||
|
@@ -29,25 +29,29 @@
|
||||
{{ form_row(form.socialActions) }}
|
||||
{% endif %}
|
||||
|
||||
<div id="social-issues-acc"></div>
|
||||
{%- if edit_form.socialIssues is defined or edit_form.socialIssues is defined -%}
|
||||
<div id="social-issues-acc"></div>
|
||||
{% endif %}
|
||||
|
||||
{%- if form.reasons is defined -%}
|
||||
{{ form_row(form.reasons) }}
|
||||
{% endif %}
|
||||
|
||||
<h2 class="chill-red">{{ 'Concerned groups'|trans }}</h2>
|
||||
{%- if edit_form.persons is defined or edit_form.thirdParties is defined or edit_form.users is defined -%}
|
||||
<h2 class="chill-red">{{ 'Concerned groups'|trans }}</h2>
|
||||
|
||||
{%- if form.persons is defined -%}
|
||||
{{ form_widget(form.persons) }}
|
||||
{%- if form.persons is defined -%}
|
||||
{{ form_widget(form.persons) }}
|
||||
{% endif %}
|
||||
{%- if form.thirdParties is defined -%}
|
||||
{{ form_widget(form.thirdParties) }}
|
||||
{% endif %}
|
||||
{%- if form.users is defined -%}
|
||||
{{ form_widget(form.users) }}
|
||||
{% endif %}
|
||||
<div id="add-persons"></div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{%- if form.thirdParties is defined -%}
|
||||
{{ form_widget(form.thirdParties) }}
|
||||
{% endif %}
|
||||
{%- if form.users is defined -%}
|
||||
{{ form_widget(form.users) }}
|
||||
{% endif %}
|
||||
|
||||
<div id="add-persons"></div>
|
||||
|
||||
<h2 class="chill-red">{{ 'Activity data'|trans }}</h2>
|
||||
|
||||
|
@@ -22,7 +22,7 @@
|
||||
'{{ "You are going to leave a page with unsubmitted data. Are you sure you want to leave ?"|trans }}');
|
||||
});
|
||||
window.activity = {{ activity_json|json_encode|raw }};
|
||||
window.default_location_id = {{ default_location_id }};
|
||||
{% if default_location is not null %}window.default_location_id = {{ default_location.id }}{% endif %};
|
||||
</script>
|
||||
{{ encore_entry_script_tags('vue_activity') }}
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user