mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
homepage_widget: improve notifications rows
This commit is contained in:
@@ -22,10 +22,14 @@
|
||||
</h4>
|
||||
</td>
|
||||
<td>
|
||||
<a class="btn btn-sm btn-update"
|
||||
:href="linkEntity(w)">
|
||||
{{ $t('show_entity', { entity: getEntityName(w) }) }}
|
||||
</a>
|
||||
<div class="btn-group" role="group" aria-label="Actions">
|
||||
<a class="btn btn-sm btn-update" :href="getUrl(w)">
|
||||
{{ $t('show_entity', { entity: $t('the_action') }) }}
|
||||
</a>
|
||||
<a class="btn btn-sm btn-show" :href="getUrl(w.accompanyingPeriod)">
|
||||
{{ $t('show_entity', { entity: $t('the_course') }) }}
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
@@ -36,7 +40,6 @@
|
||||
<script>
|
||||
import { mapState, mapGetters } from "vuex";
|
||||
import TabTable from "./TabTable";
|
||||
import { appMessages } from 'ChillMainAssets/vuejs/HomepageWidget/js/i18n';
|
||||
|
||||
export default {
|
||||
name: "MyWorks",
|
||||
@@ -59,20 +62,14 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getEntityName(w) {
|
||||
switch (w.type) {
|
||||
getUrl(e) {
|
||||
switch (e.type) {
|
||||
case 'accompanying_period_work':
|
||||
return appMessages.fr.the_action;
|
||||
return `/fr/person/accompanying-period/work/${e.id}/edit`
|
||||
case 'accompanying_period':
|
||||
return `/fr/parcours/${e.id}`
|
||||
default:
|
||||
throw 'work type unknown';
|
||||
}
|
||||
},
|
||||
linkEntity(w) {
|
||||
switch (w.type) {
|
||||
case 'accompanying_period_work':
|
||||
return `/fr/person/accompanying-period/work/${w.id}/edit`
|
||||
default:
|
||||
throw 'work type unknown';
|
||||
throw 'entity type unknown';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user