Browse Source

Roles Final

master
30117125 4 years ago
parent
commit
5c7b45799c

+ 34
- 22
src/components/financial/payments.vue View File

1
 <template>
1
 <template>
2
-  <!-- eslint-disable max-len -->
3
   <main id="main" style="margin-top:-20px;padding-bottom:300px">
2
   <main id="main" style="margin-top:-20px;padding-bottom:300px">
4
     <div class="container">
3
     <div class="container">
5
-      <div class="container">
6
-        <br />
7
-        <br />
8
-        <div class="row">
9
-          <div class="col-md-12 col-lg-8">
10
-            <div class="section-header">
11
-              <h2>Payments</h2>
12
-            </div>
4
+      <div class="row">
5
+        <div class="col-md-12 col-lg-8">
6
+          <div class="section-header">
7
+            <h2>Payments</h2>
13
           </div>
8
           </div>
14
         </div>
9
         </div>
15
       </div>
10
       </div>
11
+      <div v-if="checkAccess" class="row">
12
+        <div class="col">
13
+          <listView
14
+            :items="payments"
15
+            :showNew="false"
16
+            :editable="true"
17
+            :deleteable="true"
18
+            @onEdit="Edit"
19
+            @onDelete="Delete"
20
+          />
21
+        </div>
22
+      </div>
23
+      <div v-else class="row">
24
+        <div class="col">
25
+          <alert :text="'You don\'t have permission to view this page'" :type="'ERROR'" />
26
+        </div>
27
+      </div>
16
     </div>
28
     </div>
17
-    <div class="container">
18
-      <listView
19
-        :items="payments"
20
-        :showNew="false"
21
-        :editable="true"
22
-        :deleteable="true"
23
-        @onEdit="Edit"
24
-        @onDelete="Delete"
25
-      />
26
-    </div>
27
-    <br />
28
   </main>
29
   </main>
29
 </template>
30
 </template>
30
 
31
 
31
 <script>
32
 <script>
33
+/* eslint-disable */
32
 import { mapState, mapActions } from "vuex";
34
 import { mapState, mapActions } from "vuex";
33
-import listView from "../shared/listView.vue";
35
+
34
 import Log from "../../assets/Log";
36
 import Log from "../../assets/Log";
37
+import alert from "../shared/alert";
38
+import listView from "../shared/listView.vue";
35
 
39
 
