View | Details | Raw Unified | Return to bug 38010
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/RecordSources/List.vue (-3 / +3 lines)
Lines 2-8 Link Here
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
3
    <div v-else id="record_sources_list">
3
    <div v-else id="record_sources_list">
4
        <Toolbar>
4
        <Toolbar>
5
            <ToolbarButton
5
            <ButtonLink
6
                :to="{ name: 'RecordSourcesFormAdd' }"
6
                :to="{ name: 'RecordSourcesFormAdd' }"
7
                icon="plus"
7
                icon="plus"
8
                :title="$__('New record source')"
8
                :title="$__('New record source')"
Lines 25-31 Link Here
25
25
26
<script>
26
<script>
27
import Toolbar from "../../Toolbar.vue"
27
import Toolbar from "../../Toolbar.vue"
28
import ToolbarButton from "../../ToolbarButton.vue"
28
import ButtonLink from "../../ButtonLink.vue"
29
import { inject } from "vue"
29
import { inject } from "vue"
30
import { APIClient } from "../../../fetch/api-client.js"
30
import { APIClient } from "../../../fetch/api-client.js"
31
import KohaTable from "../../KohaTable.vue"
31
import KohaTable from "../../KohaTable.vue"
Lines 144-150 export default { Link Here
144
    components: {
144
    components: {
145
        KohaTable,
145
        KohaTable,
146
        Toolbar,
146
        Toolbar,
147
        ToolbarButton,
147
        ButtonLink,
148
    },
148
    },
149
}
149
}
150
</script>
150
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ButtonLink.vue (+65 lines)
Line 0 Link Here
1
<template>
2
    <a
3
        v-if="callback"
4
        @click="typeof callback === 'string' ? redirect() : callback"
5
        :class="class"
6
        style="cursor: pointer"
7
    >
8
        <font-awesome-icon v-if="icon" :icon="icon" /> {{ title }}
9
    </a>
10
    <router-link v-else :to="to" :class="class"
11
        ><font-awesome-icon v-if="icon" :icon="icon" /> {{ title }}</router-link
12
    >
13
</template>
14
15
<script>
16
export default {
17
    props: {
18
        to: {
19
            type: [String, Object],
20
        },
21
        class: {
22
            type: String,
23
            default: "btn btn-default",
24
        },
25
        icon: {
26
            type: String,
27
            required: false,
28
        },
29
        title: {
30
            type: String,
31
        },
32
        callback: {
33
            type: [String, Function],
34
            required: false,
35
        },
36
    },
37
    methods: {
38
        redirect() {
39
            if (typeof this.to === "string")
40
                window.location.href = this.formatUrl(this.to)
41
            if (typeof this.to === "object") {
42
                let url = this.to.path
43
                if (this.to.hasOwnProperty("query")) {
44
                    url +=
45
                        "?" +
46
                        Object.keys(this.to.query)
47
                            .map(
48
                                queryParam =>
49
                                    `${queryParam}=${this.to.query[queryParam]}`
50
                            )
51
                            .join("&")
52
                }
53
                window.location.href = this.formatUrl(url, this.to.internal)
54
            }
55
        },
56
        formatUrl(url) {
57
            if (url.includes("http://") || url.includes("https://")) return url
58
            if (url.includes("cgi-bin/koha"))
59
                return `//${window.location.host}/${url}`
60
            return `//${url}`
61
        },
62
    },
63
    name: "ButtonLink",
64
}
65
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue (-3 / +3 lines)
Lines 2-8 Link Here
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
3
    <div v-else id="agreements_list">
3
    <div v-else id="agreements_list">
4
        <Toolbar v-if="!embedded">
4
        <Toolbar v-if="!embedded">
5
            <ToolbarButton
5
            <ButtonLink
6
                :to="{ name: 'AgreementsFormAdd' }"
6
                :to="{ name: 'AgreementsFormAdd' }"
7
                icon="plus"
7
                icon="plus"
8
                :title="$__('New agreement')"
8
                :title="$__('New agreement')"
