Blame view

src/components/Profile.vue 13 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
8
9
10
11
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
          <div class="popup-header">
            <img src="../assets/images/user.png" />
            <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
99

298fff252   Digvijay Singh   new design added
100
101
102
103
104
105
106
107
108
109
110
111
                  <ul class="interests">
                    <li><span>Cats</span></li>
                    <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
112

298fff252   Digvijay Singh   new design added
113
114
115
116
117
118
119
120
121
122
123
124
125
                  <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>
              </div>
921970bb2   Gurvinder Singh   new files
126
              <a href="javascript:void(0);" @click="nextProfileDialog" class="next-bt">Next</a>
298fff252   Digvijay Singh   new design added
127
128
129
            </form>
          </div>
          <div class="clearfix"></div>
921970bb2   Gurvinder Singh   new files
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
        </div> <!-- add profile -->
          <div class="popup-set" id="add-social-links" style="display:none;">
  <div class="popup-header">
    <img src="../assets/images/user.png" />
  
  </div><!-- header -->
  <div class="popup-body">
    <form class="popup-forms">
      <div class="row">
        <div class="col-lg-12">
          <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
152
        </div>
921970bb2   Gurvinder Singh   new files
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
    <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 -->
  
  
  </div>
  <a href="javascript:void(0);" @click="closeDialog" class="save-bt">Save Changes</a>
    </form>
  </div>
  <div class="clearfix"></div>
        </div><!-- add social links -->
298fff252   Digvijay Singh   new design added
201
202
203
      </div>
      <!-- profile -->
      <div class="container-fluid inner-wrp">
f06677bfc   Digvijay Singh   profile screen added
204
        <nav class="navbar navbar-expand-sm spotLight-nav">
298fff252   Digvijay Singh   new design added
205
206
207
208
209
210
211
212
213
214
215
216
          <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
217
218
219
220
            <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
221

f06677bfc   Digvijay Singh   profile screen added
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
          <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>
          <div class="user-profile-photo">
            <a href="#"><img src="../assets/images/user.png" /></a>
          </div>
298fff252   Digvijay Singh   new design added
241
242
243
244
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
270
        </nav>
        <!-- menu wrapper -->
        <div class="row profile-tab-spc-top">
          <div class="col-sm-8 col-md-12 col-lg-8 col-xl-8">
            <img src="../assets/images/user.png" class="inner-profile-ps" />
            <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
271
        </div>
298fff252   Digvijay Singh   new design added
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
        <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">
              <li class="active"><a href="#">Case-studies(0)</a></li>
              <li><a href="#">Comments/Replies(0)</a></li>
            </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">
          <div class="container-fluid data-wrp">
            <div class="row">
              <div class="col-lg-12">
                <div class="profile-buttons">
921970bb2   Gurvinder Singh   new files
300
                  <a href="javascript:void(0);"
298fff252   Digvijay Singh   new design added
301
                    class="profile-sm-bt center-and-spc bt-active"
921970bb2   Gurvinder Singh   new files
302
                    @click="addProfileDialog"
298fff252   Digvijay Singh   new design added
303
304
305
306
307
308
309
310
311
312
313
314
                    >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>
          </div>
        </div>
        <!-- data wrp -->
f06677bfc   Digvijay Singh   profile screen added
315
316
317
318
319
320
        <!-- body wrapper -->
      </div>
    </main>
  </template>
  
  <script>
f06677bfc   Digvijay Singh   profile screen added
321
322
323
  import Vue from "vue";
  import router from "../router";
  import $ from "jquery";
298fff252   Digvijay Singh   new design added
324
  import axios from 'axios'
f06677bfc   Digvijay Singh   profile screen added
325
326
327
328
329
330
331
  
  export default {
    name: "Profile",
  
    data() {
      return {
        loggedinFlag: false,
298fff252   Digvijay Singh   new design added
332
333
        usertoken: null,
        userData:{},
f06677bfc   Digvijay Singh   profile screen added
334
335
      };
    },
298fff252   Digvijay Singh   new design added
336
337
338
339
340
341
342
343
344
345
    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
346
    methods: {
298fff252   Digvijay Singh   new design added
347
      goToSignUp() {
f06677bfc   Digvijay Singh   profile screen added
348
349
350
351
352
        this.$router.push("/signup");
      },
      goToReset() {
        this.$router.push("/reset");
      },
298fff252   Digvijay Singh   new design added
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
      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
390
      addProfileDialog() {
298fff252   Digvijay Singh   new design added
391
        $(".inner-wrp").addClass("body-blur");
921970bb2   Gurvinder Singh   new files
392
393
           $("#add-social-links").hide();
        $(".popup-wrp, #add-profile").show();
298fff252   Digvijay Singh   new design added
394
      },
921970bb2   Gurvinder Singh   new files
395
396
397
      nextProfileDialog() {
         $("#add-profile").hide();
         $("#add-social-links").show();
298fff252   Digvijay Singh   new design added
398
        this.saveProfile();
921970bb2   Gurvinder Singh   new files
399
      
298fff252   Digvijay Singh   new design added
400
      },
921970bb2   Gurvinder Singh   new files
401
402
403
404
       closeDialog(){
   $(".popup-wrp").hide();
     $(".inner-wrp").removeClass("body-blur");
       }
f06677bfc   Digvijay Singh   profile screen added
405
406
407
    },
  };
  </script>