36
 export default {
40
 export default {
37
   name: "PaymentList",
41
   name: "PaymentList",
38
   components: {
42
   components: {
39
-    listView
43
+    listView,
44
+    alert
40
   },
45
   },
41
   data() {
46
   data() {
42
     return {
47
     return {
54
     UserChanged() {
59
     UserChanged() {
55
       this.getProperties(Object.assign(this.user.id));
60
       this.getProperties(Object.assign(this.user.id));
56
       return this.user;
61
       return this.user;
62
+    },
63
+    checkAccess() {
64
+      if (Log.getUser().role === "Super Admin") {
65
+        return true;
66
+      } else {
67
+        return false;
68
+      }
57
     }
69
     }
58
   }
70
   }
59
 };
71
 };

+ 62
- 38
src/components/marketing/landingPage.vue View File

1
 <template>
1
 <template>
2
-  <div>
2
+  <main id="main" style="margin-top:200px; padding-bottom:50px">
3
     <div class="container">
3
     <div class="container">
4
-      <div class="container">
5
-        <div class="row">
6
-          <div class="col-md-12 col-lg-8">
7
-            <div class="title-box-d">
8
-              <br />
9
-              <h1 class="title-d" style="text-align:left; font-size: 250%">Landing Page</h1>
10
-            </div>
4
+      <div class="row">
5
+        <div class="col">
6
+          <div class="section-header">
7
+            <h2>Landing Page</h2>
11
           </div>
8
           </div>
12
         </div>
9
         </div>
13
       </div>
10
       </div>
11
+    </div>
12
+
13
+    <div v-if="checkAccess" class="container">
14
       <div class="container col-md-12" style="text-align:left">
14
       <div class="container col-md-12" style="text-align:left">
15
         <div class="form-goup row">
15
         <div class="form-goup row">
16
           <div class="col-md-4">
16
           <div class="col-md-4">
17
-            <label>Campaign Name</label>
18
-            <input v-if="isNew" class="form-control" type="text" v-model="campaign.name" />
19
-            <FieldEditor v-else :type="'text'" v-model="campaign.name" :mayEdit="true" />
17
+            <float-label>
18
+              <input
19
+                class="form-control uniInput"
20
+                type="text"
21
+                v-model="campaign.name"
22
+                placeholder="CAMPAIGN NAME"
23
+              />
24
+            </float-label>
20
           </div>
25
           </div>
21
           <div class="col-md-4">
26
           <div class="col-md-4">
22
-            <label>Start Date</label>
23
-            <input v-if="isNew" class="form-control" type="date" v-model="campaign.startDate" />
24
-            <FieldEditor v-else :type="'date'" v-model="campaign.startDate" :mayEdit="true" />
27
+            <float-label fixed label="START DATE">
28
+              <input class="form-control uniInput" type="date" v-model="campaign.startDate" />
29
+            </float-label>
25
           </div>
30
           </div>
26
           <div class="col-md-4">
31
           <div class="col-md-4">
27
-            <label>End Date</label>
28
-            <input v-if="isNew" class="form-control" type="date" v-model="campaign.endDate" />
29
-            <FieldEditor v-else :type="'date'" v-model="campaign.endDate" :mayEdit="true" />
32
+            <float-label fixed label="END DATE">
33
+              <input class="form-control uniInput" type="date" v-model="campaign.endDate" />
34
+            </float-label>
30
           </div>
35
           </div>
31
         </div>
36
         </div>
32
-        <div class="form-goup row">
37
+        <div class="row mt-4">
33
           <div class="col-md-4">
38
           <div class="col-md-4">
34
-            <label>Subject</label>
35
-            <input v-if="isNew" class="form-control" type="text" v-model="campaign.subject" />
36
-            <FieldEditor v-else :type="'text'" v-model="campaign.subject" :mayEdit="true" />
39
+            <float-label>
40
+              <input
41
+                class="form-control uniInput"
42
+                type="text"
43
+                v-model="campaign.subject"
44
+                placeholder="SUBJECT"
45
+              />
46
+            </float-label>
37
           </div>
47
           </div>
38
           <div class="col-md-4">
48
           <div class="col-md-4">
39
-            <label>Number of items per row</label>
40
-            <input v-if="isNew" class="form-control" type="number" v-model="campaign.itemsPerRow" />
41
-            <FieldEditor v-else :type="'number'" v-model="campaign.itemsPerRow" :mayEdit="true" />
49
+            <float-label>
50
+              <input
51
+                class="form-control uniInput"
52
+                type="number"
53
+                v-model="campaign.itemsPerRow"
54
+                placeholder="NUMBER OF ITEMS PER ROW"
55
+              />
56
+            </float-label>
42
           </div>
57
           </div>
43
         </div>
58
         </div>
44
         <br />
59
         <br />
265
         <br />
280
         <br />
266
         <br />
281
         <br />
267
         <div class="form-group row">
282
         <div class="form-group row">
268
-          <button
269
-            type="button"
270
-            @click="SaveData()"
271
-            class="btn btn-primary myBackground"
272
-            style="width: 85px; height:40px;"
273
-          >
283
+          <button type="button" @click="SaveData()" class="btn-solid-blue">
274
             Save
284
             Save
275
           </button>
285
           </button>
276
-          <button
277
-            type="button"
278
-            @click="Close()"
279
-            class="btn btn-primary myBackground"
280
-            style="width: 85px; height:40px;"
281
-          >
286
+          <button type="button" @click="Close()" class="btn-solid-blue">
282
             Close
287
             Close
283
           </button>
288
           </button>
284
         </div>
289
         </div>
285
       </div>
290
       </div>
286
       <div v-if="wait" id="preloader"></div>
291
       <div v-if="wait" id="preloader"></div>
287
     </div>
292
     </div>
288
-  </div>
293
+    <div v-else class="container">
294
+      <div class="row">
295
+        <div class="col">
296
+          <alert :text="'You don\'t have permission to view this page'" :type="'ERROR'" />
297
+        </div>
298
+      </div>
299
+    </div>
300
+  </main>
289
 </template>
301
 </template>
290
 
302
 
291
 <script>
303
 <script>
304
+/* eslint-disable */
292
 import { VueEditor } from "vue2-editor";
305
 import { VueEditor } from "vue2-editor";
293
 import { mapState, mapActions } from "vuex";
306
 import { mapState, mapActions } from "vuex";
307
+
308
+import Log from "../../assets/Log";
309
+import alert from "../shared/alert";
294
 import FieldEditor from "../../components/shared/fieldEditor";
310
 import FieldEditor from "../../components/shared/fieldEditor";
295
 import ListView from "../shared/listView.vue";
311
 import ListView from "../shared/listView.vue";
296
 import Search from "../admin/misc/carouselSearch.vue";
312
 import Search from "../admin/misc/carouselSearch.vue";
305
     Search,
321
     Search,
306
     LandingPageItems,
322
     LandingPageItems,
307
     ListView,
323
     ListView,
308
-    WeekAdd
324
+    WeekAdd,
325
+    alert
309
   },
326
   },
