Blame view

src/components/Profile.vue 15.8 KB
f06677bfc   Digvijay Singh   profile screen added
1
2
  <template>
    <main class="landing-page">
298fff252   Digvijay Singh   new design added
3
4
5
      <!-- profile -->
      <div class="popup-wrp" style="display: none">
        <div class="overlay"></div>
921970bb2   Gurvinder Singh   new files
6
        <div class="popup-set" id="add-profile" style="display:none;">
298fff252   Digvijay Singh   new design added
7
          <div class="popup-header">
24ced0ae7   Gurvinder Singh   new changes files
8
9
10
11
            <div class="user-photo common_color"><img src="../assets/images/m-user.svg" />
            
            </div><!-- header user -->
          
298fff252   Digvijay Singh   new design added
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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
            <ul>
              <li>
                <a href="#"
                  ><img src="../assets/images/replace.svg" /><span
                    >Replace Avatar</span
                  ></a
                >
              </li>
              <li>
                <a href="#"
                  ><img src="../assets/images/randomise.svg" /><span
                    >Randomise Avatar</span
                  ></a
                >
              </li>
            </ul>
          </div>
          <!-- header -->
          <div class="popup-body">
            <form class="popup-forms">
              <div class="row">
                <div class="col-sm-6 col-md-6 col-lg-6 col-xl-6">
                  <div class="form-group floating-label">
                    <input
                      type="text"
                      class="form-control"
                       v-model="userData.name" 
                      placeholder=" "
                      id="fname"
                    />
                    <label for="fname">First Name</label>
                  </div>
                </div>
                <!-- input -->
                <div class="col-sm-6 col-md-6 col-lg-6 col-xl-6">
                  <div class="form-group floating-label">
                    <input
                      type="text"
                      class="form-control"
                      value=""
                      placeholder=" "
                      id="lname"
                    />
                    <label for="lname" class="lname">Last Name</label>
                  </div>
                </div>
                <!-- input -->
                <div class="col-sm-5 col-md-5 col-lg-5 col-xl-5">
                  <div class="form-group floating-label">
                    <input
                      type="text"
                      class="form-control"
                      value=""
                      v-model="userData.designation" 
                      placeholder=" "
                      id="designation"
                    />
                    <label for="designation">Designation</label>
                  </div>
                </div>
                <!-- input -->
                <div class="col-sm-7 col-md-7 col-lg-7 col-xl-7">
                  <div class="form-group floating-label">
                    <input
                      type="text"
                      class="form-control"
                      v-model="userData.organisation" 
                      id="company"
                    />
                    <label for="company">Company</label>
                  </div>
                </div>
                <!-- input -->
                <div class="col-sm-12 col-md-12 col-lg-12 col-xl-12">
                  <div class="form-group floating-label">
                    <textarea
                      type="text"
                      class="form-control"
                      value=""
                      v-model="userData.bio" 
                      id="yourself"
                    ></textarea>
                    <label for="yourself"
                      >Tell others a little about yourself</label
                    >
                  </div>
                </div>
                <!-- input -->
                <div class="col-sm-12 col-md-12 col-lg-12 col-xl-12">
                  <p class="things">Three things that you talk more about</p>
f06677bfc   Digvijay Singh   profile screen added
102

298fff252   Digvijay Singh   new design added
103
                  <ul class="interests">
24ced0ae7   Gurvinder Singh   new changes files
104
105
106
107
108
                    <li><span>Cats</span>
                      <a href="#" class="cat-minus"
                        ><img src="../assets/images/minus.svg"
                      /></a>
                    </li>
298fff252   Digvijay Singh   new design added
109
110
111
112
113
114
115
116
117
118
                    <li>
                      <input class="" placeholder="Add interest" />
                      <a href="#"
                        ><img src="../assets/images/plus-circle.svg"
                      /></a>
                    </li>
                  </ul>
                </div>
                <div class="col-sm-12 col-md-12 col-lg-12 col-xl-12">
                  <p class="things">Choose Background color</p>
f06677bfc   Digvijay Singh   profile screen added
119

298fff252   Digvijay Singh   new design added
120
121
122
123
124
125
126
127
128
129
130
131
                  <ul class="colors">
                    <li><a href="#" class="silver"></a></li>
                    <li><a href="#" class="milk-punch active"></a></li>
                    <li><a href="#" class="french-pass"></a></li>
                    <li><a href="#" class="cyan-french-pass"></a></li>
                    <li><a href="#" class="cosmos"></a></li>
                    <li><a href="#" class="cape-Honey"></a></li>
                    <li><a href="#" class="snuff"></a></li>
                    <li><a href="#" class="catskillWhite"></a></li>
                    <li><a href="#" class="white"></a></li>
                  </ul>
                </div>
24ced0ae7   Gurvinder Singh   new changes files
132
                      <div class="col-lg-12 mt-50">