Lines 60-66 Link Here
60
<script>
60
<script>
61
import flatPickr from "vue-flatpickr-component"
61
import flatPickr from "vue-flatpickr-component"
62
import Toolbar from "../Toolbar.vue"
62
import Toolbar from "../Toolbar.vue"
63
import ToolbarButton from "../ToolbarButton.vue"
63
import ButtonLink from "../ButtonLink.vue"
64
import { inject, ref, reactive } from "vue"
64
import { inject, ref, reactive } from "vue"
65
import { APIClient } from "../../fetch/api-client.js"
65
import { APIClient } from "../../fetch/api-client.js"
66
import { storeToRefs } from "pinia"
66
import { storeToRefs } from "pinia"
Lines 402-408 export default { Link Here
402
            }
402
            }
403
        },
403
        },
404
    },
404
    },
405
    components: { flatPickr, Toolbar, ToolbarButton, KohaTable },
405
    components: { flatPickr, Toolbar, ButtonLink, KohaTable },
406
    props: {
406
    props: {
407
        embedded: {
407
        embedded: {
408
            type: Boolean,
408
            type: Boolean,
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsShow.vue (-3 / +3 lines)
Lines 2-8 Link Here
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
3
    <div v-else id="agreements_show">
3
    <div v-else id="agreements_show">
4
        <Toolbar>
4
        <Toolbar>
5
            <ToolbarButton
5
            <ButtonLink
6
                :to="{
6
                :to="{
7
                    name: 'AgreementsFormAddEdit',
7
                    name: 'AgreementsFormAddEdit',
8
                    params: { agreement_id: agreement.agreement_id },
8
                    params: { agreement_id: agreement.agreement_id },
Lines 344-350 Link Here
344
import { inject } from "vue"
344
import { inject } from "vue"
345
import { APIClient } from "../../fetch/api-client.js"
345
import { APIClient } from "../../fetch/api-client.js"
346
import Toolbar from "../Toolbar.vue"
346
import Toolbar from "../Toolbar.vue"
347
import ToolbarButton from "../ToolbarButton.vue"
347
import ButtonLink from "../ButtonLink.vue"
348
import AdditionalFieldsDisplay from "../AdditionalFieldsDisplay.vue"
348
import AdditionalFieldsDisplay from "../AdditionalFieldsDisplay.vue"
349
349
350
export default {
350
export default {
Lines 434-440 export default { Link Here
434
            )
434
            )
435
        },
435
        },
436
    },
436
    },
437
    components: { Toolbar, ToolbarButton, AdditionalFieldsDisplay },
437
    components: { Toolbar, ButtonLink, AdditionalFieldsDisplay },
438
    name: "AgreementsShow",
438
    name: "AgreementsShow",
439
}
439
}
440
</script>
440
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackagesList.vue (-3 / +3 lines)
Lines 3-9 Link Here
3
        <div v-if="!initialized">{{ $__("Loading") }}</div>
3
        <div v-if="!initialized">{{ $__("Loading") }}</div>
4
        <div v-else id="packages_list">
4
        <div v-else id="packages_list">
5
            <Toolbar>
5
            <Toolbar>
6
                <ToolbarButton
6
                <ButtonLink
7
                    :to="{ name: 'EHoldingsLocalPackagesFormAdd' }"
7
                    :to="{ name: 'EHoldingsLocalPackagesFormAdd' }"
8
                    icon="plus"
8
                    icon="plus"
9
                    :title="$__('New package')"
9
                    :title="$__('New package')"
Lines 33-39 Link Here
33
33
34
<script>
34
<script>
35
import Toolbar from "../Toolbar.vue"
35
import Toolbar from "../Toolbar.vue"
36
import ToolbarButton from "../ToolbarButton.vue"
36
import ButtonLink from "../ButtonLink.vue"
37
import { inject, ref, reactive } from "vue"
37
import { inject, ref, reactive } from "vue"
38
import { storeToRefs } from "pinia"
38
import { storeToRefs } from "pinia"
39
import { APIClient } from "../../fetch/api-client.js"
39
import { APIClient } from "../../fetch/api-client.js"
Lines 292-298 export default { Link Here
292
            ]
292
            ]
293
        },
293
        },
294
    },
294
    },
295
    components: { Toolbar, ToolbarButton, KohaTable },
295
    components: { Toolbar, ButtonLink, KohaTable },
296
    name: "EHoldingsLocalPackagesList",
296
    name: "EHoldingsLocalPackagesList",
297
}
297
}
298
</script>
298
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackagesShow.vue (-3 / +3 lines)
Lines 2-8 Link Here
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
3
    <div v-else-if="erm_package" id="packages_show">
