Blame view

src/components/pageHeader/AppDrawer.vue 30.6 KB
93a68cfa1   Jatinder Singh   first commit
1
2
3
  <template>
    <v-navigation-drawer
      id="appDrawer"
93a68cfa1   Jatinder Singh   first commit
4
      app
a76a6f135   Neeraj Sharma   implelement task
5
      fixed
bf63831be   Amber Dev   navigation drawer...
6
7
      :mini-variant.sync="mini"
      :dark="$vuetify.dark"
93a68cfa1   Jatinder Singh   first commit
8
      v-model="drawer"
68d742034   Neeraj Sharma   implement new des...
9
      hide-overlay
93a68cfa1   Jatinder Singh   first commit
10
      width="260"
a76a6f135   Neeraj Sharma   implelement task
11
      class="white--text side-bar-color"
52d274996   Amber Dev   added scroll to n...
12
      style="height: 100%; overflow: scroll;"
687e0b929   Neeraj Sharma   add user,attenden...
13
    >
a9dc8b176   Neeraj Sharma   remove side bar s...
14
      <!-- <vue-perfect-scrollbar
68d742034   Neeraj Sharma   implement new des...
15
16
        class="drawer-menu--scroll side-bar-color mt-3"
        :settings="scrollSettings"
a9dc8b176   Neeraj Sharma   remove side bar s...
17
      >-->
a76a6f135   Neeraj Sharma   implelement task
18
19
20
21
22
23
24
25
26
27
28
29
      <v-toolbar class="white" flat>
        <img
          v-bind:src="computeLogo"
          height="40"
          width="130"
          class="imgLogo mb-3 mt-3"
          alt="logo"
          style="margin: auto;
        display: block;"
        />
      </v-toolbar>
      <v-list dense dark>
db965de89   Amber Dev   added dialog pers...
30
        <!-- NAVIGATION DRAWER IF ROLE IS ADMIN -->
a9dc8b176   Neeraj Sharma   remove side bar s...
31
32
33
        <template v-for="(item, i) in menus" v-if="role === 'ADMIN'">
          <!-- {{menus}} -->
          <!--group with subitems-->
a76a6f135   Neeraj Sharma   implelement task
34
          <v-list-group v-if="item.items" :key="item.name" :group="item.group" no-action>
a9dc8b176   Neeraj Sharma   remove side bar s...
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
            <v-list-tile slot="activator" ripple="ripple">
              <v-list-tile-action v-if="item.icon">
                <img :src="item.icon" width="22" alt="icons" />
              </v-list-tile-action>
              <v-list-tile-content>
                <v-list-tile-title>{{ item.title }}</v-list-tile-title>
              </v-list-tile-content>
            </v-list-tile>
            <template v-for="(subItem, i) in item.items">
              <!--sub group-->
              <v-list-group
                v-if="subItem.items"
                :key="subItem.name"
                :group="subItem.group"
                sub-group="sub-group"
              >
                <v-list-tile slot="activator" ripple="ripple">
                  <v-list-tile-content>
                    <v-list-tile-title>{{ subItem.title }}</v-list-tile-title>
                  </v-list-tile-content>
                </v-list-tile>
687e0b929   Neeraj Sharma   add user,attenden...
56
                <v-list-tile
a9dc8b176   Neeraj Sharma   remove side bar s...
57
                  v-for="(grand, i) in subItem.children"
687e0b929   Neeraj Sharma   add user,attenden...
58
                  :key="i"
a9dc8b176   Neeraj Sharma   remove side bar s...
59
60
                  :to="genChildTarget(item, grand)"
                  :href="grand.href"
687e0b929   Neeraj Sharma   add user,attenden...
61
62
                  ripple="ripple"
                >
687e0b929   Neeraj Sharma   add user,attenden...
63
                  <v-list-tile-content>
a9dc8b176   Neeraj Sharma   remove side bar s...
64
                    <v-list-tile-title>{{ grand.title }}</v-list-tile-title>
687e0b929   Neeraj Sharma   add user,attenden...
65
                  </v-list-tile-content>
687e0b929   Neeraj Sharma   add user,attenden...
66
                </v-list-tile>
a9dc8b176   Neeraj Sharma   remove side bar s...
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
              </v-list-group>
              <!--child item-->
              <v-list-tile
                v-else
                :key="i"
                :to="genChildTarget(item, subItem)"
                :href="subItem.href"
                :disabled="subItem.disabled"
                :target="subItem.target"
                ripple="ripple"
              >
                <v-list-tile-action v-if="subItem.action">
                  <img
                    width="30"
                    :src="subItem.action"
                    :class="[subItem.actionClass || 'success--text']"
                  />
                </v-list-tile-action>
                <v-list-tile-content>
                  <v-list-tile-title class="body-2">
                    <span>{{ subItem.title }}</span>
                  </v-list-tile-title>
                </v-list-tile-content>
                <!-- <v-circle class="white--text pa-0 circle-pill" v-if="subItem.badge" color="red" disabled="disabled">{{ subItem.badge }}</v-circle> -->
              </v-list-tile>
            </template>
          </v-list-group>
          <v-subheader v-else-if="item.header" :key="i">{{ item.header }}</v-subheader>
          <v-divider v-else-if="item.divider" :key="i"></v-divider>
          <!--top-level link-->
          <v-list-tile
            v-else
            ripple="ripple"
            :disabled="item.disabled"
            :target="item.target"
            rel="noopener"
            :key="item.name"
            :to="!item.href ? { name: item.name } : null"
            :href="item.href"
          >
            <!-- <a :href="item.path"> -->
            <v-list-tile-action v-if="item.icon">
              <img :src="item.icon" width="22" alt="icons" />
            </v-list-tile-action>
            <v-list-tile-content class="pt-2">
              <v-list-tile-title>{{ item.title }}</v-list-tile-title>
            </v-list-tile-content>
            <!-- <v-circle class="white--text pa-0 chip--x-small" v-if="item.badge" :color="item.color || 'primary'" disabled="disabled">{{ item.badge }}</v-circle> -->
            <v-list-tile-action v-if="item.subAction">
              <!-- <v-icon class="success--text">{{ item.subAction }}</v-icon> -->
              <!-- <img :src="item.icon" width="40" alt="icons" /> -->
            </v-list-tile-action>
            <!-- <v-circle class="caption blue lighten-2 white--text mx-0" v-else-if="item.chip" label="label" small="small">{{ item.chip }}</v-circle> -->
            <!-- </a> -->
          </v-list-tile>
        </template>
        <template v-for="(item, i) in menuAccount" v-if="role === 'ACCOUNTANT'">
          <!-- {{menus}} -->
          <!--group with subitems-->
          <v-list-group v-if="item.items" :key="item.name" :group="item.group" no-action="no-action">
            <v-list-tile slot="activator" ripple="ripple">