921970bb2   Gurvinder Singh   new files
133
134
135
136
137
138
139
140
141
142
143
144
          <p class="notifications">Recieve notifications when you recieve a comment/ Upvote 
       
  </p>
       <div class="switch-bt-wrp">
            <label class="switch-btn">
    <input type="checkbox" class="toggle-btn">
    <span class="rounded-toggle"></span>
  </label> <span class="onoff">on/off</span>
  </div>
        </div>
        <div class="col-lg-12">
          <p class="add-socail-ch">Add your social Channels <span></span></p>
298fff252   Digvijay Singh   new design added
145
        </div>
921970bb2   Gurvinder Singh   new files
146
147
148
149
150
151
152
153
154
155
156
157
158
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
    <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
      <div class="form-group floating-label">
      
      <select class="form-group">
        <option> Linkdin</option>
      </select>
      <span class="select-arrow"><img src="../assets/images/chevron-down.svg" /></span>
      </div>
    </div><!-- input -->
    <div class="col-sm-8 col-md-8 col-lg-8 col-xl-8">
      <div class="form-group floating-label">
       
        <input type="text" class="form-control" value="linkedin.com/vamsikrishna" placeholder=" " id="">
        
      </div>
    </div><!-- input -->
    <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
      <div class="form-group floating-label">
       
        <select class="form-group">
          <option>Medium</option>
        </select>
        <span class="select-arrow"><img src="../assets/images/chevron-down.svg" /></span>
      </div>
    </div><!-- input -->
    <div class="col-sm-8 col-md-8 col-lg-8 col-xl-8">
      <div class="form-group floating-label">
       
        <input type="text" class="form-control" value="" placeholder="Paste your profile URL here" id="">
      </div>
    </div><!-- input -->
    <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
      <div class="form-group floating-label">
       
        <select class="form-group">
          <option>Add another</option>
        </select>
        <span class="select-arrow"><img src="../assets/images/chevron-down.svg" /></span>
      </div>
    </div><!-- input -->
24ced0ae7   Gurvinder Singh   new changes files
186
187
188
189
190
191
              </div>
              <a href="javascript:void(0);" @click="closeDialog" class="next-bt">Save</a>
            </form>
          </div>
          <div class="clearfix"></div>
        </div> <!-- add profile -->
921970bb2   Gurvinder Singh   new files
192

298fff252   Digvijay Singh   new design added
193
194
195
      </div>
      <!-- profile -->
      <div class="container-fluid inner-wrp">
f06677bfc   Digvijay Singh   profile screen added
196
        <nav class="navbar navbar-expand-sm spotLight-nav">
298fff252   Digvijay Singh   new design added
197
198
199
200
201
202
203
204
205
206
207
208
          <a class="navbar-brand" href="#"
            ><img src="../assets/images/logo.png"
          /></a>
          <button
            class="navbar-toggler"
            type="button"
            data-toggle="collapse"
            data-target="#navbarsExample03"
            aria-controls="navbarsExample03"
            aria-expanded="false"
            aria-label="Toggle navigation"
          >
f06677bfc   Digvijay Singh   profile screen added
209
210
211
212
            <span class="navbar-toggler-icon"></span>
            <span class="navbar-toggler-icon"></span>
            <span class="navbar-toggler-icon"></span>
          </button>
298fff252   Digvijay Singh   new design added
213

f06677bfc   Digvijay Singh   profile screen added
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
          <div class="collapse navbar-collapse" id="navbarsExample03">
            <ul class="navbar-nav mr-auto">
              <li class="nav-item active">
                <a class="nav-link" href="#">About</a>
              </li>
              <li class="nav-item">
                <a class="nav-link" href="#">Masterclass</a>
              </li>
              <li class="nav-item">
                <a class="nav-link" href="#">Stories</a>
              </li>
              <li class="nav-item">
                <a class="nav-link" href="#">Library</a>
              </li>
            </ul>
          </div>
24ced0ae7   Gurvinder Singh   new changes files
230
231
232
233
234
235
236
237
          <div class="user-profile-photo common_color">
            <a href="javascript:void(0);" @click="userprofileshowDialog"><img src="../assets/images/m-user.svg" /></a>
            <div class="sub-menu-user" id="userprofileshow" style="display:none">
              <ul>
                <li><a href="#">Edit Profile</a></li>
                 <li><a href="#">Log Out</a></li>
              </ul>
            </div>
f06677bfc   Digvijay Singh   profile screen added
238
          </div>
298fff252   Digvijay Singh   new design added
239
240
241
242
        </nav>
        <!-- menu wrapper -->
        <div class="row profile-tab-spc-top">
          <div class="col-sm-8 col-md-12 col-lg-8 col-xl-8">