3
    <div v-else-if="erm_package" id="packages_show">
4
        <Toolbar>
4
        <Toolbar>
5
            <ToolbarButton
5
            <ButtonLink
6
                :to="{
6
                :to="{
7
                    name: 'EHoldingsLocalPackagesFormAddEdit',
7
                    name: 'EHoldingsLocalPackagesFormAddEdit',
8
                    params: { package_id: erm_package.package_id },
8
                    params: { package_id: erm_package.package_id },
Lines 125-131 import { inject } from "vue" Link Here
125
import EHoldingsPackageTitlesList from "./EHoldingsLocalPackageTitlesList.vue"
125
import EHoldingsPackageTitlesList from "./EHoldingsLocalPackageTitlesList.vue"
126
import { APIClient } from "../../fetch/api-client.js"
126
import { APIClient } from "../../fetch/api-client.js"
127
import Toolbar from "../Toolbar.vue"
127
import Toolbar from "../Toolbar.vue"
128
import ToolbarButton from "../ToolbarButton.vue"
128
import ButtonLink from "../ButtonLink.vue"
129
import AdditionalFieldsDisplay from "../AdditionalFieldsDisplay.vue"
129
import AdditionalFieldsDisplay from "../AdditionalFieldsDisplay.vue"
130
130
131
export default {
131
export default {
Lines 214-220 export default { Link Here
214
    components: {
214
    components: {
215
        EHoldingsPackageTitlesList,
215
        EHoldingsPackageTitlesList,
216
        Toolbar,
216
        Toolbar,
217
        ToolbarButton,
217
        ButtonLink,
218
        AdditionalFieldsDisplay,
218
        AdditionalFieldsDisplay,
219
    },
219
    },
220
    name: "EHoldingsLocalPackagesShow",
220
    name: "EHoldingsLocalPackagesShow",
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesList.vue (-5 / +5 lines)
Lines 3-19 Link Here
3
        <div v-if="!initialized">{{ $__("Loading") }}</div>
3
        <div v-if="!initialized">{{ $__("Loading") }}</div>
4
        <div v-else id="titles_list">
4
        <div v-else id="titles_list">
5
            <Toolbar>
5
            <Toolbar>
6
                <ToolbarButton
6
                <ButtonLink
7
                    :to="{ name: 'EHoldingsLocalTitlesFormAdd' }"
7
                    :to="{ name: 'EHoldingsLocalTitlesFormAdd' }"
8
                    icon="plus"
8
                    icon="plus"
9
                    :title="$__('New title')"
9
                    :title="$__('New title')"
10
                />
10
                />
11
                <ToolbarButton
11
                <ButtonLink
12
                    :to="{ name: 'EHoldingsLocalTitlesFormImport' }"
12
                    :to="{ name: 'EHoldingsLocalTitlesFormImport' }"
13
                    icon="plus"
13
                    icon="plus"
14
                    :title="$__('Import from list')"
14
                    :title="$__('Import from list')"
15
                />
15
                />
16
                <ToolbarButton
16
                <ButtonLink
17
                    :to="{ name: 'EHoldingsLocalTitlesKBARTImport' }"
17
                    :to="{ name: 'EHoldingsLocalTitlesKBARTImport' }"
18
                    icon="plus"
18
                    icon="plus"
19
                    :title="$__('Import from KBART file')"
19
                    :title="$__('Import from KBART file')"
Lines 41-47 Link Here
41
41
42
<script>
42
<script>
43
import Toolbar from "../Toolbar.vue"
43
import Toolbar from "../Toolbar.vue"
44
import ToolbarButton from "../ToolbarButton.vue"
44
import ButtonLink from "../ButtonLink.vue"
45
import { inject, ref, reactive } from "vue"
45
import { inject, ref, reactive } from "vue"
46
import { storeToRefs } from "pinia"
46
import { storeToRefs } from "pinia"
47
import { APIClient } from "../../fetch/api-client.js"
47
import { APIClient } from "../../fetch/api-client.js"
Lines 244-250 export default { Link Here
244
            ]
244
            ]
245
        },
245
        },
246
    },
246
    },
247
    components: { Toolbar, ToolbarButton, KohaTable },
247
    components: { Toolbar, ButtonLink, KohaTable },
248
    name: "EHoldingsLocalTitlesList",
248
    name: "EHoldingsLocalTitlesList",