68d742034   Neeraj Sharma   implement new des...
128
129
130
              <v-list-tile-action v-if="item.icon">
                <img :src="item.icon" width="22" alt="icons" />
              </v-list-tile-action>
a9dc8b176   Neeraj Sharma   remove side bar s...
131
              <v-list-tile-content>
68d742034   Neeraj Sharma   implement new des...
132
133
                <v-list-tile-title>{{ item.title }}</v-list-tile-title>
              </v-list-tile-content>
68d742034   Neeraj Sharma   implement new des...
134
            </v-list-tile>
a9dc8b176   Neeraj Sharma   remove side bar s...
135
136
137
138
139
140
141
142
143
144
145
146
147
            <template v-for="(subItem, i) in item.items">
              <!--sub group-->
              <v-list-group
                v-if="subItem.items"
                :key="subItem.name"
                :group="subItem.group"
                sub-group="sub-group"
              >
                <v-list-tile slot="activator" ripple="ripple">
                  <v-list-tile-content>
                    <v-list-tile-title>{{ subItem.title }}</v-list-tile-title>
                  </v-list-tile-content>
                </v-list-tile>
acb6c9e2b   Shikha Mishra   issues solved rel...
148
                <v-list-tile
a9dc8b176   Neeraj Sharma   remove side bar s...
149
                  v-for="(grand, i) in subItem.children"
acb6c9e2b   Shikha Mishra   issues solved rel...
150
                  :key="i"
a9dc8b176   Neeraj Sharma   remove side bar s...
151
152
                  :to="genChildTarget(item, grand)"
                  :href="grand.href"
acb6c9e2b   Shikha Mishra   issues solved rel...
153
154
                  ripple="ripple"
                >
acb6c9e2b   Shikha Mishra   issues solved rel...
155
                  <v-list-tile-content>
a9dc8b176   Neeraj Sharma   remove side bar s...
156
                    <v-list-tile-title>{{ grand.title }}</v-list-tile-title>
acb6c9e2b   Shikha Mishra   issues solved rel...
157
                  </v-list-tile-content>
acb6c9e2b   Shikha Mishra   issues solved rel...
158
                </v-list-tile>
a9dc8b176   Neeraj Sharma   remove side bar s...
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
              </v-list-group>
              <!--child item-->
              <v-list-tile
                v-else
                :key="i"
                :to="genChildTarget(item, subItem)"
                :href="subItem.href"
                :disabled="subItem.disabled"
                :target="subItem.target"
                ripple="ripple"
              >
                <v-list-tile-action v-if="subItem.action">
                  <img
                    width="30"
                    :src="subItem.action"
                    :class="[subItem.actionClass || 'success--text']"
                  />
                </v-list-tile-action>
                <v-list-tile-content>
                  <v-list-tile-title class="body-2">
                    <span>{{ subItem.title }}</span>
                  </v-list-tile-title>
                </v-list-tile-content>
                <!-- <v-circle class="white--text pa-0 circle-pill" v-if="subItem.badge" color="red" disabled="disabled">{{ subItem.badge }}</v-circle> -->
              </v-list-tile>
            </template>
          </v-list-group>
          <v-subheader v-else-if="item.header" :key="i">{{ item.header }}</v-subheader>
          <v-divider v-else-if="item.divider" :key="i"></v-divider>
          <!--top-level link-->
          <v-list-tile
            v-else
            ripple="ripple"
            :disabled="item.disabled"
            :target="item.target"
            rel="noopener"
            :key="item.name"
            :to="!item.href ? { name: item.name } : null"
            :href="item.href"
          >
            <!-- <a :href="item.path"> -->
            <v-list-tile-action v-if="item.icon">
              <img :src="item.icon" width="22" alt="icons" />
            </v-list-tile-action>
            <v-list-tile-content class="pt-2">
              <v-list-tile-title>{{ item.title }}</v-list-tile-title>
            </v-list-tile-content>
            <!-- <v-circle class="white--text pa-0 chip--x-small" v-if="item.badge" :color="item.color || 'primary'" disabled="disabled">{{ item.badge }}</v-circle> -->
            <v-list-tile-action v-if="item.subAction">
              <!-- <v-icon class="success--text">{{ item.subAction }}</v-icon> -->
              <!-- <img :src="item.icon" width="40" alt="icons" /> -->
            </v-list-tile-action>
            <!-- <v-circle class="caption blue lighten-2 white--text mx-0" v-else-if="item.chip" label="label" small="small">{{ item.chip }}</v-circle> -->
            <!-- </a> -->
          </v-list-tile>
        </template>