24ced0ae7   Gurvinder Singh   new changes files
243
244
            <div class="inner-profile-ps common_color"> <img src="../assets/images/m-user.svg" class="" /></div><!-- user profile -->
           
298fff252   Digvijay Singh   new design added
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
            <div class="user-profile">
              <h1>{{userData.name}} <a href="#" class="tags">{{userData.role}}</a></h1>
              <ul class="joined-info">
                <li>
                  <a href="#">Add your work</a>
                  <img src="../assets/images/u-info-icon.png" /> <span></span>
                </li>
                <li><a href="#">34772 Karma</a> <span></span></li>
                <li><a href="#">Joined on {{moment(userData.createdAt).format('MMM YYYY')}}</a></li>
              </ul>
              <p>Tell others a little about yourself</p>
            </div>
          </div>
          <!-- user profile -->
          <div class="col-sm-4 col-md-12 col-lg-4 col-xl-4">
            <div class="list-style-group">
              <p>Awards</p>
              <ul class="list-style">
                <li>
                  <a href="#"><img src="../assets/images/icon-1.png" /></a>
                </li>
              </ul>
            </div>
            <!-- list style -->
          </div>
f06677bfc   Digvijay Singh   profile screen added
270
        </div>
298fff252   Digvijay Singh   new design added
271
272
273
274
        <div class="clearfix"></div>
        <div class="row top-brd profile-tab-spc-top">
          <div class="col-sm-8 col-md-8 col-lg-8 col-xl-8">
            <ul class="profile-tab">
24ced0ae7   Gurvinder Singh   new changes files
275
276
              <li class="active c-0"><a href="javascript:void(0);" @click="caseDialog">Case-studies(0)</a></li>
              <li class="rp-all"><a href="javascript:void(0);" @click="repliesDialog">Comments/Replies(3)</a></li>
298fff252   Digvijay Singh   new design added
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
            </ul>
          </div>
          <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
            <ul class="social-connects">
              <li><span>Follow</span></li>
              <li>
                <a href="#" class="active"
                  ><img src="../assets/images/plus.png"
                /></a>
                <span class="connect-social-channel"
                  >Connect your social channels</span
                >
              </li>
            </ul>
          </div>
        </div>
        <!-- tab style -->
        <div class="profile-data-wrp">
24ced0ae7   Gurvinder Singh   new changes files
295
          <div class="container-fluid data-wrp" id="case-study-0">
298fff252   Digvijay Singh   new design added
296
297
298
            <div class="row">
              <div class="col-lg-12">
                <div class="profile-buttons">
921970bb2   Gurvinder Singh   new files
299
                  <a href="javascript:void(0);"
298fff252   Digvijay Singh   new design added
300
                    class="profile-sm-bt center-and-spc bt-active"
921970bb2   Gurvinder Singh   new files
301
                    @click="addProfileDialog"
298fff252   Digvijay Singh   new design added
302
303
304
305
306
307
308
309
310
                    >Update Profile</a
                  >
                  <a href="#" class="profile-md-bt center-and-spc"
                    >Explore Case-studies</a
                  >
                  <a href="#" class="profile-lg-bt">Publish Your Case Study</a>
                </div>
              </div>
            </div>
24ced0ae7   Gurvinder Singh   new changes files
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
          </div><!-- case study 0 -->
          <div class="container-fluid data-wrp" id="all-replies" style="display:none;">
  <div class="row">
    <div class="replies col-md-12">
  <div class="replies-wrp">
    <h1>PhonePe vs  GooglePay <span>Critique</span></h1>
    <ul class="joined-info">
      <li><a href="#">37D</a>  <span></span></li>
      <li>  <img src="../assets/images/heart.png"> </li>
      <li>  <a href="#"> 4</a> </li>
      <li class="comment-spc">  <img src="../assets/images/comment.svg"> </li>
      <li>  <a href="#"> 6</a> </li>
    </ul>
    <p>I wonder what the difference between “<strong> Assistant</strong>” and “<strong>Pickup and Drop</strong>” are. If they are the same, there are two “call to actions” for the same workflow</p>
  </div><!-- replies wrapper -->
  <div class="replies-wrp">
    <h1>PhonePe vs  GooglePay <span>Critique</span></h1>
    <ul class="joined-info">
      <li><a href="#">37D</a>  <span></span></li>
      <li>  <img src="../assets/images/heart.png"> </li>
      <li>  <a href="#"> 4</a> </li>
      <li class="comment-spc">  <img src="../assets/images/comment.svg"> </li>
      <li>  <a href="#"> 6</a> </li>
    </ul>
    <p>I wonder what the difference between “<strong> Assistant</strong>” and “<strong>Pickup and Drop</strong>” are. If they are the same, there are two “call to actions” for the same workflow</p>
  </div><!-- replies wrapper -->
  <div class="replies-wrp">
    <h1>PhonePe vs  GooglePay <span>Critique</span></h1>
    <ul class="joined-info">
      <li><a href="#">37D</a>  <span></span></li>
      <li>  <img src="../assets/images/heart.png"> </li>
      <li>  <a href="#"> 4</a> </li>
      <li class="comment-spc">  <img src="../assets/images/comment.svg"> </li>
      <li>  <a href="#"> 6</a> </li>
    </ul>
    <p>I wonder what the difference between “<strong> Assistant</strong>” and “<strong>Pickup and Drop</strong>” are. If they are the same, there are two “call to actions” for the same workflow</p>
  </div><!-- replies wrapper -->
    </div><!-- all card wrpper -->
  </div>
  </div><!-- all Relpies -->