249
}
249
}
250
</script>
250
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesShow.vue (-3 / +3 lines)
Lines 2-8 Link Here
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
3
    <div v-else-if="title" id="eholdings_title_show">
3
    <div v-else-if="title" id="eholdings_title_show">
4
        <Toolbar>
4
        <Toolbar>
5
            <ToolbarButton
5
            <ButtonLink
6
                :to="{
6
                :to="{
7
                    name: 'EHoldingsLocalTitlesFormAddEdit',
7
                    name: 'EHoldingsLocalTitlesFormAddEdit',
8
                    params: { title_id: title.title_id },
8
                    params: { title_id: title.title_id },
Lines 266-272 import { inject } from "vue" Link Here
266
import EHoldingsTitlePackagesList from "./EHoldingsLocalTitlePackagesList.vue"
266
import EHoldingsTitlePackagesList from "./EHoldingsLocalTitlePackagesList.vue"
267
import { APIClient } from "../../fetch/api-client.js"
267
import { APIClient } from "../../fetch/api-client.js"
268
import Toolbar from "../Toolbar.vue"
268
import Toolbar from "../Toolbar.vue"
269
import ToolbarButton from "../ToolbarButton.vue"
269
import ButtonLink from "../ButtonLink.vue"
270
270
271
export default {
271
export default {
272
    setup() {
272
    setup() {
Lines 366-372 export default { Link Here
366
    components: {
366
    components: {
367
        EHoldingsTitlePackagesList,
367
        EHoldingsTitlePackagesList,
368
        Toolbar,
368
        Toolbar,
369
        ToolbarButton,
369
        ButtonLink,
370
    },
370
    },
371
    name: "EHoldingsLocalTitlesShow",
371
    name: "EHoldingsLocalTitlesShow",
372
}
372
}
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicensesList.vue (-3 / +3 lines)
Lines 2-8 Link Here
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
3
    <div v-else id="licenses_list">
3
    <div v-else id="licenses_list">
4
        <Toolbar>
4
        <Toolbar>
5
            <ToolbarButton
5
            <ButtonLink
6
                :to="{ name: 'LicensesFormAdd' }"
6
                :to="{ name: 'LicensesFormAdd' }"
7
                icon="plus"
7
                icon="plus"
8
                :title="$__('New license')"
8
                :title="$__('New license')"
Lines 27-33 Link Here
27
27
28
<script>
28
<script>
29
import Toolbar from "../Toolbar.vue"
29
import Toolbar from "../Toolbar.vue"
30
import ToolbarButton from "../ToolbarButton.vue"
30
import ButtonLink from "../ButtonLink.vue"
31
import { inject, ref } from "vue"
31
import { inject, ref } from "vue"
32
import { storeToRefs } from "pinia"
32
import { storeToRefs } from "pinia"
33
import { APIClient } from "../../fetch/api-client.js"
33
import { APIClient } from "../../fetch/api-client.js"
Lines 274-280 export default { Link Here
274
        av_license_types: Array,
274
        av_license_types: Array,
275
        av_license_statuses: Array,
275
        av_license_statuses: Array,
276
    },
276
    },
277
    components: { Toolbar, ToolbarButton, KohaTable },
277
    components: { Toolbar, ButtonLink, KohaTable },
278
    name: "LicensesList",
278
    name: "LicensesList",
279
}
279
}
280
</script>
280
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicensesShow.vue (-3 / +3 lines)
Lines 2-8 Link Here
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
3
    <div v-else id="licenses_show">
3
    <div v-else id="licenses_show">
4
        <Toolbar>
4
        <Toolbar>
5
            <ToolbarButton
5
            <ButtonLink
6
                :to="{
6
                :to="{
7
                    name: 'LicensesFormAddEdit',
7
                    name: 'LicensesFormAddEdit',
8
                    params: { license_id: license.license_id },
8
                    params: { license_id: license.license_id },
Lines 158-164 Link Here
158
import { inject } from "vue"
158
import { inject } from "vue"
159
import { APIClient } from "../../fetch/api-client.js"
159
import { APIClient } from "../../fetch/api-client.js"
160
import Toolbar from "../Toolbar.vue"
160
import Toolbar from "../Toolbar.vue"
161
import ToolbarButton from "../ToolbarButton.vue"
161
import ButtonLink from "../ButtonLink.vue"
162
import AdditionalFieldsDisplay from "../AdditionalFieldsDisplay.vue"
162
import AdditionalFieldsDisplay from "../AdditionalFieldsDisplay.vue"
163
163
164
export default {
164
export default {
Lines 242-248 export default { Link Here
242
            )
242
            )
243
        },