db965de89   Amber Dev   added dialog pers...
215
        <!-- NAVIGATION DRAWER IF ROLE IS LIBRARIAN -->
a9dc8b176   Neeraj Sharma   remove side bar s...
216
217
218
219
220
        <template v-for="(item, i) in menuLibrarian" v-if="role === 'LIBRARIAN'">
          <!-- {{menus}} -->
          <!--group with subitems-->
          <v-list-group v-if="item.items" :key="item.name" :group="item.group" no-action="no-action">
            <v-list-tile slot="activator" ripple="ripple">
acb6c9e2b   Shikha Mishra   issues solved rel...
221
222
223
              <v-list-tile-action v-if="item.icon">
                <img :src="item.icon" width="22" alt="icons" />
              </v-list-tile-action>
a9dc8b176   Neeraj Sharma   remove side bar s...
224
              <v-list-tile-content>
acb6c9e2b   Shikha Mishra   issues solved rel...
225
226
                <v-list-tile-title>{{ item.title }}</v-list-tile-title>
              </v-list-tile-content>
acb6c9e2b   Shikha Mishra   issues solved rel...
227
            </v-list-tile>
a9dc8b176   Neeraj Sharma   remove side bar s...
228
229
230
231
232
233
234
235
236
237
238
239
240
            <template v-for="(subItem, i) in item.items">
              <!--sub group-->
              <v-list-group
                v-if="subItem.items"
                :key="subItem.name"
                :group="subItem.group"
                sub-group="sub-group"
              >
                <v-list-tile slot="activator" ripple="ripple">
                  <v-list-tile-content>
                    <v-list-tile-title>{{ subItem.title }}</v-list-tile-title>
                  </v-list-tile-content>
                </v-list-tile>
acb6c9e2b   Shikha Mishra   issues solved rel...
241
                <v-list-tile
a9dc8b176   Neeraj Sharma   remove side bar s...
242
                  v-for="(grand, i) in subItem.children"
acb6c9e2b   Shikha Mishra   issues solved rel...
243
                  :key="i"
a9dc8b176   Neeraj Sharma   remove side bar s...
244
245
                  :to="genChildTarget(item, grand)"
                  :href="grand.href"
acb6c9e2b   Shikha Mishra   issues solved rel...
246
247
                  ripple="ripple"
                >
acb6c9e2b   Shikha Mishra   issues solved rel...
248
                  <v-list-tile-content>
a9dc8b176   Neeraj Sharma   remove side bar s...
249
                    <v-list-tile-title>{{ grand.title }}</v-list-tile-title>
acb6c9e2b   Shikha Mishra   issues solved rel...
250
                  </v-list-tile-content>
acb6c9e2b   Shikha Mishra   issues solved rel...
251
                </v-list-tile>
a9dc8b176   Neeraj Sharma   remove side bar s...
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
              </v-list-group>
              <!--child item-->
              <v-list-tile
                v-else
                :key="i"
                :to="genChildTarget(item, subItem)"
                :href="subItem.href"
                :disabled="subItem.disabled"
                :target="subItem.target"
                ripple="ripple"
              >
                <v-list-tile-action v-if="subItem.action">
                  <img
                    width="30"
                    :src="subItem.action"
                    :class="[subItem.actionClass || 'success--text']"
                  />
                </v-list-tile-action>
                <v-list-tile-content>
                  <v-list-tile-title class="body-2">
                    <span>{{ subItem.title }}</span>
                  </v-list-tile-title>
                </v-list-tile-content>
                <!-- <v-circle class="white--text pa-0 circle-pill" v-if="subItem.badge" color="red" disabled="disabled">{{ subItem.badge }}</v-circle> -->
              </v-list-tile>
            </template>
          </v-list-group>
          <v-subheader v-else-if="item.header" :key="i">{{ item.header }}</v-subheader>
          <v-divider v-else-if="item.divider" :key="i"></v-divider>
          <!--top-level link-->
          <v-list-tile
            v-else
            ripple="ripple"
            :disabled="item.disabled"
            :target="item.target"
            rel="noopener"
            :key="item.name"
            :to="!item.href ? { name: item.name } : null"
            :href="item.href"
          >
            <!-- <a :href="item.path"> -->
            <v-list-tile-action v-if="item.icon">
              <img :src="item.icon" width="22" alt="icons" />
            </v-list-tile-action>
            <v-list-tile-content class="pt-2">
              <v-list-tile-title>{{ item.title }}</v-list-tile-title>
            </v-list-tile-content>
            <!-- <v-circle class="white--text pa-0 chip--x-small" v-if="item.badge" :color="item.color || 'primary'" disabled="disabled">{{ item.badge }}</v-circle> -->
            <v-list-tile-action v-if="item.subAction">
              <!-- <v-icon class="success--text">{{ item.subAction }}</v-icon> -->
              <!-- <img :src="item.icon" width="40" alt="icons" /> -->
            </v-list-tile-action>
            <!-- <v-circle class="caption blue lighten-2 white--text mx-0" v-else-if="item.chip" label="label" small="small">{{ item.chip }}</v-circle> -->
            <!-- </a> -->
          </v-list-tile>
        </template>
        <template v-for="(item, i) in menuSchool" v-if="schoolRole === 'SUPERADMIN'">
          <!-- {{menus}} -->
          <!--group with subitems-->
          <v-list-group v-if="item.items" :key="item.name" :group="item.group" no-action="no-action">
            <v-list-tile slot="activator" ripple="ripple">
