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

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue (-9 / +9 lines)
Lines 1-7 Link Here
1
<template>
1
<template>
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" :options="this.toolbar_options" />
4
        <Toolbar v-if="!embedded">
5
            <ToolbarButton
6
                :to="{ name: 'AgreementsFormAdd' }"
7
                icon="plus"
8
                :title="$__('New agreement')"
9
            />
10
        </Toolbar>
5
        <fieldset v-if="agreement_count > 0" class="filters">
11
        <fieldset v-if="agreement_count > 0" class="filters">
6
            <label for="expired_filter">{{ $__("Filter by expired") }}:</label>
12
            <label for="expired_filter">{{ $__("Filter by expired") }}:</label>
7
            <input
13
            <input
Lines 52-57 Link Here
52
<script>
58
<script>
53
import flatPickr from "vue-flatpickr-component"
59
import flatPickr from "vue-flatpickr-component"
54
import Toolbar from "../Toolbar.vue"
60
import Toolbar from "../Toolbar.vue"
61
import ToolbarButton from "../ToolbarButton.vue"
55
import { inject, ref, reactive } from "vue"
62
import { inject, ref, reactive } from "vue"
56
import { APIClient } from "../../fetch/api-client.js"
63
import { APIClient } from "../../fetch/api-client.js"
57
import { storeToRefs } from "pinia"
64
import { storeToRefs } from "pinia"
Lines 150-162 export default { Link Here
150
            },
157
            },
151
            before_route_entered: false,
158
            before_route_entered: false,
152
            building_table: false,
159
            building_table: false,
153
            toolbar_options: [
154
                {
155
                    to: "AgreementsFormAdd",
156
                    icon: "plus",
157
                    button_title: this.$__("New agreement"),
158
                },
159
            ],
160
        }
160
        }
161
    },
161
    },
162
    beforeRouteEnter(to, from, next) {
162
    beforeRouteEnter(to, from, next) {
Lines 351-357 export default { Link Here
351
            }
351
            }
352
        },
352
        },
353
    },
353
    },
354
    components: { flatPickr, Toolbar, KohaTable },
354
    components: { flatPickr, Toolbar, ToolbarButton, KohaTable },
355
    props: {
355
    props: {
356
        embedded: {
356
        embedded: {
357
            type: Boolean,
357
            type: Boolean,
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackagesList.vue (-9 / +9 lines)
Lines 2-8 Link Here
2
    <div>
2
    <div>
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 :options="this.toolbar_options" />
5
            <Toolbar>
6
                <ToolbarButton
7
                    :to="{ name: 'EHoldingsLocalPackagesFormAdd' }"
8
                    icon="plus"
9
                    :title="$__('New package')"
10
                />
11
            </Toolbar>
6
            <div
12
            <div
7
                v-if="package_count > 0"
13
                v-if="package_count > 0"
8
                id="package_list_result"
14
                id="package_list_result"
Lines 25-30 Link Here
25
31
26
<script>
32
<script>
27
import Toolbar from "../Toolbar.vue"
33
import Toolbar from "../Toolbar.vue"
34
import ToolbarButton from "../ToolbarButton.vue"
28
import { inject, ref, reactive } from "vue"
35
import { inject, ref, reactive } from "vue"
29
import { storeToRefs } from "pinia"
36
import { storeToRefs } from "pinia"
30
import { APIClient } from "../../fetch/api-client.js"
37
import { APIClient } from "../../fetch/api-client.js"
Lines 98-110 export default { Link Here
98
                    "-1": ["edit", "delete"],
105
                    "-1": ["edit", "delete"],
99
                },
106
                },
100
            },
107
            },
101
            toolbar_options: [
102
                {
103
                    to: "EHoldingsLocalPackagesFormAdd",
104
                    icon: "plus",
105
                    button_title: this.$__("New package"),
106
                },
107
            ],
108
        }
108
        }
109
    },
109
    },
110
    beforeRouteEnter(to, from, next) {
110
    beforeRouteEnter(to, from, next) {
Lines 245-251 export default { Link Here
245
            ]
245
            ]
246
        },
246
        },
247
    },
247
    },
248
    components: { Toolbar, KohaTable },
248
    components: { Toolbar, ToolbarButton, KohaTable },
249
    name: "EHoldingsLocalPackagesList",
249
    name: "EHoldingsLocalPackagesList",
250
}
250
}
251
</script>
251
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesList.vue (-14 / +14 lines)
Lines 2-8 Link Here
2
    <div>
2
    <div>
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 :options="this.toolbar_options" />
5
            <Toolbar>
6
                <ToolbarButton
