30117125 преди 4 години
родител
ревизия
5c7b45799c
променени са 3 файла, в които са добавени 137 реда и са изтрити 87 реда
  1. 34
    22
      src/components/financial/payments.vue
  2. 62
    38
      src/components/marketing/landingPage.vue
  3. 41
    27
      src/components/marketing/landingPages.vue

+ 34
- 22
src/components/financial/payments.vue Целия файл

@@ -1,42 +1,47 @@
1 1
 <template>
2
-  <!-- eslint-disable max-len -->
3 2
   <main id="main" style="margin-top:-20px;padding-bottom:300px">
4 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 8
           </div>
14 9
         </div>
15 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 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 29
   </main>
29 30
 </template>
30 31
 
31 32
 <script>
33
+/* eslint-disable */
32 34
 import { mapState, mapActions } from "vuex";
33
-import listView from "../shared/listView.vue";
35
+
34 36
 import Log from "../../assets/Log";
37
+import alert from "../shared/alert";
38
+import listView from "../shared/listView.vue";
35 39
 
36 40
 export default {
37 41
   name: "PaymentList",
38 42
   components: {
39
-    listView
43
+    listView,
44
+    alert
40 45
   },
41 46
   data() {
42 47
     return {
@@ -54,6 +59,13 @@ export default {
54 59
     UserChanged() {
55 60
       this.getProperties(Object.assign(this.user.id));
56 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 Целия файл

@@ -1,44 +1,59 @@
1 1
 <template>
2
-  <div>
2
+  <main id="main" style="margin-top:200px; padding-bottom:50px">
3 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 8
           </div>
12 9
         </div>
13 10
       </div>
11
+    </div>
12
+
13
+    <div v-if="checkAccess" class="container">
14 14
       <div class="container col-md-12" style="text-align:left">
15 15
         <div class="form-goup row">
16 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 25
           </div>
21 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 30
           </div>
26 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 35
           </div>
31 36
         </div>
32
-        <div class="form-goup row">
37
+        <div class="row mt-4">
33 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 47
           </div>
38 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 57
           </div>
43 58
         </div>
44 59
         <br />
@@ -265,32 +280,33 @@
265 280
         <br />
266 281
         <br />
267 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 284
             Save
275 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 287
             Close
283 288
           </button>
284 289
         </div>
285 290
       </div>
286 291
       <div v-if="wait" id="preloader"></div>
287 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 301
 </template>
290 302
 
291 303
 <script>
304
+/* eslint-disable */
292 305
 import { VueEditor } from "vue2-editor";
293 306
 import { mapState, mapActions } from "vuex";
307
+
308
+import Log from "../../assets/Log";
309
+import alert from "../shared/alert";
294 310
 import FieldEditor from "../../components/shared/fieldEditor";
295 311
 import ListView from "../shared/listView.vue";
296 312
 import Search from "../admin/misc/carouselSearch.vue";
@@ -305,7 +321,8 @@ export default {
305 321
     Search,
306 322
     LandingPageItems,
307 323
     ListView,
308
-    WeekAdd
324
+    WeekAdd,
325
+    alert
309 326
   },
310 327
   data() {
311 328
     return {
@@ -434,6 +451,13 @@ export default {
434 451
   },
435 452
   computed: {
436 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 461
     PlaceHolders() {
438 462
       if (this.campaign && this.campaign.placeHolders) {
439 463
         return this.campaign.placeHolders;

+ 41
- 27
src/components/marketing/landingPages.vue Целия файл

@@ -2,46 +2,53 @@
2 2
   <!-- eslint-disable max-len -->
3 3
   <main id="main" style="margin-top:-20px; padding-bottom:50px">
4 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 9
           </div>
14 10
         </div>
15 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 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 36
   </main>
35 37
 </template>
36 38
 
37 39
 <script>
40
+/* eslint-disable */
38 41
 import { mapState, mapActions } from "vuex";
42
+
43
+import Log from "../../assets/Log";
44
+import alert from "../shared/alert";
39 45
 import listView from "../shared/listView.vue";
40 46
 
41 47
 export default {
42 48
   name: "LandingPages",
43 49
   components: {
44
-    listView
50
+    listView,
51
+    alert
45 52
   },
46 53
   data() {
47 54
     return {
@@ -72,7 +79,14 @@ export default {
72 79
     this.$emit("setLandingPage", false);
73 80
   },
74 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 90
     // UserChanged() {
77 91
     //   this.getProperties(Object.assign(this.user.id));
78 92
     //   return this.user;

Loading…
Отказ
Запис