acb6c9e2b   Shikha Mishra   issues solved rel...
313
314
315
              <v-list-tile-action v-if="item.icon">
                <img :src="item.icon" width="22" alt="icons" />
              </v-list-tile-action>
a9dc8b176   Neeraj Sharma   remove side bar s...
316
              <v-list-tile-content>
8233c5dd6   Shikha Mishra   Hide delete butto...
317
                <!-- <v-list-tile-title>{{ item.title }}</v-list-tile-title> -->
acb6c9e2b   Shikha Mishra   issues solved rel...
318
              </v-list-tile-content>
acb6c9e2b   Shikha Mishra   issues solved rel...
319
            </v-list-tile>
a9dc8b176   Neeraj Sharma   remove side bar s...
320
321
322
323
324
325
326
327
328
329
330
331
332
            <template v-for="(subItem, i) in item.items">
              <!--sub group-->
              <v-list-group
                v-if="subItem.items"
                :key="subItem.name"
                :group="subItem.group"
                sub-group="sub-group"
              >
                <v-list-tile slot="activator" ripple="ripple">
                  <v-list-tile-content>
                    <v-list-tile-title>{{ subItem.title }}</v-list-tile-title>
                  </v-list-tile-content>
                </v-list-tile>
68d742034   Neeraj Sharma   implement new des...
333
                <v-list-tile
a9dc8b176   Neeraj Sharma   remove side bar s...
334
                  v-for="(grand, i) in subItem.children"
68d742034   Neeraj Sharma   implement new des...
335
                  :key="i"
a9dc8b176   Neeraj Sharma   remove side bar s...
336
337
                  :to="genChildTarget(item, grand)"
                  :href="grand.href"
68d742034   Neeraj Sharma   implement new des...
338
339
                  ripple="ripple"
                >
68d742034   Neeraj Sharma   implement new des...
340
                  <v-list-tile-content>
a9dc8b176   Neeraj Sharma   remove side bar s...
341
                    <v-list-tile-title>{{ grand.title }}</v-list-tile-title>
68d742034   Neeraj Sharma   implement new des...
342
                  </v-list-tile-content>
68d742034   Neeraj Sharma   implement new des...
343
                </v-list-tile>
a9dc8b176   Neeraj Sharma   remove side bar s...
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
              </v-list-group>
              <!--child item-->
              <v-list-tile
                v-else
                :key="i"
                :to="genChildTarget(item, subItem)"
                :href="subItem.href"
                :disabled="subItem.disabled"
                :target="subItem.target"
                ripple="ripple"
              >
                <v-list-tile-action v-if="subItem.action">
                  <img
                    width="30"
                    :src="subItem.action"
                    :class="[subItem.actionClass || 'success--text']"
                  />
                </v-list-tile-action>
                <v-list-tile-content>
                  <v-list-tile-title class="body-2">
                    <span>{{ subItem.title }}</span>
                  </v-list-tile-title>
                </v-list-tile-content>
                <!-- <v-circle class="white--text pa-0 circle-pill" v-if="subItem.badge" color="red" disabled="disabled">{{ subItem.badge }}</v-circle> -->
              </v-list-tile>
            </template>
          </v-list-group>
          <v-subheader v-else-if="item.header" :key="i">{{ item.header }}</v-subheader>
          <v-divider v-else-if="item.divider" :key="i"></v-divider>
          <!--top-level link-->
          <v-list-tile
            v-else
            ripple="ripple"
            :disabled="item.disabled"
            :target="item.target"
            rel="noopener"
            :key="item.name"
            :to="!item.href ? { name: item.name } : null"
            :href="item.href"
          >
            <!-- <a :href="item.path"> -->
            <v-list-tile-action v-if="item.icon">
              <img :src="item.icon" width="22" alt="icons" />
            </v-list-tile-action>
            <v-list-tile-content class="pt-2">
              <v-list-tile-title>{{ item.title }}</v-list-tile-title>
            </v-list-tile-content>
            <!-- <v-circle class="white--text pa-0 chip--x-small" v-if="item.badge" :color="item.color || 'primary'" disabled="disabled">{{ item.badge }}</v-circle> -->
            <v-list-tile-action v-if="item.subAction">
              <!-- <v-icon class="success--text">{{ item.subAction }}</v-icon> -->
              <!-- <img :src="item.icon" width="40" alt="icons" /> -->
            </v-list-tile-action>
            <!-- <v-circle class="caption blue lighten-2 white--text mx-0" v-else-if="item.chip" label="label" small="small">{{ item.chip }}</v-circle> -->
            <!-- </a> -->
          </v-list-tile>
        </template>
e91641fe5   Amber Dev   solved bugs
400
401
  
        <!-- NAVIGATION DRAWER IF ROLE IS TEACHER -->
a9dc8b176   Neeraj Sharma   remove side bar s...
402
403
404
405
406
        <template v-for="(item, i) in menuTeacher" v-if="role === 'TEACHER'">
          <!-- {{menus}} -->
          <!--group with subitems-->
          <v-list-group v-if="item.items" :key="item.name" :group="item.group" no-action="no-action">
            <v-list-tile slot="activator" ripple="ripple">
68d742034   Neeraj Sharma   implement new des...
407
408
409
              <v-list-tile-action v-if="item.icon">
                <img :src="item.icon" width="22" alt="icons" />
              </v-list-tile-action>