243
        },
244
    },
244
    },
245
    components: { Toolbar, ToolbarButton, AdditionalFieldsDisplay },
245
    components: { Toolbar, ButtonLink, AdditionalFieldsDisplay },
246
    name: "LicensesShow",
246
    name: "LicensesShow",
247
}
247
}
248
</script>
248
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersShow.vue (-3 / +3 lines)
Lines 2-8 Link Here
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
3
    <div v-else id="usage_data_providers_show">
3
    <div v-else id="usage_data_providers_show">
4
        <Toolbar>
4
        <Toolbar>
5
            <ToolbarButton
5
            <ButtonLink
6
                :to="{
6
                :to="{
7
                    name: 'UsageStatisticsDataProvidersFormAddEdit',
7
                    name: 'UsageStatisticsDataProvidersFormAddEdit',
8
                    params: {
8
                    params: {
Lines 121-127 Link Here
121
import { inject } from "vue"
121
import { inject } from "vue"
122
import { APIClient } from "../../fetch/api-client.js"
122
import { APIClient } from "../../fetch/api-client.js"
123
import Toolbar from "../Toolbar.vue"
123
import Toolbar from "../Toolbar.vue"
124
import ToolbarButton from "../ToolbarButton.vue"
124
import ButtonLink from "../ButtonLink.vue"
125
import UsageStatisticsDataProvidersFileImport from "./UsageStatisticsDataProvidersFileImport.vue"
125
import UsageStatisticsDataProvidersFileImport from "./UsageStatisticsDataProvidersFileImport.vue"
126
import UsageStatisticsDataProvidersCounterLogs from "./UsageStatisticsDataProvidersCounterLogs.vue"
126
import UsageStatisticsDataProvidersCounterLogs from "./UsageStatisticsDataProvidersCounterLogs.vue"
127
import UsageStatisticsDataProviderDetails from "./UsageStatisticsDataProviderDetails.vue"
127
import UsageStatisticsDataProviderDetails from "./UsageStatisticsDataProviderDetails.vue"
Lines 230-236 export default { Link Here
230
        UsageStatisticsDataProviderDetails,
230
        UsageStatisticsDataProviderDetails,
231
        UsageStatisticsProviderDataList,
231
        UsageStatisticsProviderDataList,
232
        Toolbar,
232
        Toolbar,
233
        ToolbarButton,
233
        ButtonLink,
234
    },
234
    },
235
}
235
}
236
</script>
236
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/SettingsProcessingsShow.vue (-3 / +3 lines)
Lines 2-8 Link Here
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
3
    <div v-else id="processing_show">
3
    <div v-else id="processing_show">
4
        <Toolbar>
4
        <Toolbar>
5
            <ToolbarButton
5
            <ButtonLink
6
                :to="{
6
                :to="{
7
                    name: 'SettingsProcessingsFormEdit',
7
                    name: 'SettingsProcessingsFormEdit',
8
                    params: { processing_id: processing.processing_id },
8
                    params: { processing_id: processing.processing_id },
Lines 91-97 Link Here
91
import { inject } from "vue"
91
import { inject } from "vue"
92
import { APIClient } from "../../fetch/api-client.js"
92
import { APIClient } from "../../fetch/api-client.js"
93
import Toolbar from "../Toolbar.vue"
93
import Toolbar from "../Toolbar.vue"
94
import ToolbarButton from "../ToolbarButton.vue"
94
import ButtonLink from "../ButtonLink.vue"
95
95
96
export default {
96
export default {
97
    setup() {
97
    setup() {
Lines 170-176 export default { Link Here
170
            )
170
            )
171
        },
171
        },
172
    },
172
    },
173
    components: { Toolbar, ToolbarButton },
173
    components: { Toolbar, ButtonLink },
174
    name: "ProcessingsShow",
174
    name: "ProcessingsShow",
175
}
175
}
176
</script>
176
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsList.vue (-3 / +3 lines)
Lines 2-8 Link Here
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
3
    <div v-else id="trains_list">
3
    <div v-else id="trains_list">
