|
1 | 1 | <template> |
2 | 2 | <tr class="item"> |
3 | 3 | <td class="control"> |
4 | | - <a :href="item.edit_url" class="icon-link" target="_blank" :title="`Edit “${item.title}”`"><img src="/assets/icons/edit.svg" :alt="`Edit “${item.title}”`" class="action"></a> |
| 4 | + <a :href="item.edit_url" class="icon-link" target="_blank" :title="`Edit “${item.title}”`"><img :src="icons.edit" :alt="`Edit “${item.title}”`" class="action"></a> |
5 | 5 | </td> |
6 | 6 | <td> |
7 | 7 | <p class="title"> |
|
16 | 16 | </p> |
17 | 17 | </td> |
18 | 18 | <td class="control"> |
19 | | - <a :href="item.show_url" class="icon-link" target="_blank" :title="`Admin view of “${item.title}”`"><img src="/assets/icons/eye.svg" :alt="`Admin view of “${item.title}”`" class="action"></a> |
| 19 | + <a :href="item.show_url" class="icon-link" target="_blank" :title="`Admin view of “${item.title}”`"><img :src="icons.eye" :alt="`Admin view of “${item.title}”`" class="action"></a> |
20 | 20 | </td> |
21 | 21 | <td class="control"> |
22 | | - <a :href="item.view_url" class="icon-link" target="_blank" :title="`Permalink to “${item.title}” patron view`"><img src="/assets/icons/link.svg" :alt="`Permalink to “${item.title}” patron view`" class="action"></a> |
| 22 | + <a :href="item.view_url" class="icon-link" target="_blank" :title="`Permalink to “${item.title}” patron view`"><img :src="icons.link" :alt="`Permalink to “${item.title}” patron view`" class="action"></a> |
23 | 23 | </td> |
24 | 24 | <td class="date">{{ formatDateTime(item.updated_at) }}</td> |
25 | 25 | <td v-if="item.complete" class="control">Yes</td> |
|
56 | 56 | </td> |
57 | 57 | <td class="control"> |
58 | 58 | <button class="delete" :disabled="item.complete" :title="item.complete ? 'Only incomplete items can be deleted.' : `Delete “${item.title}”`" @click="deleteItem"> |
59 | | - <img class="action" :alt="`Delete “${item.title}”`" src="/assets/icons/trash-alt.svg"> |
| 59 | + <img class="action" :alt="`Delete “${item.title}”`" :src="icons.trash_alt"> |
60 | 60 | </button> |
61 | 61 | </td> |
62 | 62 | </tr> |
|
65 | 65 | <script> |
66 | 66 | import i18n from '../../shared/mixins/i18n.js' |
67 | 67 |
|
| 68 | +const iconPath = function (name) { |
| 69 | + const icons = window.UCBEARS_ASSETS?.icons |
| 70 | + return icons?.[name] || `/assets/icons/${name}.svg` |
| 71 | +} |
| 72 | +
|
68 | 73 | export default { |
69 | 74 | mixins: [i18n], |
| 75 | + data: function () { |
| 76 | + return { |
| 77 | + icons: { |
| 78 | + edit: iconPath('edit'), |
| 79 | + eye: iconPath('eye'), |
| 80 | + link: iconPath('link'), |
| 81 | + trash_alt: iconPath('trash_alt') |
| 82 | + } |
| 83 | + } |
| 84 | + }, |
70 | 85 | props: { |
71 | 86 | item: { type: Object, default: () => {} }, |
72 | 87 | allTerms: { type: Array, default: () => [] } |
|
0 commit comments