a9dc8b176   Neeraj Sharma   remove side bar s...
410
              <v-list-tile-content>
68d742034   Neeraj Sharma   implement new des...
411
412
                <v-list-tile-title>{{ item.title }}</v-list-tile-title>
              </v-list-tile-content>
687e0b929   Neeraj Sharma   add user,attenden...
413
            </v-list-tile>
a9dc8b176   Neeraj Sharma   remove side bar s...
414
415
416
417
418
419
420
421
422
423
424
425
426
            <template v-for="(subItem, i) in item.items">
              <!--sub group-->
              <v-list-group
                v-if="subItem.items"
                :key="subItem.name"
                :group="subItem.group"
                sub-group="sub-group"
              >
                <v-list-tile slot="activator" ripple="ripple">
                  <v-list-tile-content>
                    <v-list-tile-title>{{ subItem.title }}</v-list-tile-title>
                  </v-list-tile-content>
                </v-list-tile>
710438de6   Shikha Mishra   added teacher mod...
427
                <v-list-tile
a9dc8b176   Neeraj Sharma   remove side bar s...
428
                  v-for="(grand, i) in subItem.children"
710438de6   Shikha Mishra   added teacher mod...
429
                  :key="i"
a9dc8b176   Neeraj Sharma   remove side bar s...
430
431
                  :to="genChildTarget(item, grand)"
                  :href="grand.href"
710438de6   Shikha Mishra   added teacher mod...
432
433
                  ripple="ripple"
                >
710438de6   Shikha Mishra   added teacher mod...
434
                  <v-list-tile-content>
a9dc8b176   Neeraj Sharma   remove side bar s...
435
                    <v-list-tile-title>{{ grand.title }}</v-list-tile-title>
710438de6   Shikha Mishra   added teacher mod...
436
                  </v-list-tile-content>
710438de6   Shikha Mishra   added teacher mod...
437
                </v-list-tile>
a9dc8b176   Neeraj Sharma   remove side bar s...
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
              </v-list-group>
              <!--child item-->
              <v-list-tile
                v-else
                :key="i"
                :to="genChildTarget(item, subItem)"
                :href="subItem.href"
                :disabled="subItem.disabled"
                :target="subItem.target"
                ripple="ripple"
              >
                <v-list-tile-action v-if="subItem.action">
                  <img
                    width="30"
                    :src="subItem.action"
                    :class="[subItem.actionClass || 'success--text']"
                  />
                </v-list-tile-action>
                <v-list-tile-content>
                  <v-list-tile-title class="body-2">
                    <span>{{ subItem.title }}</span>
                  </v-list-tile-title>
                </v-list-tile-content>
                <!-- <v-circle class="white--text pa-0 circle-pill" v-if="subItem.badge" color="red" disabled="disabled">{{ subItem.badge }}</v-circle> -->
              </v-list-tile>
            </template>
          </v-list-group>
          <v-subheader v-else-if="item.header" :key="i">{{ item.header }}</v-subheader>
          <v-divider v-else-if="item.divider" :key="i"></v-divider>
          <!--top-level link-->
          <v-list-tile
            v-else
            ripple="ripple"
            :disabled="item.disabled"
            :target="item.target"
            rel="noopener"
            :key="item.name"
            :to="!item.href ? { name: item.name } : null"
            :href="item.href"
          >
            <!-- <a :href="item.path"> -->
            <v-list-tile-action v-if="item.icon">
              <img :src="item.icon" width="22" alt="icons" />
            </v-list-tile-action>
            <v-list-tile-content class="pt-2">
              <v-list-tile-title>{{ item.title }}</v-list-tile-title>
            </v-list-tile-content>
            <!-- <v-circle class="white--text pa-0 chip--x-small" v-if="item.badge" :color="item.color || 'primary'" disabled="disabled">{{ item.badge }}</v-circle> -->
            <v-list-tile-action v-if="item.subAction">
              <!-- <v-icon class="success--text">{{ item.subAction }}</v-icon> -->
              <!-- <img :src="item.icon" width="40" alt="icons" /> -->
            </v-list-tile-action>
            <!-- <v-circle class="caption blue lighten-2 white--text mx-0" v-else-if="item.chip" label="label" small="small">{{ item.chip }}</v-circle> -->
            <!-- </a> -->
          </v-list-tile>
        </template>
e91641fe5   Amber Dev   solved bugs
494
495
  
        <!-- NAVIGATION DRAWER IF ROLE IS PARENT -->