298fff252   Digvijay Singh   new design added
351
352
        </div>
        <!-- data wrp -->
f06677bfc   Digvijay Singh   profile screen added
353
354
355
356
357
358
        <!-- body wrapper -->
      </div>
    </main>
  </template>
  
  <script>
f06677bfc   Digvijay Singh   profile screen added
359
360
361
  import Vue from "vue";
  import router from "../router";
  import $ from "jquery";
298fff252   Digvijay Singh   new design added
362
  import axios from 'axios'
f06677bfc   Digvijay Singh   profile screen added
363
364
365
366
367
368
369
  
  export default {
    name: "Profile",
  
    data() {
      return {
        loggedinFlag: false,
298fff252   Digvijay Singh   new design added
370
371
        usertoken: null,
        userData:{},
f06677bfc   Digvijay Singh   profile screen added
372
373
      };
    },
298fff252   Digvijay Singh   new design added
374
375
376
377
378
379
380
381
382
383
    mounted() {
      var userdata = localStorage.getItem("spotlight_usertoken");
      if (userdata) {
        userdata = JSON.parse(userdata);
        this.usertoken = userdata.token;
        this.getProfile();
      }
  
      
    },
f06677bfc   Digvijay Singh   profile screen added
384
    methods: {
298fff252   Digvijay Singh   new design added
385
      goToSignUp() {
f06677bfc   Digvijay Singh   profile screen added
386
387
388
389
390
        this.$router.push("/signup");
      },
      goToReset() {
        this.$router.push("/reset");
      },
298fff252   Digvijay Singh   new design added
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
      getProfile() {
        axios
        .get("/profile", {
          headers: {
            Authorization: "Bearer " + this.usertoken,
          },
        })
        .then((response) => {
          this.userData = response.data.data;
          console.log(response.data.data);
        })
        .catch((error) => console.log(error));
      },
      saveProfile(){
        var obj = {};
        obj = Object.assign(obj, this.userData);
          delete obj.awards;
          delete obj.createdAt;
          delete obj.email;
          delete obj.role;
          delete obj.verified;
          delete obj.updatedAt;
          delete obj.__v;
          delete obj._id;
          axios
          .put("/profile", obj,{
            headers: {
              Authorization: "Bearer " + this.usertoken,
            },
          })
          .then((response) => {
            // this.userData = response.data.data;
            console.log(response.data.data);
          })
          .catch((error) => console.log(error));
  
      },
921970bb2   Gurvinder Singh   new files
428
      addProfileDialog() {
298fff252   Digvijay Singh   new design added
429
        $(".inner-wrp").addClass("body-blur");
921970bb2   Gurvinder Singh   new files
430
431
           $("#add-social-links").hide();
        $(".popup-wrp, #add-profile").show();
298fff252   Digvijay Singh   new design added
432
      },
921970bb2   Gurvinder Singh   new files
433
434
435
      nextProfileDialog() {
         $("#add-profile").hide();
         $("#add-social-links").show();
298fff252   Digvijay Singh   new design added
436
        this.saveProfile();
921970bb2   Gurvinder Singh   new files
437
      
298fff252   Digvijay Singh   new design added
438
      },
921970bb2   Gurvinder Singh   new files
439
440
441
       closeDialog(){
   $(".popup-wrp").hide();
     $(".inner-wrp").removeClass("body-blur");
24ced0ae7   Gurvinder Singh   new changes files
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
       },
  ///
    caseDialog(){
       $(".rp-all").removeClass("active");
      $(".c-0").addClass("active");
       $("#all-replies").hide();
   $("#case-study-0").show();
       },
         repliesDialog(){
           $(".c-0").removeClass("active");
           $(".rp-all").addClass("active");
   $("#case-study-0").hide();
   $("#all-replies").show();
       },
       
       userprofileshowDialog(){
          $("#userprofileshow").toggle();
921970bb2   Gurvinder Singh   new files
459
       }
24ced0ae7   Gurvinder Singh   new changes files
460
       
f06677bfc   Digvijay Singh   profile screen added
461
462
463
    },
  };
  </script>