4
        <Toolbar>
4
        <Toolbar>
5
            <ToolbarButton
5
            <ButtonLink
6
                :to="{ name: 'TrainsFormAdd' }"
6
                :to="{ name: 'TrainsFormAdd' }"
7
                icon="plus"
7
                icon="plus"
8
                :title="$__('New train')"
8
                :title="$__('New train')"
Lines 61-67 Link Here
61
<script>
61
<script>
62
import flatPickr from "vue-flatpickr-component"
62
import flatPickr from "vue-flatpickr-component"
63
import Toolbar from "../Toolbar.vue"
63
import Toolbar from "../Toolbar.vue"
64
import ToolbarButton from "../ToolbarButton.vue"
64
import ButtonLink from "../ButtonLink.vue"
65
import { inject, ref, reactive } from "vue"
65
import { inject, ref, reactive } from "vue"
66
import { APIClient } from "../../fetch/api-client"
66
import { APIClient } from "../../fetch/api-client"
67
import { build_url } from "../../composables/datatables"
67
import { build_url } from "../../composables/datatables"
Lines 273-279 export default { Link Here
273
            ]
273
            ]
274
        },
274
        },
275
    },
275
    },
276
    components: { flatPickr, Toolbar, ToolbarButton, KohaTable },
276
    components: { flatPickr, Toolbar, ButtonLink, KohaTable },
277
    name: "trainsList",
277
    name: "trainsList",
278
    emits: ["select-train", "close"],
278
    emits: ["select-train", "close"],
279
}
279
}
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsShow.vue (-4 / +4 lines)
Lines 73-79 Link Here
73
    <div v-if="!initialized">{{ $__("Loading") }}</div>
73
    <div v-if="!initialized">{{ $__("Loading") }}</div>
74
    <div v-else id="trains_show">
74
    <div v-else id="trains_show">
75
        <Toolbar>
75
        <Toolbar>
76
            <ToolbarButton
76
            <ButtonLink
77
                v-if="train.closed_on == null"
77
                v-if="train.closed_on == null"
78
                :to="{
78
                :to="{
79
                    name: 'TrainsFormAddItem',
79
                    name: 'TrainsFormAddItem',
Lines 91-97 Link Here
91
            >
91
            >
92
                <font-awesome-icon icon="plus" /> {{ $__("Add items") }}
92
                <font-awesome-icon icon="plus" /> {{ $__("Add items") }}
93
            </span>
93
            </span>
94
            <ToolbarButton
94
            <ButtonLink
95
                :to="{
95
                :to="{
96
                    name: 'TrainsFormEdit',
96
                    name: 'TrainsFormEdit',
97
                    params: { train_id: train.train_id },
97
                    params: { train_id: train.train_id },
Lines 287-293 import { inject, createVNode, render } from "vue" Link Here
287
import { APIClient } from "../../fetch/api-client"
287
import { APIClient } from "../../fetch/api-client"
288
import { useDataTable } from "../../composables/datatables"
288
import { useDataTable } from "../../composables/datatables"
289
import Toolbar from "../Toolbar.vue"
289
import Toolbar from "../Toolbar.vue"
290
import ToolbarButton from "../ToolbarButton.vue"
290
import ButtonLink from "../ButtonLink.vue"
291
291
292
export default {
292
export default {
293
    setup() {
293
    setup() {
Lines 729-735 export default { Link Here
729
            })
729
            })
730
        },
730
        },
731
    },
731
    },
732
    components: { Toolbar, ToolbarButton },
732
    components: { Toolbar, ButtonLink },
733
    name: "TrainsShow",
733
    name: "TrainsShow",
734
}
734
}
735
</script>
735
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ToolbarButton.vue (-28 lines)
Lines 1-27 Link Here
1
<template>
2
    <router-link :to="to" :class="class"
3
        ><font-awesome-icon v-if="icon" :icon="icon" /> {{ title }}</router-link
4
    >
5
</template>
6
7
<script>
8
export default {
9
    props: {
10
        to: {
11
            type: [String, Object],
12
        },
13
        class: {
14
            type: String,
15
            default: "btn btn-default",
16
        },
17
        icon: {
18
            type: String,
19
            required: false,
20
        },
21
        title: {
22
            type: String,
23
        },
24
    },
25
    name: "Toolbar",
26
}
27
</script>
28
- 

Return to bug 38010