11d037abe   Neeraj Sharma   commit code
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
        <template v-for="(item, i) in menuParent" v-if="role === 'PARENT'">
          <!-- {{menus}} -->
          <!--group with subitems-->
          <v-list-group v-if="item.items" :key="item.name" :group="item.group" no-action="no-action">
            <v-list-tile slot="activator" ripple="ripple">
              <v-list-tile-action v-if="item.icon">
                <img :src="item.icon" width="22" alt="icons" />
              </v-list-tile-action>
              <v-list-tile-content>
                <v-list-tile-title>{{ item.title }}</v-list-tile-title>
              </v-list-tile-content>
            </v-list-tile>
            <template v-for="(subItem, i) in item.items">
              <!--sub group-->
              <v-list-group
                v-if="subItem.items"
                :key="subItem.name"
                :group="subItem.group"
                sub-group="sub-group"
              >
                <v-list-tile slot="activator" ripple="ripple">
                  <v-list-tile-content>
                    <v-list-tile-title>{{ subItem.title }}</v-list-tile-title>
                  </v-list-tile-content>
                </v-list-tile>
                <v-list-tile
                  v-for="(grand, i) in subItem.children"
                  :key="i"
                  :to="genChildTarget(item, grand)"
                  :href="grand.href"
                  ripple="ripple"
                >
                  <v-list-tile-content>
                    <v-list-tile-title>{{ grand.title }}</v-list-tile-title>
                  </v-list-tile-content>
                </v-list-tile>
              </v-list-group>
              <!--child item-->
              <v-list-tile
                v-else
                :key="i"
                :to="genChildTarget(item, subItem)"
                :href="subItem.href"
                :disabled="subItem.disabled"
                :target="subItem.target"
                ripple="ripple"
              >
                <v-list-tile-action v-if="subItem.action">
                  <img
                    width="30"
                    :src="subItem.action"
                    :class="[subItem.actionClass || 'success--text']"
                  />
                </v-list-tile-action>
                <v-list-tile-content>
                  <v-list-tile-title class="body-2">
                    <span>{{ subItem.title }}</span>
                  </v-list-tile-title>
                </v-list-tile-content>
                <!-- <v-circle class="white--text pa-0 circle-pill" v-if="subItem.badge" color="red" disabled="disabled">{{ subItem.badge }}</v-circle> -->
              </v-list-tile>
            </template>
          </v-list-group>
          <v-subheader v-else-if="item.header" :key="i">{{ item.header }}</v-subheader>
          <v-divider v-else-if="item.divider" :key="i"></v-divider>
          <!--top-level link-->
          <v-list-tile
            v-else
            ripple="ripple"
            :disabled="item.disabled"
            :target="item.target"
            rel="noopener"
            :key="item.name"
            :to="!item.href ? { name: item.name } : null"
            :href="item.href"
          >
            <!-- <a :href="item.path"> -->
            <v-list-tile-action v-if="item.icon">
              <img :src="item.icon" width="22" alt="icons" />
            </v-list-tile-action>
e91641fe5   Amber Dev   solved bugs
576
577
578
579
580
            <v-list-tile-action v-if="item.Vicon">
              <div style="position: relative; top: 3px;">
                <v-icon color="white" size="25">{{item.Vicon}}</v-icon>
              </div>
            </v-list-tile-action>
11d037abe   Neeraj Sharma   commit code
581
582
583
584
585
586
587
588
589
590
591
592
            <v-list-tile-content class="pt-2">
              <v-list-tile-title>{{ item.title }}</v-list-tile-title>
            </v-list-tile-content>
            <!-- <v-circle class="white--text pa-0 chip--x-small" v-if="item.badge" :color="item.color || 'primary'" disabled="disabled">{{ item.badge }}</v-circle> -->
            <v-list-tile-action v-if="item.subAction">
              <!-- <v-icon class="success--text">{{ item.subAction }}</v-icon> -->
              <!-- <img :src="item.icon" width="40" alt="icons" /> -->
            </v-list-tile-action>
            <!-- <v-circle class="caption blue lighten-2 white--text mx-0" v-else-if="item.chip" label="label" small="small">{{ item.chip }}</v-circle> -->
            <!-- </a> -->
          </v-list-tile>
        </template>
a9dc8b176   Neeraj Sharma   remove side bar s...
593
594
      </v-list>
      <!-- </vue-perfect-scrollbar> -->
93a68cfa1   Jatinder Singh   first commit
595
596
597
    </v-navigation-drawer>
  </template>
  <script>
687e0b929   Neeraj Sharma   add user,attenden...
598
599
  import menu from "@/api/menu";
  import VuePerfectScrollbar from "vue-perfect-scrollbar";
