Bug 32030: Remove unnecessary landing pages
[koha.git] / koha-tmpl / intranet-tmpl / prog / js / vue / components / ERM / ERMMain.vue
1 <template>
2     <div v-if="ERMModule">
3         <Breadcrumb />
4         <div class="main container-fluid">
5             <div class="row">
6                 <div class="col-sm-10 col-sm-push-2">
7                     <main>
8                         <Dialog />
9                         <router-view />
10                     </main>
11                 </div>
12
13                 <div class="col-sm-2 col-sm-pull-10">
14                     <aside>
15                         <div id="navmenu">
16                             <div id="navmenulist">
17                                 <h5>{{ $__("E-Resource management") }}</h5>
18                                 <ul>
19                                     <li>
20                                         <router-link
21                                             to="/cgi-bin/koha/erm/agreements"
22                                         >
23                                             <i class="fa fa-check-circle-o"></i>
24                                             {{ $__("Agreements") }}</router-link
25                                         >
26                                     </li>
27                                     <li>
28                                         <router-link
29                                             to="/cgi-bin/koha/erm/licenses"
30                                         >
31                                             <i class="fa fa-gavel"></i>
32                                             {{ $__("Licenses") }}</router-link
33                                         >
34                                     </li>
35                                     <li>
36                                         <router-link
37                                             to="/cgi-bin/koha/erm/eholdings"
38                                             class="disabled"
39                                         >
40                                             <i class="fa fa-crosshairs"></i>
41                                             {{ $__("eHoldings") }}
42                                         </router-link>
43                                     </li>
44
45                                     <li>
46                                         <ul>
47                                             <li
48                                                 v-for="provider in erm_providers"
49                                                 :key="provider"
50                                             >
51                                                 <router-link
52                                                     v-if="provider == 'local'"
53                                                     :to="`/cgi-bin/koha/erm/eholdings/local`"
54                                                     class="disabled"
55                                                 >
56                                                     <i
57                                                         class="fa fa-map-marker"
58                                                     ></i>
59                                                     {{
60                                                         $__("Local")
61                                                     }}</router-link
62                                                 >
63                                                 <router-link
64                                                     v-else-if="
65                                                         provider == 'ebsco'
66                                                     "
67                                                     :to="`/cgi-bin/koha/erm/eholdings/ebsco`"
68                                                     class="disabled"
69                                                 >
70                                                     <i class="fa fa-globe"></i>
71                                                     {{
72                                                         $__("EBSCO")
73                                                     }}</router-link
74                                                 >
75                                                 <ul>
76                                                     <li>
77                                                         <router-link
78                                                             :to="`/cgi-bin/koha/erm/eholdings/${provider}/packages`"
79                                                         >
80                                                             <i
81                                                                 class="
82                                                                     fa
83                                                                     fa-archive
84                                                                 "
85                                                             ></i>
86                                                             {{
87                                                                 $__("Packages")
88                                                             }}</router-link
89                                                         >
90                                                     </li>
91                                                     <li>
92                                                         <router-link
93                                                             :to="`/cgi-bin/koha/erm/eholdings/${provider}/titles`"
94                                                         >
95                                                             <i
96                                                                 class="
97                                                                     fa
98                                                                     fa-sort-alpha-asc
99                                                                 "
100                                                             ></i>
101                                                             {{
102                                                                 $__("Titles")
103                                                             }}</router-link
104                                                         >
105                                                     </li>
106                                                 </ul>
107                                             </li>
108                                         </ul>
109                                     </li>
110                                 </ul>
111                             </div>
112                         </div>
113                     </aside>
114                 </div>
115             </div>
116         </div>
117     </div>
118     <div v-else>
119         {{
120             $__(
121                 "The E-Resource management module is disabled, turn on 'ERMModule' to use it"
122             )
123         }}
124     </div>
125 </template>
126
127 <script>
128 import { inject } from 'vue'
129 import Breadcrumb from "./Breadcrumb.vue"
130 import Dialog from "./Dialog.vue"
131 import { fetchVendors } from "../../fetch"
132 import "vue-select/dist/vue-select.css"
133
134 export default {
135     setup() {
136         const AVStore = inject('AVStore')
137         AVStore.av_agreement_statuses = agreement_statuses
138         AVStore.av_agreement_closure_reasons = agreement_closure_reasons
139         AVStore.av_agreement_renewal_priorities = agreement_renewal_priorities
140         AVStore.av_agreement_user_roles = agreement_user_roles
141         AVStore.av_license_types = license_types
142         AVStore.av_license_statuses = license_statuses
143         AVStore.av_agreement_license_statuses = agreement_license_statuses
144         AVStore.av_agreement_license_location = agreement_license_location
145         AVStore.av_package_types = package_types
146         AVStore.av_package_content_types = package_content_types
147         AVStore.av_title_publication_types = title_publication_types
148
149         const vendorStore = inject('vendorStore')
150
151         return {
152             vendorStore,
153             erm_providers,
154             ERMModule,
155         }
156     },
157     data() {
158         return {
159             component: "agreement",
160         }
161     },
162     beforeCreate() {
163         fetchVendors().then((vendors) => this.vendorStore.vendors = vendors)
164     },
165     components: {
166         Breadcrumb,
167         Dialog,
168     },
169 };
170 </script>
171
172 <style>
173 #navmenulist a.router-link-active {
174     font-weight: 700;
175 }
176 #menu ul ul,
177 #navmenulist ul ul {
178     padding-left: 2em;
179     font-size: 100%;
180 }
181
182 form .v-select {
183     display: inline-block;
184     background-color: white;
185     width: 30%;
186 }
187
188 .v-select,
189 input:not([type="submit"]):not([type="search"]):not([type="button"]):not([type="checkbox"]),
190 textarea {
191     border-color: rgba(60, 60, 60, 0.26);
192     border-width: 1px;
193     border-radius: 4px;
194     min-width: 30%;
195 }
196
197 #navmenulist ul li a.disabled {
198     color: #666;
199     pointer-events: none;
200     font-weight: 700;
201 }
202 #navmenulist ul li a.disabled.router-link-active {
203     color: #000;
204 }
205 </style>