|
Lines 8-30
Link Here
|
| 8 |
:key="index" |
8 |
:key="index" |
| 9 |
> |
9 |
> |
| 10 |
<strong> |
10 |
<strong> |
| 11 |
<a |
11 |
<router-link |
| 12 |
v-if="definition.page" |
12 |
v-if="definition.page" |
| 13 |
href="#" |
13 |
:to="{ name: definition.page }" |
| 14 |
@click.prevent="goToPage(definition.page)" |
|
|
| 15 |
> |
14 |
> |
| 16 |
{{ definition.count }} |
15 |
{{ createCountText(definition) }} |
| 17 |
<span v-if="definition.count === 1">{{ |
16 |
</router-link> |
| 18 |
definition.labelSingular |
17 |
<span v-else class="inactive-link"> |
| 19 |
}}</span> |
18 |
{{ createCountText(definition) }} |
| 20 |
<span v-else>{{ definition.labelPlural }}</span> |
|
|
| 21 |
</a> |
| 22 |
<span v-else> |
| 23 |
{{ definition.count }} |
| 24 |
<span v-if="definition.count === 1">{{ |
| 25 |
definition.labelSingular |
| 26 |
}}</span> |
| 27 |
<span v-else>{{ definition.labelPlural }}</span> |
| 28 |
</span> |
19 |
</span> |
| 29 |
</strong> |
20 |
</strong> |
| 30 |
<template v-if="index < countDefinitions.length - 1" |
21 |
<template v-if="index < countDefinitions.length - 1" |
|
Lines 110-115
export default {
Link Here
|
| 110 |
}, |
101 |
}, |
| 111 |
]); |
102 |
]); |
| 112 |
|
103 |
|
|
|
104 |
const createCountText = definition => { |
| 105 |
if (definition.count === 1) { |
| 106 |
return `${definition.count} ${definition.labelSingular}`; |
| 107 |
} else { |
| 108 |
return `${definition.count} ${definition.labelPlural}`; |
| 109 |
} |
| 110 |
}; |
| 111 |
|
| 113 |
async function getCounts() { |
112 |
async function getCounts() { |
| 114 |
try { |
113 |
try { |
| 115 |
const response = await APIClient.erm.counts.get(); |
114 |
const response = await APIClient.erm.counts.get(); |
|
Lines 137-142
export default {
Link Here
|
| 137 |
|
136 |
|
| 138 |
return { |
137 |
return { |
| 139 |
...baseWidget, |
138 |
...baseWidget, |
|
|
139 |
createCountText, |
| 140 |
countDefinitions, |
140 |
countDefinitions, |
| 141 |
goToPage, |
141 |
goToPage, |
| 142 |
}; |
142 |
}; |
| 143 |
- |
|
|