93a68cfa1   Jatinder Singh   first commit
600
  export default {
687e0b929   Neeraj Sharma   add user,attenden...
601
    name: "app-drawer",
93a68cfa1   Jatinder Singh   first commit
602
    components: {
bf63831be   Amber Dev   navigation drawer...
603
      VuePerfectScrollbar,
93a68cfa1   Jatinder Singh   first commit
604
605
606
607
    },
    props: {
      expanded: {
        type: Boolean,
bf63831be   Amber Dev   navigation drawer...
608
609
        default: true,
      },
93a68cfa1   Jatinder Singh   first commit
610
611
612
613
    },
    data: () => ({
      mini: false,
      drawer: true,
37150e7c1   Neeraj Sharma   implement school ...
614
      menus: [],
68d742034   Neeraj Sharma   implement new des...
615
      menuSchool: [],
710438de6   Shikha Mishra   added teacher mod...
616
      menuTeacher: [],
acb6c9e2b   Shikha Mishra   issues solved rel...
617
618
      menuAccount: [],
      menuLibrarian: [],
11d037abe   Neeraj Sharma   commit code
619
      menuParent: [],
68d742034   Neeraj Sharma   implement new des...
620
621
      schoolRole: "",
      role: "",
93a68cfa1   Jatinder Singh   first commit
622
      scrollSettings: {
bf63831be   Amber Dev   navigation drawer...
623
624
        maxScrollbarLength: 160,
      },
93a68cfa1   Jatinder Singh   first commit
625
626
    }),
    computed: {
687e0b929   Neeraj Sharma   add user,attenden...
627
      computeGroupActive() {
93a68cfa1   Jatinder Singh   first commit
628
629
        return true;
      },
687e0b929   Neeraj Sharma   add user,attenden...
630
      computeLogo() {
68d742034   Neeraj Sharma   implement new des...
631
        return "/static/icon.png";
55f72b7d7   Neeraj Sharma   add new page are ...
632
      },
93a68cfa1   Jatinder Singh   first commit
633

687e0b929   Neeraj Sharma   add user,attenden...
634
      sideToolbarColor() {
93a68cfa1   Jatinder Singh   first commit
635
        return this.$vuetify.options.extra.sideNav;
bf63831be   Amber Dev   navigation drawer...
636
      },
93a68cfa1   Jatinder Singh   first commit
637
    },
687e0b929   Neeraj Sharma   add user,attenden...
638
    created() {
68d742034   Neeraj Sharma   implement new des...
639
640
641
642
      this.schoolRole = this.$store.state.schoolRole;
      this.role = this.$store.state.role;
      this.menus = menu.adminMenu;
      this.menuSchool = menu.schoolMenu;
710438de6   Shikha Mishra   added teacher mod...
643
      this.menuTeacher = menu.teacherMenu;
acb6c9e2b   Shikha Mishra   issues solved rel...
644
      this.menuAccount = menu.accountMenu;
a9dc8b176   Neeraj Sharma   remove side bar s...
645
      this.menuLibrarian = menu.libraryMenu;
11d037abe   Neeraj Sharma   commit code
646
      this.menuParent = menu.parentMenu;
68d742034   Neeraj Sharma   implement new des...
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
      // console.log("this.$route.name", this.$route.name);
      // if (this.$route.name === "School") {
      //   localStorage.setItem("SchoolName", this.$route.name);
      // }
      // if (this.$route.name === "Dashboard") {
      //   localStorage.setItem("AdminName", this.$route.name);
      // }
      // console.log("SN", localStorage.getItem("SchoolName"));
      // if (localStorage.getItem("SchoolName") === "School") {
      // if (this.$store.state.schoolRole === "SUPERADMIN") {
      //   console.log("rolA", this.$store.state.schoolRole);
      // if (this.$store.state.schoolRole === "SUPERADMIN") {
      // }
      //   console.log("this.menus", this.menus);
      // }
      // // }
      // // console.log("AN", localStorage.getItem("AdminName"));
      // // if (localStorage.getItem("AdminName") === "Dashboard") {
      // if (this.$store.state.role === "ADMIN") {
      //   console.log("role", this.$store.state.role);
      // else if (this.$store.state.role === "ADMIN") {
      // }
      //   // }
      // }
  
      // else if (this.$store.state.role === "LIBRARIAN") {
      //   this.menus = menu.libraryMenu;
      // } else if (this.$store.state.role === "ACCOUNTANT") {
      //   this.menus = menu.accountMenu;
      // }
687e0b929   Neeraj Sharma   add user,attenden...
677
678
      window.getApp.$on("APP_DRAWER_TOGGLED", () => {
        this.drawer = !this.drawer;
93a68cfa1   Jatinder Singh   first commit
679
680
      });
    },
93a68cfa1   Jatinder Singh   first commit
681
    methods: {
687e0b929   Neeraj Sharma   add user,attenden...
682
      genChildTarget(item, subItem) {
93a68cfa1   Jatinder Singh   first commit
683
684
685
        if (subItem.href) return;
        if (subItem.component) {
          return {
bf63831be   Amber Dev   navigation drawer...
686
            name: subItem.component,
93a68cfa1   Jatinder Singh   first commit
687
688
          };
        }
687e0b929   Neeraj Sharma   add user,attenden...
689
        return { name: `${item.group}/${subItem.name}` };
bf63831be   Amber Dev   navigation drawer...
690
      },
dfd943df6   Shikha Mishra   app drawer
691
692
    },
    mounted() {
a9dc8b176   Neeraj Sharma   remove side bar s...
693
      if (this.$store.state.role === "ADMIN") {
dfd943df6   Shikha Mishra   app drawer
694
        this.token = this.$store.state.token;
a9dc8b176   Neeraj Sharma   remove side bar s...
695
696
697
698
699
      }
      if (this.$store.state.schoolRole === "SUPERADMIN") {
        this.token = this.$store.schoolToken;
      }
      if (this.$store.state.role === "TEACHER") {
acb6c9e2b   Shikha Mishra   issues solved rel...
700
        this.token = this.$store.state.token;
a9dc8b176   Neeraj Sharma   remove side bar s...
701
702
      }
      if (this.$store.state.role === "ACCOUNTANT") {
acb6c9e2b   Shikha Mishra   issues solved rel...
703
        this.token = this.$store.state.token;
a9dc8b176   Neeraj Sharma   remove side bar s...
704
705
706
707
      }
      if (this.$store.state.role === "LIBRARIAN") {
        this.token = this.$store.state.token;
      }
11d037abe   Neeraj Sharma   commit code
708
709
710
      if (this.$store.state.role === "PARENT") {
        this.token = this.$store.state.token;
      }
bf63831be   Amber Dev   navigation drawer...
711
    },
93a68cfa1   Jatinder Singh   first commit
712
713
714
715
716
717
  };
  </script>
  
  
  <style lang="stylus">
  // @import '../../node_modules/vuetify/src/stylus/settings/_elevations.styl';
687e0b929   Neeraj Sharma   add user,attenden...
718
719
  #appDrawer {
    overflow: hidden;
93a68cfa1   Jatinder Singh   first commit
720

687e0b929   Neeraj Sharma   add user,attenden...
721
722
723
724
725
    .drawer-menu--scroll {
      height: calc(100vh - 48px);
      overflow: auto;
    }
  }
37150e7c1   Neeraj Sharma   implement school ...
726