7
                    :to="{ name: 'EHoldingsLocalTitlesFormAdd' }"
8
                    icon="plus"
9
                    :title="$__('New title')"
10
                />
11
                <ToolbarButton
12
                    :to="{ name: 'EHoldingsLocalTitlesFormImport' }"
13
                    icon="plus"
14
                    :title="$__('Import from list')"
15
                />
16
            </Toolbar>
6
            <div
17
            <div
7
                v-if="title_count > 0"
18
                v-if="title_count > 0"
8
                id="title_list_result"
19
                id="title_list_result"
Lines 25-30 Link Here
25
36
26
<script>
37
<script>
27
import Toolbar from "../Toolbar.vue"
38
import Toolbar from "../Toolbar.vue"
39
import ToolbarButton from "../ToolbarButton.vue"
28
import { inject, ref, reactive } from "vue"
40
import { inject, ref, reactive } from "vue"
29
import { storeToRefs } from "pinia"
41
import { storeToRefs } from "pinia"
30
import { APIClient } from "../../fetch/api-client.js"
42
import { APIClient } from "../../fetch/api-client.js"
Lines 90-107 export default { Link Here
90
                },
102
                },
91
            },
103
            },
92
            cannot_search: false,
104
            cannot_search: false,
93
            toolbar_options: [
94
                {
95
                    to: "EHoldingsLocalTitlesFormAdd",
96
                    icon: "plus",
97
                    button_title: this.$__("New title"),
98
                },
99
                {
100
                    to: "EHoldingsLocalTitlesFormImport",
101
                    icon: "plus",
102
                    button_title: this.$__("Import from list"),
103
                },
104
            ],
105
        }
105
        }
106
    },
106
    },
107
    beforeRouteEnter(to, from, next) {
107
    beforeRouteEnter(to, from, next) {
Lines 239-245 export default { Link Here
239
            ]
239
            ]
240
        },
240
        },
241
    },
241
    },
242
    components: { Toolbar, KohaTable },
242
    components: { Toolbar, ToolbarButton, KohaTable },
243
    name: "EHoldingsLocalTitlesList",
243
    name: "EHoldingsLocalTitlesList",
244
}
244
}
245
</script>
245
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicensesList.vue (-2 / +9 lines)
Lines 1-7 Link Here
1
<template>
1
<template>
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 :options="this.toolbar_options" />
4
        <Toolbar>
5
            <ToolbarButton
6
                :to="{ name: 'LicensesFormAdd' }"
7
                icon="plus"
8
                :title="$__('New License')"
9
            />
10
        </Toolbar>
5
        <div v-if="license_count > 0" class="page-section">
11
        <div v-if="license_count > 0" class="page-section">
6
            <KohaTable
12
            <KohaTable
7
                ref="table"
13
                ref="table"
Lines 19-24 Link Here
19
25
20
<script>
26
<script>
21
import Toolbar from "../Toolbar.vue"
27
import Toolbar from "../Toolbar.vue"
28
import ToolbarButton from "../ToolbarButton.vue"
22
import { inject, ref } from "vue"
29
import { inject, ref } from "vue"
23
import { storeToRefs } from "pinia"
30
import { storeToRefs } from "pinia"
24
import { APIClient } from "../../fetch/api-client.js"
31
import { APIClient } from "../../fetch/api-client.js"
Lines 220-226 export default { Link Here
220
        av_license_types: Array,
227
        av_license_types: Array,
221
        av_license_statuses: Array,
228
        av_license_statuses: Array,
222
    },
229
    },
223
    components: { Toolbar, KohaTable },
230
    components: { Toolbar, ToolbarButton, KohaTable },
224
    name: "LicensesList",
231
    name: "LicensesList",
225
}
232
}
226
</script>
233
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Toolbar.vue (-11 / +1 lines)
Lines 1-21 Link Here
1
<template>
1
<template>
2
    <div id="toolbar" class="btn-toolbar">
2
    <div id="toolbar" class="btn-toolbar">
3
        <router-link
3
        <slot />
4
            v-for="(option, index) in options"
5
            :key="index"
6
            :to="{ name: option.to }"
7
            class="btn btn-default"
8
            ><font-awesome-icon :icon="option.icon" />
9
            {{ option.button_title }}</router-link
10
        >
11
    </div>
4
    </div>
12
</template>
5
</template>
13
6
14
<script>
7
<script>
15
export default {
8
export default {
16
    props: {
17
        options: Array,
18
    },
19
    name: "Toolbar",
9
    name: "Toolbar",
20
}
10
}
21
</script>
11
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ToolbarButton.vue (-1 / +27 lines)
Line 0 Link Here
0
- 
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>

Return to bug 34215