310
   data() {
327
   data() {
311
     return {
328
     return {
434
   },
451
   },
435
   computed: {
452
   computed: {
436
     ...mapState("campaign", ["campaign", "campaignPlaceHolders", "campaignItems"]),
453
     ...mapState("campaign", ["campaign", "campaignPlaceHolders", "campaignItems"]),
454
+    checkAccess() {
455
+      if (Log.getUser().role === "Super Admin") {
456
+        return true;
457
+      } else {
458
+        return false;
459
+      }
460
+    },
437
     PlaceHolders() {
461
     PlaceHolders() {
438
       if (this.campaign && this.campaign.placeHolders) {
462
       if (this.campaign && this.campaign.placeHolders) {
439
         return this.campaign.placeHolders;
463
         return this.campaign.placeHolders;

+ 41
- 27
src/components/marketing/landingPages.vue View File

2
   <!-- eslint-disable max-len -->
2
   <!-- eslint-disable max-len -->
3
   <main id="main" style="margin-top:-20px; padding-bottom:50px">
3
   <main id="main" style="margin-top:-20px; padding-bottom:50px">
4
     <div class="container">
4
     <div class="container">
5
-      <div class="container">
6
-        <br />
7
-        <br />
8
-        <div class="row">
9
-          <div class="col-md-12 col-lg-8">
10
-            <div class="section-header">
11
-              <h2>Landing Pages</h2>
12
-            </div>
5
+      <div class="row">
6
+        <div class="col-md-12 col-lg-8">
7
+          <div class="section-header">
8
+            <h2>Landing Pages</h2>
13
           </div>
9
           </div>
14
         </div>
10
         </div>
15
       </div>
11
       </div>
12
+      <div v-if="checkAccess" class="row">
13
+        <div class="col">
14
+          <listView
15
+            @onNew="New"
16
+            @onEdit="Edit"
17
+            :items="campaigns"
18
+            :editable="true"
19
+            :deleteable="true"
20
+            :displayColumns="columns"
21
+            :displayFormats="formats"
22
+            :showCustomAction="true"
23
+            :CustomActionHeading="'Client View'"
24
+            :sortKey="'startDate'"
25
+            @onCustomClick="ClientVue"
26
+            @onDelete="Delete"
27
+          />
28
+        </div>
29
+      </div>
30
+      <div v-else class="row">
31
+        <div class="col">
32
+          <alert :text="'You don\'t have permission to view this page'" :type="'ERROR'" />
33
+        </div>
34
+      </div>
16
     </div>
35
     </div>
17
-    <div class="container">
18
-      <listView
19
-        @onNew="New"
20
-        @onEdit="Edit"
21
-        :items="campaigns"
22
-        :editable="true"
23
-        :deleteable="true"
24
-        :displayColumns="columns"
25
-        :displayFormats="formats"
26
-        :showCustomAction="true"
27
-        :CustomActionHeading="'Client View'"
28
-        :sortKey="'startDate'"
29
-        @onCustomClick="ClientVue"
30
-        @onDelete="Delete"
31
-      />
32
-    </div>
33
-    <br />
34
   </main>
36
   </main>
35
 </template>
37
 </template>
36
 
38
 
37
 <script>
39
 <script>
40
+/* eslint-disable */
38
 import { mapState, mapActions } from "vuex";
41
 import { mapState, mapActions } from "vuex";
42
+
43
+import Log from "../../assets/Log";
44
+import alert from "../shared/alert";
39
 import listView from "../shared/listView.vue";
45
 import listView from "../shared/listView.vue";
40
 
46
 
41
 export default {
47
 export default {
42
   name: "LandingPages",
48
   name: "LandingPages",
43
   components: {
49
   components: {
44
-    listView
50
+    listView,
51
+    alert
45
   },
52
   },
46
   data() {
53
   data() {
47
     return {
54
     return {
72
     this.$emit("setLandingPage", false);
79
     this.$emit("setLandingPage", false);
73
   },
80
   },
74
   computed: {
81
   computed: {
75
-    ...mapState("campaign", ["campaigns"])
82
+    ...mapState("campaign", ["campaigns"]),
83
+    checkAccess() {
84
+      if (Log.getUser().role === "Super Admin") {
85
+        return true;
86
+      } else {
87
+        return false;
88
+      }
89
+    }
76
     // UserChanged() {
90
     // UserChanged() {
77
     //   this.getProperties(Object.assign(this.user.id));
91
     //   this.getProperties(Object.assign(this.user.id));
78
     //   return this.user;
92
     //   return this.user;

Loading…
Cancel
Save