687e0b929   Neeraj Sharma   add user,attenden...
727
  .v-list__group__items--no-action .v-list__tile {
37150e7c1   Neeraj Sharma   implement school ...
728
    padding-left: 72px !important;
687e0b929   Neeraj Sharma   add user,attenden...
729
  }
37150e7c1   Neeraj Sharma   implement school ...
730

03dcbf0c1   Neeraj Sharma   fix all api and r...
731
  .v-list--dense .v-list__tile:not(.v-list__tile--avatar) {
68d742034   Neeraj Sharma   implement new des...
732
    height: 54px;
687e0b929   Neeraj Sharma   add user,attenden...
733
    font-size: 17px;
03dcbf0c1   Neeraj Sharma   fix all api and r...
734
  }
687e0b929   Neeraj Sharma   add user,attenden...
735

03dcbf0c1   Neeraj Sharma   fix all api and r...
736
  .v-list__tile__action {
687e0b929   Neeraj Sharma   add user,attenden...
737
    min-width: 36px;
03dcbf0c1   Neeraj Sharma   fix all api and r...
738
  }
687e0b929   Neeraj Sharma   add user,attenden...
739

68d742034   Neeraj Sharma   implement new des...
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
  // .theme--light .v-icon, .application .theme--light.v-icon {
  // color: #f1f1f1;
  // }
  .ps>.ps__scrollbar-y-rail>.ps__scrollbar-y {
    background-color: #f5f5f5;
    background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.44, rgb(122, 153, 217)), color-stop(0.72, rgb(73, 125, 189)), color-stop(0.86, rgb(28, 58, 148)));
    width: 8px !important;
  }
  
  .ps>.ps__scrollbar-y-rail {
    width: 0px !important;
  }
  
  .ps:hover > .ps__scrollbar-y-rail:hover {
    background-color: #5f2171 !important;
    opacity: 0.9;
  }
  
  .ps > .ps__scrollbar-y-rail:hover > .ps__scrollbar-y {
    width: 8px !important;
    background-color: #f5f5f5;
    background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.44, rgb(122, 153, 217)), color-stop(0.72, rgb(73, 125, 189)), color-stop(0.86, rgb(28, 58, 148)));
  }
  
  .ps:hover > .ps__scrollbar-y-rail:hover > .ps__scrollbar-y {
    // background-color: #5f2171 !important;
    width: 8px !important;
    background-color: #f5f5f5;
    background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.44, rgb(122, 153, 217)), color-stop(0.72, rgb(73, 125, 189)), color-stop(0.86, rgb(28, 58, 148)));
  }
  
  .v-list__tile--active {
    color: #71d9ea !important;
  }
  
  .my-1 {
dfd943df6   Shikha Mishra   app drawer
776
    text-align: left !important;
68d742034   Neeraj Sharma   implement new des...
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
  }
  
  .title {
    line-height: 2 !important;
  }
  
  // .v-list__tile--hover {
  // color: white !important;
  // background: red !important;
  // }
  .v-list .v-list__tile--link:hover, .v-list .v-list__tile--highlighted, .v-list .v-list__group__header:hover, .v-list .v-list__group--active:before, .v-list .v-list__group--active:after {
    background: #7f62f8 !important;
    color: #71d9ea !important;
    box-shadow: 0 3px 3px -2px rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.14), 0 1px 8px 0 rgba(0, 0, 0, 0.12) !important;
    // border-radius: 12px !important;
03dcbf0c1   Neeraj Sharma   fix all api and r...
792
  }
687e0b929   Neeraj Sharma   add user,attenden...
793
794
795
  
  @media screen and (max-width: 420px) {
    .v-list--dense .v-list__tile:not(.v-list__tile--avatar) {
03dcbf0c1   Neeraj Sharma   fix all api and r...
796
      font-size: 14px;
687e0b929   Neeraj Sharma   add user,attenden...
797
798
799
800
801
802
    }
  
    .imgLogo {
      height: 32px;
      width: 120px;
    }
03dcbf0c1   Neeraj Sharma   fix all api and r...
803
  }
93a68cfa1   Jatinder Singh   first commit
804
  </style>
d75967ec2   Neeraj Sharma   implemented chang...
805
806
807
  
  
  <style scoped>
687e0b929   Neeraj Sharma   add user,attenden...
808
809
810
  .theme--light .v-icon,
  .application .theme--light.v-icon {
    color: #39b982;
d75967ec2   Neeraj Sharma   implemented chang...
811
  }
68d742034   Neeraj Sharma   implement new des...
812
813
  .side-bar-color {
    background: #827bfa !important;
a76a6f135   Neeraj Sharma   implelement task
814
    /* border-top-right-radius: 74px !important; */
68d742034   Neeraj Sharma   implement new des...
815
  }
a9dc8b176   Neeraj Sharma   remove side bar s...
816
  .v-navigation-drawer--fixed {
bf63831be   Amber Dev   navigation drawer...
817
    /* position: absolute !important; */
a76a6f135   Neeraj Sharma   implelement task
818

a6a5b3fcd   Amber Dev   screen height
819
    /* min-height: calc(2000px - 64px - 50px - 81px) !important; */
a76a6f135   Neeraj Sharma   implelement task
820
    /* max-height: inherit !important; */
a9dc8b176   Neeraj Sharma   remove side bar s...
821
  }
68d742034   Neeraj Sharma   implement new des...
822
823
824
  .hover:hover {
    color: red !important;
    background: red !important;
687e0b929   Neeraj Sharma   add user,attenden...
825
  }
d75967ec2   Neeraj Sharma   implemented chang...
826
  </style>
68d742034   Neeraj Sharma   implement new des...
827