replace all links and buttons involved by OnTheFly component

This commit is contained in:
2021-05-31 15:49:55 +02:00
parent 68059a9938
commit 158b572879
8 changed files with 107 additions and 77 deletions

View File

@@ -14,15 +14,15 @@
<ul class="record_actions">
<li>
<on-the-fly
:type="participation.person.type"
:id="participation.person.id"
v-bind:type="participation.person.type"
v-bind:id="participation.person.id"
action="show">
</on-the-fly>
</li>
<li>
<on-the-fly
:type="participation.person.type"
:id="participation.person.id"
v-bind:type="participation.person.type"
v-bind:id="participation.person.id"
action="edit">
</on-the-fly>
</li>
@@ -35,7 +35,7 @@
<li>
<button v-if="!participation.endDate"
class="sc-button bt-remove"
:title="$t('action.remove')"
v-bind:title="$t('action.remove')"
@click.prevent="$emit('close', participation)">
</button>
<button v-else class="sc-button bt-remove disabled"></button>
@@ -54,14 +54,6 @@ export default {
OnTheFly
},
props: ['participation'],
data() {
return {
url: {
show: '/fr/person/' + this.participation.person.id + '/general',
edit: '/fr/person/' + this.participation.person.id + '/general/edit'
}
}
},
emits: ['remove', 'close']
emits: ['remove', 'close'],
}
</script>

View File

@@ -41,7 +41,18 @@
<ul class="record_actions">
<li>
<a class="sc-button bt-show" :title="$t('action.show')" target="_blank" :href="url.show"></a>
<on-the-fly
v-bind:type="accompanyingCourse.requestor.type"
v-bind:id="accompanyingCourse.requestor.id"
action="show">
</on-the-fly>
</li>
<li>
<on-the-fly
v-bind:type="accompanyingCourse.requestor.type"
v-bind:id="accompanyingCourse.requestor.id"
action="edit">
</on-the-fly>
</li>
</ul>
</div>
@@ -76,12 +87,14 @@
</template>
<script>
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue'
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue';
import OnTheFly from 'ChillMainAssets/vuejs/_components/OnTheFly.vue';
export default {
name: 'Requestor',
components: {
AddPersons,
OnTheFly
},
data() {
return {
@@ -107,13 +120,6 @@ export default {
get() {
return this.$store.state.accompanyingCourse.requestorAnonymous;
}
},
url() {
return (this.accompanyingCourse.requestor.type === 'person') ? {
show: `/fr/person/${this.accompanyingCourse.requestor.id}/general`,
} : {
show: `/fr/thirdparty/thirdparty/${this.accompanyingCourse.requestor.id}/show`,
}
}
},
methods: {

View File

@@ -21,24 +21,25 @@
<td>
<ul class="record_actions">
<li>
<a class="sc-button bt-show" target="_blank"
:href="url.show"
:title="$t('action.show')">
</a>
<on-the-fly
v-bind:type="resource.resource.type"
v-bind:id="resource.resource.id"
action="show">
</on-the-fly>
</li>
<li>
<a class="sc-button bt-update" target="_blank"
:href="url.edit"
:title="$t('action.edit')">
</a>
<on-the-fly
v-bind:type="resource.resource.type"
v-bind:id="resource.resource.id"
action="edit">
</on-the-fly>
</li>
<li>
<button
class="sc-button bt-remove"
:title="$t('action.remove')"
v-bind:title="$t('action.remove')"
@click.prevent="$emit('remove', resource)">
</button>
</li>
</ul>
</td>
@@ -46,23 +47,14 @@
</template>
<script>
import OnTheFly from 'ChillMainAssets/vuejs/_components/OnTheFly.vue';
export default {
name: 'ResourceItem',
components: {
OnTheFly
},
props: ['resource'],
emits: ['remove'],
computed: {
type() {
return this.resource.resource.type;
},
url() {
return (this.type === 'person') ? {
show: `/fr/person/${this.resource.resource.id}/general`,
edit: `/fr/person/${this.resource.resource.id}/general/edit`
} : {
show: `/fr/thirdparty/thirdparty/${this.resource.resource.id}/show`,
edit: `/fr/thirdparty/thirdparty/${this.resource.resource.id}/update`
}
}
}
emits: ['remove']
}
</script>