Commit 8530576f31b1b275bdda3cfe98c0e344516180ea
1 parent
4d117376ee
Exists in
admin
ui fixes
Showing
1 changed file
with
8 additions
and
2 deletions
Show diff stats
src/components/Profile.vue
1 | <template> | 1 | <template> |
2 | <main class="landing-page"> | 2 | <main class="landing-page"> |
3 | 3 | ||
4 | 4 | ||
5 | <!-- profile --> | 5 | <!-- profile --> |
6 | <div class="popup-wrp" style="display: none"> | 6 | <div class="popup-wrp" style="display: none"> |
7 | <div class="overlay" @click="hideDialog"></div> | 7 | <div class="overlay" @click="hideDialog"></div> |
8 | <div class="popup-set" id="add-profile" style="display: none;width:700px"> | 8 | <div class="popup-set" id="add-profile" style="display: none;width:700px"> |
9 | 9 | ||
10 | <!-- header --> | 10 | <!-- header --> |
11 | <div class="popup-body"> | 11 | <div class="popup-body"> |
12 | <form class="popup-forms"> | 12 | <form class="popup-forms"> |
13 | <div class="row"> | 13 | <div class="row"> |
14 | <!-- input --> | 14 | <!-- input --> |
15 | <img :src="templateImage" /> | 15 | <img :src="templateImage" /> |
16 | <!-- input --> | 16 | <!-- input --> |
17 | 17 | ||
18 | 18 | ||
19 | 19 | ||
20 | <!-- input --> | 20 | <!-- input --> |
21 | 21 | ||
22 | <!-- input --> | 22 | <!-- input --> |
23 | <!-- <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 23 | <!-- <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
24 | <div class="form-group floating-label"> | 24 | <div class="form-group floating-label"> |
25 | <select class="form-group"> | 25 | <select class="form-group"> |
26 | <option @click="addSocialLink">Add another</option> | 26 | <option @click="addSocialLink">Add another</option> |
27 | </select> | 27 | </select> |
28 | <span class="select-arrow" | 28 | <span class="select-arrow" |
29 | ><img src="../assets/images/chevron-down.svg" | 29 | ><img src="../assets/images/chevron-down.svg" |
30 | /></span> | 30 | /></span> |
31 | </div> | 31 | </div> |
32 | </div> --> | 32 | </div> --> |
33 | <!-- input --> | 33 | <!-- input --> |
34 | </div> | 34 | </div> |
35 | 35 | ||
36 | </form> | 36 | </form> |
37 | </div> | 37 | </div> |
38 | <div class="clearfix"></div> | 38 | <div class="clearfix"></div> |
39 | </div> | 39 | </div> |
40 | <!-- add profile --> | 40 | <!-- add profile --> |
41 | </div> | 41 | </div> |
42 | <!-- profile --> | 42 | <!-- profile --> |
43 | <!-- profile --> | 43 | <!-- profile --> |
44 | <div class="container-fluid inner-wrp" style="background: transparent"> | 44 | <div class="container-fluid inner-wrp" style="background: transparent"> |
45 | <nav class="navbar navbar-expand-sm spotLight-nav"> | 45 | <nav class="navbar navbar-expand-sm spotLight-nav"> |
46 | <a class="navbar-brand" href="#" | 46 | <a class="navbar-brand" href="#" |
47 | ><img src="../assets/images/logo.png" | 47 | ><img src="../assets/images/logo.png" |
48 | /></a> | 48 | /></a> |
49 | <button | 49 | <button |
50 | class="navbar-toggler" | 50 | class="navbar-toggler" |
51 | type="button" | 51 | type="button" |
52 | data-toggle="collapse" | 52 | data-toggle="collapse" |
53 | data-target="#navbarsExample03" | 53 | data-target="#navbarsExample03" |
54 | aria-controls="navbarsExample03" | 54 | aria-controls="navbarsExample03" |
55 | aria-expanded="false" | 55 | aria-expanded="false" |
56 | aria-label="Toggle navigation" | 56 | aria-label="Toggle navigation" |
57 | > | 57 | > |
58 | <span class="navbar-toggler-icon"></span> | 58 | <span class="navbar-toggler-icon"></span> |
59 | <span class="navbar-toggler-icon"></span> | 59 | <span class="navbar-toggler-icon"></span> |
60 | <span class="navbar-toggler-icon"></span> | 60 | <span class="navbar-toggler-icon"></span> |
61 | </button> | 61 | </button> |
62 | 62 | ||
63 | <div class="collapse navbar-collapse" id="navbarsExample03"> | 63 | <div class="collapse navbar-collapse" id="navbarsExample03"> |
64 | <ul class="navbar-nav mr-auto"> | 64 | <ul class="navbar-nav mr-auto"> |
65 | <li class="nav-item active"> | 65 | <li class="nav-item active"> |
66 | <a class="nav-link" style="cursor:pointer" @click="listPage('/casestudy')">Case Study List</a> | 66 | <a class="nav-link" style="cursor:pointer" @click="listPage('/casestudy')">Case Study List</a> |
67 | </li> | 67 | </li> |
68 | <li class="nav-item active"> | 68 | <li class="nav-item active"> |
69 | <a class="nav-link" style="cursor:pointer" @click="listPage('/insight')">Create Insight</a> | 69 | <a class="nav-link" style="cursor:pointer" @click="listPage('/insight')">Create Insight</a> |
70 | </li> | 70 | </li> |
71 | </ul> | 71 | </ul> |
72 | </div> | 72 | </div> |
73 | <div class=""> | 73 | <div class=""> |
74 | <a href="javascript:void(0);" @click="logout">Log Out </a> | 74 | <a href="javascript:void(0);" @click="logout">Log Out </a> |
75 | </div> | 75 | </div> |
76 | </nav> | 76 | </nav> |
77 | <!-- menu wrapper --> | 77 | <!-- menu wrapper --> |
78 | <div class="row profile-tab-spc-top"> | 78 | <div class="row profile-tab-spc-top"> |
79 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 79 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
80 | <div class="user-profile"> | 80 | <div class="user-profile"> |
81 | <div class="form-group floating-label"> | 81 | <div class="form-group floating-label"> |
82 | <select | 82 | <select |
83 | class="form-control" | 83 | class="form-control" |
84 | v-model="userData" | 84 | v-model="userData" |
85 | v-on:change="selectUser(userData)" | 85 | v-on:change="selectUser(userData)" |
86 | :disabled="editMode" | 86 | :disabled="editMode" |
87 | > | 87 | > |
88 | <option value="null">Select User</option> | 88 | <option value="null">Select User</option> |
89 | <option v-for="(user, i) in userList" :key="i" :value="i"> | 89 | <option v-for="(user, i) in userList" :key="i" :value="i"> |
90 | {{ user.name }} ({{ user.email }}) | 90 | {{ user.name }} ({{ user.email }}) |
91 | </option> | 91 | </option> |
92 | </select> | 92 | </select> |
93 | </div> | 93 | </div> |
94 | </div> | 94 | </div> |
95 | </div> | 95 | </div> |
96 | </div> | 96 | </div> |
97 | 97 | ||
98 | <div class="row"> | 98 | <div class="row"> |
99 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 99 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
100 | <ul class="navbar-nav mr-auto"> | 100 | <ul class="navbar-nav mr-auto"> |
101 | <li class="nav-item active"> | 101 | <li class="nav-item active"> |
102 | <h5 class="nav-link">Intro Screen Record</h5> | 102 | <h5 class="nav-link">Intro Screen Record</h5> |
103 | </li> | 103 | </li> |
104 | </ul> | 104 | </ul> |
105 | </div> | 105 | </div> |
106 | </div> | 106 | </div> |
107 | <!-- 1st row --> | 107 | <!-- 1st row --> |
108 | <div class="row"> | 108 | <div class="row"> |
109 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 109 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
110 | <div class="form-group floating-label"> | 110 | <div class="form-group floating-label"> |
111 | <label for="lname" class="lname">Case Study Name</label> | 111 | <label for="lname" class="lname">Case Study Name</label> |
112 | <input | 112 | <input |
113 | type="text" | 113 | type="text" |
114 | class="form-control" | 114 | class="form-control" |
115 | value="" | 115 | value="" |
116 | placeholder=" " | 116 | placeholder=" " |
117 | v-model="caseStudy.caseStudyDetails.intro.name" | 117 | v-model="caseStudy.caseStudyDetails.intro.name" |
118 | /> | 118 | /> |
119 | </div> | 119 | </div> |
120 | </div> | 120 | </div> |
121 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 121 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
122 | <div class="form-group floating-label"> | 122 | <div class="form-group floating-label"> |
123 | <label for="lname" class="lname">App Name</label> | 123 | <label for="lname" class="lname">App Name</label> |
124 | <input | 124 | <input |
125 | type="text" | 125 | type="text" |
126 | class="form-control" | 126 | class="form-control" |
127 | value="" | 127 | value="" |
128 | placeholder=" " | 128 | placeholder=" " |
129 | v-model="caseStudy.caseStudyDetails.intro.app" | 129 | v-model="caseStudy.caseStudyDetails.intro.app" |
130 | /> | 130 | /> |
131 | </div> | 131 | </div> |
132 | </div> | 132 | </div> |
133 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 133 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
134 | <!-- <div class="form-group floating-label"> | 134 | <!-- <div class="form-group floating-label"> |
135 | <label for="lname" class="lname">Focus</label> | 135 | <label for="lname" class="lname">Focus</label> |
136 | <input | 136 | <input |
137 | type="text" | 137 | type="text" |
138 | class="form-control" | 138 | class="form-control" |
139 | value="" | 139 | value="" |
140 | placeholder=" " | 140 | placeholder=" " |
141 | v-model="caseStudy.caseStudyDetails.intro.focus" | 141 | v-model="caseStudy.caseStudyDetails.intro.focus" |
142 | /> | 142 | /> |
143 | </div> --> | 143 | </div> --> |
144 | </div> | 144 | </div> |
145 | </div> | 145 | </div> |
146 | <!-- 1st row end --> | 146 | <!-- 1st row end --> |
147 | 147 | ||
148 | <!-- 2nd row --> | 148 | <!-- 2nd row --> |
149 | <div class="row"> | 149 | <div class="row"> |
150 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 150 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
151 | <div class="form-group floating-label"> | 151 | <div class="form-group floating-label"> |
152 | <label for="lname" class="lname">Case Study Type</label> | 152 | <label for="lname" class="lname">Case Study Type</label> |
153 | <select | 153 | <select |
154 | class="form-control" | 154 | class="form-control" |
155 | v-model="caseStudy.caseStudyDetails.intro.type" | 155 | v-model="caseStudy.caseStudyDetails.intro.type" |
156 | > | 156 | > |
157 | <option value="null">Select Case Type</option> | 157 | <option value="null">Select Case Type</option> |
158 | <option value="Retake">Retake</option> | 158 | <option value="Retake">Retake</option> |
159 | <option value="Behind-the-scenes">Behind-the-scenes</option> | 159 | <option value="Behind-the-scenes">Behind-the-scenes</option> |
160 | <option value="Critique">Critique</option> | 160 | <option value="Critique">Critique</option> |
161 | <option value="Juxtapose">Juxtapose</option> | 161 | <option value="Juxtapose">Juxtapose</option> |
162 | </select> | 162 | </select> |
163 | </div> | 163 | </div> |
164 | </div> | 164 | </div> |
165 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 165 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
166 | <div class="form-group floating-label"> | 166 | <div class="form-group floating-label"> |
167 | <label for="lname" class="lname">Platform</label> | 167 | <label for="lname" class="lname">Platform</label> |
168 | <input | 168 | <input |
169 | type="text" | 169 | type="text" |
170 | class="form-control" | 170 | class="form-control" |
171 | value="" | 171 | value="" |
172 | placeholder=" " | 172 | placeholder=" " |
173 | v-model="caseStudy.caseStudyDetails.intro.platForm" | 173 | v-model="caseStudy.caseStudyDetails.intro.platForm" |
174 | /> | 174 | /> |
175 | </div> | 175 | </div> |
176 | </div> | 176 | </div> |
177 | 177 | ||
178 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 178 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
179 | <div class="form-group floating-label"> | 179 | <div class="form-group floating-label"> |
180 | <label for="lname" class="lname"> App logo</label> | 180 | <label for="lname" class="lname"> App logo</label> |
181 | <img v-if="caseStudy.caseStudyDetails.intro.logoURL" style="width:40px;height: 40px;" :src="caseStudy.caseStudyDetails.intro.logoURL" | 181 | <img v-if="caseStudy.caseStudyDetails.intro.logoURL" style="width:40px;height: 40px;" :src="caseStudy.caseStudyDetails.intro.logoURL" |
182 | /> | 182 | /> |
183 | <input | 183 | <input |
184 | @change="createImage('logo')" | 184 | @change="createImage('logo')" |
185 | type="file" | 185 | type="file" |
186 | name="photso" | 186 | name="photso" |
187 | id="logo" | 187 | id="logo" |
188 | accept="image/*" | 188 | accept="image/*" |
189 | /> | 189 | /> |
190 | </div> | 190 | </div> |
191 | </div> | 191 | </div> |
192 | </div> | 192 | </div> |
193 | <!-- 2nd row --> | 193 | <!-- 2nd row --> |
194 | <!-- 3rd row --> | 194 | <!-- 3rd row --> |
195 | <div class="row"> | 195 | <div class="row"> |
196 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 196 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
197 | <div class="form-group floating-label"> | 197 | <div class="form-group floating-label"> |
198 | <label for="lname" class="lname"></label> | 198 | <label for="lname" class="lname"></label> |
199 | <ul class="interests"> | 199 | <ul class="interests"> |
200 | <li> | 200 | <li> |
201 | <input | 201 | <input |
202 | class="" | 202 | class="" |
203 | placeholder="Add Focus Areas" | 203 | placeholder="Add Focus Areas" |
204 | v-model="focusName" | 204 | v-model="focusName" |
205 | v-on:keyup.enter="addInsight('focus')" | ||
206 | |||
205 | /> | 207 | /> |
206 | <a href="javascript:void(0);" @click="addInsight('focus')" | 208 | <a href="javascript:void(0);" @click="addInsight('focus')" |
207 | ><img src="../assets/images/plus-circle.svg" | 209 | ><img src="../assets/images/plus-circle.svg" |
208 | /></a> | 210 | /></a> |
209 | </li> | 211 | </li> |
210 | 212 | ||
211 | <li | 213 | <li |
212 | v-for="(interest, i) in caseStudy.caseStudyDetails.focusAreas" | 214 | v-for="(interest, i) in caseStudy.caseStudyDetails.focusAreas" |
213 | :key="i" | 215 | :key="i" |
214 | > | 216 | > |
215 | <span>{{ interest }}</span> | 217 | <span>{{ interest }}</span> |
216 | <a | 218 | <a |
217 | href="javascript:void(0);" | 219 | href="javascript:void(0);" |
218 | @click="removeInsight(i, 'focus')" | 220 | @click="removeInsight(i, 'focus')" |
219 | class="cat-minus" | 221 | class="cat-minus" |
220 | ><img src="../assets/images/minus.svg" | 222 | ><img src="../assets/images/minus.svg" |
221 | /></a> | 223 | /></a> |
222 | </li> | 224 | </li> |
223 | </ul> | 225 | </ul> |
224 | </div> | 226 | </div> |
225 | </div> | 227 | </div> |
226 | 228 | ||
227 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 229 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
228 | <div class="form-group floating-label"> | 230 | <div class="form-group floating-label"> |
229 | <label for="lname" class="lname">Select Insight Tags</label> | 231 | <label for="lname" class="lname">Select Insight Tags</label> |
230 | <select | 232 | <select |
231 | class="form-control" | 233 | class="form-control" |
232 | v-model="insightName" | 234 | v-model="insightName" |
233 | @change="addInsight('insight')" | 235 | @change="addInsight('insight')" |
234 | > | 236 | > |
235 | <option value="null">Select Insight Tag</option> | 237 | <option value="null">Select Insight Tag</option> |
236 | <option value="Design">Design</option> | 238 | <option value="Design">Design</option> |
237 | <option value="Product">Product</option> | 239 | <option value="Product">Product</option> |
238 | <option value="Marketing">Marketing</option> | 240 | <option value="Marketing">Marketing</option> |
239 | <option value="Pricing">Pricing</option> | 241 | <option value="Pricing">Pricing</option> |
240 | <option value="Psychology">Psychology</option> | 242 | <option value="Psychology">Psychology</option> |
241 | </select> | 243 | </select> |
242 | </div> | 244 | </div> |
243 | </div> | 245 | </div> |
244 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 246 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
245 | <div class="form-group floating-label"> | 247 | <div class="form-group floating-label"> |
246 | <label for="lname" class="lname"></label> | 248 | <label for="lname" class="lname"></label> |
247 | <ul class="interests"> | 249 | <ul class="interests"> |
248 | <li | 250 | <li |
249 | v-for="(interest, i) in caseStudy.caseStudyDetails.insightTags" | 251 | v-for="(interest, i) in caseStudy.caseStudyDetails.insightTags" |
250 | :key="i" | 252 | :key="i" |
251 | > | 253 | > |
252 | <span>{{ interest }}</span> | 254 | <span>{{ interest }}</span> |
253 | <a | 255 | <a |
254 | href="javascript:void(0);" | 256 | href="javascript:void(0);" |
255 | @click="removeInsight(i, 'insight')" | 257 | @click="removeInsight(i, 'insight')" |
256 | class="cat-minus" | 258 | class="cat-minus" |
257 | ><img src="../assets/images/minus.svg" | 259 | ><img src="../assets/images/minus.svg" |
258 | /></a> | 260 | /></a> |
259 | </li> | 261 | </li> |
260 | </ul> | 262 | </ul> |
261 | </div> | 263 | </div> |
262 | </div> | 264 | </div> |
263 | </div> | 265 | </div> |
264 | <!-- 3rd row end --> | 266 | <!-- 3rd row end --> |
265 | 267 | ||
266 | <!-- outdor --> | 268 | <!-- outdor --> |
267 | <div class="row profile-tab-spc-top"> | 269 | <div class="row profile-tab-spc-top"> |
268 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 270 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
269 | <ul class="navbar-nav mr-auto"> | 271 | <ul class="navbar-nav mr-auto"> |
270 | <li class="nav-item active"> | 272 | <li class="nav-item active"> |
271 | <h5 class="nav-link">Outro Screen Record</h5> | 273 | <h5 class="nav-link">Outro Screen Record</h5> |
272 | </li> | 274 | </li> |
273 | </ul> | 275 | </ul> |
274 | </div> | 276 | </div> |
275 | </div> | 277 | </div> |
276 | 278 | ||
277 | <!-- 1st row --> | 279 | <!-- 1st row --> |
278 | <div class="row"> | 280 | <div class="row"> |
279 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 281 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
280 | <div class="form-group floating-label"> | 282 | <div class="form-group floating-label"> |
281 | <label for="lname" class="lname">Designer Name</label> | 283 | <label for="lname" class="lname">Designer Name</label> |
282 | <input | 284 | <input |
283 | type="text" | 285 | type="text" |
284 | class="form-control" | 286 | class="form-control" |
285 | value="" | 287 | value="" |
286 | placeholder=" " | 288 | placeholder=" " |
287 | v-model="caseStudy.caseStudyDetails.outro.designer" | 289 | v-model="caseStudy.caseStudyDetails.outro.designer" |
288 | /> | 290 | /> |
289 | </div> | 291 | </div> |
290 | </div> | 292 | </div> |
291 | 293 | ||
292 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 294 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
293 | <div class="form-group floating-label"> | 295 | <div class="form-group floating-label"> |
294 | <label for="lname" class="lname">Illustrations Name</label> | 296 | <label for="lname" class="lname">Illustrations Name</label> |
295 | <input | 297 | <input |
296 | type="text" | 298 | type="text" |
297 | class="form-control" | 299 | class="form-control" |
298 | value="" | 300 | value="" |
299 | placeholder=" " | 301 | placeholder=" " |
300 | v-model="caseStudy.caseStudyDetails.outro.illustrations" | 302 | v-model="caseStudy.caseStudyDetails.outro.illustrations" |
301 | /> | 303 | /> |
302 | </div> | 304 | </div> |
303 | </div> | 305 | </div> |
304 | 306 | ||
305 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 307 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
306 | <div class="form-group floating-label"> | 308 | <div class="form-group floating-label"> |
307 | <label for="lname" class="lname"> Author Image</label> | 309 | <label for="lname" class="lname"> Author Image</label> |
308 | <img v-if="caseStudy.caseStudyDetails.outro.authorImage[0]" style="width:40px;height: 40px;" :src="caseStudy.caseStudyDetails.outro.authorImage[0]" | 310 | <img v-if="caseStudy.caseStudyDetails.outro.authorImage[0]" style="width:40px;height: 40px;" :src="caseStudy.caseStudyDetails.outro.authorImage[0]" |
309 | /> | 311 | /> |
310 | <input | 312 | <input |
311 | @change="createImage('outdor')" | 313 | @change="createImage('outdor')" |
312 | type="file" | 314 | type="file" |
313 | name="photos" | 315 | name="photos" |
314 | id="outdor" | 316 | id="outdor" |
315 | accept="image/*" | 317 | accept="image/*" |
316 | /> | 318 | /> |
317 | </div> | 319 | </div> |
318 | </div> | 320 | </div> |
319 | </div> | 321 | </div> |
320 | <!-- 1st row --> | 322 | <!-- 1st row --> |
321 | <!-- outdoor ends --> | 323 | <!-- outdoor ends --> |
322 | 324 | ||
323 | <!-- outdor --> | 325 | <!-- outdor --> |
324 | <div class="row profile-tab-spc-top"> | 326 | <div class="row profile-tab-spc-top"> |
325 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 327 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
326 | <ul class="navbar-nav mr-auto"> | 328 | <ul class="navbar-nav mr-auto"> |
327 | <li class="nav-item active"> | 329 | <li class="nav-item active"> |
328 | <h5 class="nav-link">Add SLides</h5> | 330 | <h5 class="nav-link">Add SLides</h5> |
329 | </li> | 331 | </li> |
330 | </ul> | 332 | </ul> |
331 | </div> | 333 | </div> |
332 | </div> | 334 | </div> |
333 | 335 | ||
334 | 336 | ||
335 | 337 | ||
336 | <!-- case study slides--> | 338 | <!-- case study slides--> |
337 | <div | 339 | <div |
338 | class="row profile-tab-spc-top" | 340 | class="row profile-tab-spc-top" |
339 | v-for="(slide, i) in caseStudy.slides" | 341 | v-for="(slide, i) in caseStudy.slides" |
340 | :key="i" | 342 | :key="i" |
341 | > | 343 | > |
342 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 344 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
343 | <ul class="navbar-nav mr-auto"> | 345 | <ul class="navbar-nav mr-auto"> |
344 | <li class="nav-item active"> | 346 | <li class="nav-item active"> |
345 | <p class="nav-link"> | 347 | <p class="nav-link"> |
346 | <b>Screen {{ i + 1 }}</b> | 348 | <b>Screen {{ i + 1 }}</b> |
347 | <a | 349 | <a |
348 | style="cursor: pointer; color: red; font-size: 0.8rem" | 350 | style="cursor: pointer; color: red; font-size: 0.8rem" |
349 | @click="removeSlide(i)" | 351 | @click="removeSlide(i)" |
350 | > | 352 | > |
351 | Remove</a | 353 | Remove</a |
352 | > | 354 | > |
353 | <a | 355 | <a |
354 | style="cursor: pointer; color: blue; font-size: 0.8rem" | 356 | style="cursor: pointer; color: blue; font-size: 0.8rem" |
355 | @click="addProfileDialog(slide)" | 357 | @click="addProfileDialog(slide)" |
356 | > | 358 | > |
357 | View</a | 359 | View</a |
358 | > | 360 | > |
359 | </p> | 361 | </p> |
360 | </li> | 362 | </li> |
361 | <li class="nav-item active" v-if="slide.insight"> | 363 | <li class="nav-item active" v-if="slide.insight"> |
362 | <div class="form-group floating-label"> | 364 | <div class="form-group floating-label"> |
363 | <label for="lname" class="lname">Insight</label> | 365 | <label for="lname" class="lname">Insight</label> |
364 | <select | 366 | <select |
365 | class="form-control" | 367 | class="form-control" |
366 | v-model="insightId" | 368 | v-model="insightId" |
367 | v-on:change="insightSelected(slide)" | 369 | v-on:change="insightSelected(slide)" |
368 | > | 370 | > |
369 | <option value="null">Select Insight</option> | 371 | <option value="null">Select Insight</option> |
370 | <option v-for="(insight, i) in insightList" :key="i" :value="insight._id"> | 372 | <option v-for="(insight, i) in insightList" :key="i" :value="insight._id"> |
371 | {{ insight._id }} | 373 | {{ insight._id }} |
372 | </option> | 374 | </option> |
373 | </select> | 375 | </select> |
374 | </div> | 376 | </div> |
375 | </li> | 377 | </li> |
376 | </ul> | 378 | </ul> |
377 | </div> | 379 | </div> |
378 | 380 | ||
379 | 381 | ||
380 | 382 | ||
381 | 383 | ||
382 | 384 | ||
383 | 385 | ||
384 | <div class="row"> | 386 | <div class="row"> |
385 | <div | 387 | <div |
386 | class="col-sm-4 col-md-4 col-lg-4 col-xl-4" | 388 | class="col-sm-4 col-md-4 col-lg-4 col-xl-4" |
387 | v-for="(field, j) in slide.metaData.fields" | 389 | v-for="(field, j) in slide.metaData.fields" |
388 | :key="j" | 390 | :key="j" |
389 | > | 391 | > |
390 | <div | 392 | <div |
391 | class="form-group floating-label" | 393 | class="form-group floating-label" |
392 | v-if="field.fieldType == 'text'" | 394 | v-if="field.fieldType == 'text'" |
393 | > | 395 | > |
394 | <label for="lname" class="lname">{{ field.displayName }}</label> | 396 | <label for="lname" class="lname">{{ field.displayName }}</label> |
395 | <input | 397 | <input |
396 | type="text" | 398 | type="text" |
397 | class="form-control" | 399 | class="form-control" |
398 | value="" | 400 | value="" |
399 | placeholder=" " | 401 | placeholder=" " |
400 | v-model="field.fieldValue" | 402 | v-model="field.fieldValue" |
401 | /> | 403 | /> |
402 | </div> | 404 | </div> |
403 | 405 | ||
404 | <div | 406 | <div |
405 | class="form-group floating-label" | 407 | class="form-group floating-label" |
406 | v-if="field.fieldType == 'image'" | 408 | v-if="field.fieldType == 'image'" |
407 | > | 409 | > |
408 | <label for="lname" class="lname"> {{ field.displayName }}</label> | 410 | <label for="lname" class="lname"> {{ field.displayName }}</label> |
409 | <img v-if="field.fieldValue" style="width:40px;height: 40px;" :src="field.fieldValue" | 411 | <img v-if="field.fieldValue" style="width:40px;height: 40px;" :src="field.fieldValue" |
410 | /> | 412 | /> |
411 | <input | 413 | <input |
412 | @change="fieldcreateImage(i, j)" | 414 | @change="fieldcreateImage(i, j)" |
413 | type="file" | 415 | type="file" |
414 | name="photo" | 416 | name="photo" |
415 | :id="i + '' + j" | 417 | :id="i + '' + j" |
416 | accept="image/*" | 418 | accept="image/*" |
417 | /> | 419 | /> |
418 | </div> | 420 | </div> |
419 | </div> | 421 | </div> |
420 | </div> | 422 | </div> |
421 | 423 | ||
422 | <div class="row"> | 424 | <div class="row"> |
423 | <div | 425 | <div |
424 | class="col-sm-4 col-md-4 col-lg-4 col-xl-4" | 426 | class="col-sm-4 col-md-4 col-lg-4 col-xl-4" |
425 | v-for="(cum, j) in slide.metaData.comments" | 427 | v-for="(cum, j) in slide.metaData.comments" |
426 | :key="j" | 428 | :key="j" |
427 | > | 429 | > |
428 | <div class="form-group floating-label"> | 430 | <div class="form-group floating-label"> |
429 | <label for="lname" class="lname">Comment Box {{ j + 1 }}</label> | 431 | <label for="lname" class="lname">Comment Box {{ j + 1 }}</label> |
430 | <input | 432 | <input |
431 | type="text" | 433 | type="text" |
432 | class="form-control" | 434 | class="form-control" |
433 | value="" | 435 | value="" |
434 | placeholder=" " | 436 | placeholder=" " |
435 | v-model="cum.comment" | 437 | v-model="cum.comment" |
436 | /> | 438 | /> |
437 | </div> | 439 | </div> |
438 | </div> | 440 | </div> |
439 | </div> | 441 | </div> |
440 | 442 | ||
441 | </div> | 443 | </div> |
442 | 444 | ||
443 | 445 | ||
444 | <!-- 1st row --> | 446 | <!-- 1st row --> |
445 | <div class="row"> | 447 | <div class="row"> |
446 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 448 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
447 | <div class="form-group floating-label"> | 449 | <div class="form-group floating-label"> |
448 | <label for="lname" class="lname">Slides Name</label> | 450 | <label for="lname" class="lname">Slides Name</label> |
449 | <select | 451 | <select |
450 | class="form-control" | 452 | class="form-control" |
451 | v-model="slideId" | 453 | v-model="slideId" |
452 | v-on:change="slideSelected(slideId)" | 454 | v-on:change="slideSelected(slideId)" |
453 | > | 455 | > |
454 | <option value="null">Select Slide</option> | 456 | <option value="null">Select Slide</option> |
455 | <option v-for="(template, i) in templateList" :key="i" :value="i"> | 457 | <option v-for="(template, i) in templateList" :key="i" :value="i"> |
456 | {{ template.name }} | 458 | {{ template.name }} |
457 | </option> | 459 | </option> |
458 | </select> | 460 | </select> |
459 | </div> | 461 | </div> |
460 | </div> | 462 | </div> |
461 | </div> | 463 | </div> |
462 | <!-- 1st row --> | 464 | <!-- 1st row --> |
463 | 465 | ||
464 | <!-- 1st row end --> | 466 | <!-- 1st row end --> |
465 | <!-- case study ends --> | 467 | <!-- case study ends --> |
466 | <div class="clearfix"></div> | 468 | <div class="clearfix"></div> |
467 | 469 | ||
468 | <!-- users land image --> | 470 | <!-- users land image --> |
469 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 471 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
470 | <div class="form-layout signup-frm-spc"> | 472 | <div class="form-layout signup-frm-spc"> |
471 | <form> | 473 | <form> |
472 | <a | 474 | <a |
473 | href="javascript:void(0);" | 475 | href="javascript:void(0);" |
474 | class="btn btn-lg sb-button" | 476 | class="btn btn-lg sb-button" |
475 | type="submit" | 477 | type="submit" |
476 | @click="submit" | 478 | @click="submit" |
477 | > | 479 | > |
478 | <img src="../assets/images/key.svg" /> submit | 480 | <img src="../assets/images/key.svg" /> submit |
479 | </a> | 481 | </a> |
480 | </form> | 482 | </form> |
481 | </div> | 483 | </div> |
482 | </div> | 484 | </div> |
483 | 485 | ||
484 | <!-- data wrp --> | 486 | <!-- data wrp --> |
485 | <!-- body wrapper --> | 487 | <!-- body wrapper --> |
486 | </div> | 488 | </div> |
487 | </main> | 489 | </main> |
488 | </template> | 490 | </template> |
489 | 491 | ||
490 | <script> | 492 | <script> |
491 | import Vue from "vue"; | 493 | import Vue from "vue"; |
492 | import router from "../router"; | 494 | import router from "../router"; |
493 | import $ from "jquery"; | 495 | import $ from "jquery"; |
494 | import axios from "axios"; | 496 | import axios from "axios"; |
495 | 497 | ||
496 | export default { | 498 | export default { |
497 | name: "Profile", | 499 | name: "Profile", |
498 | 500 | ||
499 | data() { | 501 | data() { |
500 | return { | 502 | return { |
501 | loggedinFlag: false, | 503 | loggedinFlag: false, |
502 | templateImage:null, | 504 | templateImage:null, |
503 | caseId: null, | 505 | caseId: null, |
504 | editMode: false, | 506 | editMode: false, |
505 | userData: null, | 507 | userData: null, |
506 | usertoken: null, | 508 | usertoken: null, |
507 | insightName: null, | 509 | insightName: null, |
508 | focusName: null, | 510 | focusName: null, |
509 | slideId: null, | 511 | slideId: null, |
510 | userList: [], | 512 | userList: [], |
511 | templateList: [], | 513 | templateList: [], |
512 | insightList: [], | 514 | insightList: [], |
513 | insightId:null, | 515 | insightId:null, |
514 | caseStudy: { | 516 | caseStudy: { |
515 | caseStudyDetails: { | 517 | caseStudyDetails: { |
516 | userId: [], | 518 | userId: [], |
517 | intro: { | 519 | intro: { |
518 | name: null, | 520 | name: null, |
519 | logoURL: null, | 521 | logoURL: null, |
520 | app: null, | 522 | app: null, |
521 | type: null, | 523 | type: null, |
522 | focus: "", | ||
523 | readTime: null, | 524 | readTime: null, |
524 | platForm: null, | 525 | platForm: null, |
525 | authors: [], | 526 | authors: [], |
526 | }, | 527 | }, |
527 | outro: { | 528 | outro: { |
528 | authorImage: [], | 529 | authorImage: [], |
529 | authors: [], | 530 | authors: [], |
530 | designer: null, | 531 | designer: null, |
531 | illustrations: null, | 532 | illustrations: null, |
532 | }, | 533 | }, |
533 | insightTags: [], | 534 | insightTags: [], |
534 | focusAreas: [], | 535 | focusAreas: [], |
535 | }, | 536 | }, |
536 | slides: [], | 537 | slides: [], |
537 | }, | 538 | }, |
538 | }; | 539 | }; |
539 | }, | 540 | }, |
540 | mounted() { | 541 | mounted() { |
541 | if (this.$route.fullPath.split("?").length == 2) { | 542 | if (this.$route.fullPath.split("?").length == 2) { |
542 | this.editMode = true; | 543 | this.editMode = true; |
543 | this.caseId = this.$route.fullPath.split("?")[1]; | 544 | this.caseId = this.$route.fullPath.split("?")[1]; |
544 | var introData = localStorage.getItem("spotlight_caseStudy" + this.caseId); | 545 | var introData = localStorage.getItem("spotlight_caseStudy" + this.caseId); |
545 | if (introData) { | 546 | if (introData) { |
546 | introData = JSON.parse(introData); | 547 | introData = JSON.parse(introData); |
547 | console.log("introData", introData); | 548 | console.log("introData", introData); |
549 | if(introData.intro.focus){ | ||
550 | delete introData.intro.focus; | ||
551 | } | ||
548 | this.caseStudy.caseStudyDetails.intro = introData.intro; | 552 | this.caseStudy.caseStudyDetails.intro = introData.intro; |
549 | this.caseStudy.caseStudyDetails.userId = introData.userId; | 553 | this.caseStudy.caseStudyDetails.userId = introData.userId; |
550 | this.caseStudy.caseStudyDetails.outro = introData.outro; | 554 | this.caseStudy.caseStudyDetails.outro = introData.outro; |
551 | this.caseStudy.caseStudyDetails.insightTags = introData.insightTags; | 555 | this.caseStudy.caseStudyDetails.insightTags = introData.insightTags; |
552 | this.caseStudy.caseStudyDetails.focusAreas = introData.focusAreas; | 556 | this.caseStudy.caseStudyDetails.focusAreas = introData.focusAreas; |
553 | } | 557 | } |
554 | } | 558 | } |
555 | var userdata = localStorage.getItem("spotlight_usertoken"); | 559 | var userdata = localStorage.getItem("spotlight_usertoken"); |
556 | if (userdata) { | 560 | if (userdata) { |
557 | userdata = JSON.parse(userdata); | 561 | userdata = JSON.parse(userdata); |
558 | this.usertoken = userdata.token; | 562 | this.usertoken = userdata.token; |
559 | this.getUserList(); | 563 | this.getUserList(); |
560 | this.getTemplateList(); | 564 | this.getTemplateList(); |
561 | this.getInsightList(); | 565 | this.getInsightList(); |
562 | } | 566 | } |
563 | }, | 567 | }, |
564 | methods: { | 568 | methods: { |
565 | selectUser(i) { | 569 | selectUser(i) { |
566 | this.userList[i]; | 570 | this.userList[i]; |
567 | this.caseStudy.caseStudyDetails.intro.authors.push(this.userList[i].name); | 571 | this.caseStudy.caseStudyDetails.intro.authors.push(this.userList[i].name); |
568 | this.caseStudy.caseStudyDetails.outro.authors.push(this.userList[i].name); | 572 | this.caseStudy.caseStudyDetails.outro.authors.push(this.userList[i].name); |
569 | this.caseStudy.caseStudyDetails.userId.push(this.userList[i]._id); | 573 | this.caseStudy.caseStudyDetails.userId.push(this.userList[i]._id); |
570 | console.log("-", this.caseStudy); | 574 | console.log("-", this.caseStudy); |
571 | }, | 575 | }, |
572 | 576 | ||
573 | logout() { | 577 | logout() { |
574 | this.$router.push("/"); | 578 | this.$router.push("/"); |
575 | }, | 579 | }, |
576 | addInsight(type) { | 580 | addInsight(type) { |
577 | if (type == "focus") { | 581 | if (type == "focus") { |
578 | this.caseStudy.caseStudyDetails.focusAreas.push(this.focusName); | 582 | this.caseStudy.caseStudyDetails.focusAreas.push(this.focusName); |
579 | this.focusName = null; | 583 | this.focusName = null; |
580 | } else if (type == "insight") { | 584 | } else if (type == "insight") { |
581 | this.caseStudy.caseStudyDetails.insightTags.push(this.insightName); | 585 | this.caseStudy.caseStudyDetails.insightTags.push(this.insightName); |
582 | this.insightName = null; | 586 | this.insightName = null; |
583 | } | 587 | } |
584 | }, | 588 | }, |
585 | removeInsight(i, type) { | 589 | removeInsight(i, type) { |
586 | if (type == "focus") { | 590 | if (type == "focus") { |
587 | this.caseStudy.caseStudyDetails.focusAreas.splice(i, 1); | 591 | this.caseStudy.caseStudyDetails.focusAreas.splice(i, 1); |
588 | } else if (type == "insight") { | 592 | } else if (type == "insight") { |
589 | this.caseStudy.caseStudyDetails.insightTags.splice(i, 1); | 593 | this.caseStudy.caseStudyDetails.insightTags.splice(i, 1); |
590 | } | 594 | } |
591 | }, | 595 | }, |
592 | 596 | ||
593 | async slideSelected(i) { | 597 | async slideSelected(i) { |
594 | console.log("id is", this.templateList[i]); | 598 | console.log("id is", this.templateList[i]); |
595 | var slideMetadata = {}; | 599 | var slideMetadata = {}; |
600 | var obj = Object.assign( this.templateList[i],{}); | ||
596 | // slideMetadata = await this.getMeatda(this.templateList[i]._id); | 601 | // slideMetadata = await this.getMeatda(this.templateList[i]._id); |
597 | this.slideId = null; | 602 | this.slideId = null; |
598 | // this.templateList[i].metaData = slideMetadata.metaData; | 603 | // this.templateList[i].metaData = slideMetadata.metaData; |
599 | this.caseStudy.slides.push(this.templateList[i]); | 604 | this.caseStudy.slides.push(obj); |
600 | console.log("this.caseStudy.slides", this.caseStudy.slides); | 605 | console.log("this.caseStudy.slides", this.caseStudy.slides); |
601 | }, | 606 | }, |
602 | async insightSelected(data) { | 607 | async insightSelected(data) { |
603 | 608 | ||
604 | // this.caseStudy.slides.push(this.templateList[i]); | 609 | // this.caseStudy.slides.push(this.templateList[i]); |
605 | 610 | ||
606 | console.log("data",data); | 611 | console.log("data",data); |
607 | data.insightId = this.insightId; | 612 | data.insightId = this.insightId; |
608 | this.insightId = null; | 613 | this.insightId = null; |
609 | }, | 614 | }, |
610 | 615 | ||
611 | removeSlide(i) { | 616 | removeSlide(i) { |
612 | this.caseStudy.slides.splice(i, 1); | 617 | this.caseStudy.slides.splice(i, 1); |
613 | }, | 618 | }, |
614 | 619 | ||
615 | createImage(type) { | 620 | createImage(type) { |
616 | var that = this; | 621 | var that = this; |
617 | console.log(document.getElementById(type)); | 622 | console.log(document.getElementById(type)); |
618 | var file = document.getElementById(type).files[0]; | 623 | var file = document.getElementById(type).files[0]; |
619 | console.log("file", file); | 624 | console.log("file", file); |
620 | var reader = new FileReader(); | 625 | var reader = new FileReader(); |
621 | reader.onload = function (e) { | 626 | reader.onload = function (e) { |
622 | console.log("e.target.result ", e.target.result); | 627 | console.log("e.target.result ", e.target.result); |
623 | that.uploadImage(type, e.target.result); | 628 | that.uploadImage(type, e.target.result); |
624 | }; | 629 | }; |
625 | reader.onerror = function (error) { | 630 | reader.onerror = function (error) { |
626 | alert(error); | 631 | alert(error); |
627 | }; | 632 | }; |
628 | if (file) { | 633 | if (file) { |
629 | reader.readAsDataURL(file); | 634 | reader.readAsDataURL(file); |
630 | } | 635 | } |
631 | }, | 636 | }, |
632 | uploadImage(type, base64) { | 637 | uploadImage(type, base64) { |
633 | console.log("type", type); | 638 | console.log("type", type); |
634 | var obj = { | 639 | var obj = { |
635 | image: base64, | 640 | image: base64, |
636 | }; | 641 | }; |
637 | axios | 642 | axios |
638 | .post("/superAdmin/uploadImage", obj, { | 643 | .post("/superAdmin/uploadImage", obj, { |
639 | headers: { | 644 | headers: { |
640 | Authorization: "Bearer " + this.usertoken, | 645 | Authorization: "Bearer " + this.usertoken, |
641 | }, | 646 | }, |
642 | }) | 647 | }) |
643 | .then((response) => { | 648 | .then((response) => { |
644 | if (type == "logo") { | 649 | if (type == "logo") { |
645 | 650 | ||
646 | setTimeout(() => this.caseStudy.caseStudyDetails.intro.logoURL = response.data.data, 99); | 651 | setTimeout(() => this.caseStudy.caseStudyDetails.intro.logoURL = response.data.data, 99); |
647 | } else if (type == "outdor") { | 652 | } else if (type == "outdor") { |
648 | this.caseStudy.caseStudyDetails.outro.authorImage = []; | 653 | this.caseStudy.caseStudyDetails.outro.authorImage = []; |
649 | setTimeout(() => this.caseStudy.caseStudyDetails.outro.authorImage.push( | 654 | setTimeout(() => this.caseStudy.caseStudyDetails.outro.authorImage.push( |
650 | response.data.data | 655 | response.data.data |
651 | ), 99); | 656 | ), 99); |
652 | 657 | ||
653 | } | 658 | } |
654 | 659 | ||
655 | console.log(response.data.data); | 660 | console.log(response.data.data); |
656 | console.log(this.caseStudy); | 661 | console.log(this.caseStudy); |
657 | }) | 662 | }) |
658 | .catch((error) => { | 663 | .catch((error) => { |
659 | if (error.response) { | 664 | if (error.response) { |
660 | this.$toaster.error(error.response.data.message); | 665 | this.$toaster.error(error.response.data.message); |
661 | } | 666 | } |
662 | }); | 667 | }); |
663 | }, | 668 | }, |
664 | 669 | ||
665 | fieldcreateImage(i, j) { | 670 | fieldcreateImage(i, j) { |
666 | console.log("i", i); | 671 | console.log("i", i); |
667 | console.log("j", j); | 672 | console.log("j", j); |
668 | var that = this; | 673 | var that = this; |
669 | var id = i + "" + j; | 674 | var id = i + "" + j; |
670 | console.log(document.getElementById(id)); | 675 | console.log(document.getElementById(id)); |
671 | var file = document.getElementById(id).files[0]; | 676 | var file = document.getElementById(id).files[0]; |
672 | // var file = document.querySelector("input[type=file]").files[0]; | 677 | // var file = document.querySelector("input[type=file]").files[0]; |
673 | console.log("file", file); | 678 | console.log("file", file); |
674 | var reader = new FileReader(); | 679 | var reader = new FileReader(); |
675 | reader.onload = function (e) { | 680 | reader.onload = function (e) { |
676 | // console.log("e.target.result ",e.target.result ) | 681 | // console.log("e.target.result ",e.target.result ) |
677 | that.fielduploadImage(i, j, e.target.result); | 682 | that.fielduploadImage(i, j, e.target.result); |
678 | }; | 683 | }; |
679 | reader.onerror = function (error) { | 684 | reader.onerror = function (error) { |
680 | alert(error); | 685 | alert(error); |
681 | }; | 686 | }; |
682 | if (file) { | 687 | if (file) { |
683 | reader.readAsDataURL(file); | 688 | reader.readAsDataURL(file); |
684 | } | 689 | } |
685 | }, | 690 | }, |
686 | fielduploadImage(i, j, base64) { | 691 | fielduploadImage(i, j, base64) { |
687 | var obj = { | 692 | var obj = { |
688 | image: base64, | 693 | image: base64, |
689 | }; | 694 | }; |
690 | axios | 695 | axios |
691 | .post("/superAdmin/uploadImage", obj, { | 696 | .post("/superAdmin/uploadImage", obj, { |
692 | headers: { | 697 | headers: { |
693 | Authorization: "Bearer " + this.usertoken, | 698 | Authorization: "Bearer " + this.usertoken, |
694 | }, | 699 | }, |
695 | }) | 700 | }) |
696 | .then((response) => { | 701 | .then((response) => { |
697 | setTimeout(() => this.caseStudy.slides[i].metaData.fields[j].fieldValue = | 702 | setTimeout(() => this.caseStudy.slides[i].metaData.fields[j].fieldValue = |
698 | response.data.data, 10); | 703 | response.data.data, 10); |
699 | 704 | ||
700 | 705 | ||
701 | console.log(response.data.data); | 706 | console.log(response.data.data); |
702 | console.log(this.caseStudy); | 707 | console.log(this.caseStudy); |
703 | }) | 708 | }) |
704 | .catch((error) => { | 709 | .catch((error) => { |
705 | if (error.response) { | 710 | if (error.response) { |
706 | this.$toaster.error(error.response.data.message); | 711 | this.$toaster.error(error.response.data.message); |
707 | } | 712 | } |
708 | }); | 713 | }); |
709 | }, | 714 | }, |
710 | 715 | ||
711 | getUserList() { | 716 | getUserList() { |
712 | axios | 717 | axios |
713 | .get("/superAdmin/users", { | 718 | .get("/superAdmin/users", { |
714 | headers: { | 719 | headers: { |
715 | Authorization: "Bearer " + this.usertoken, | 720 | Authorization: "Bearer " + this.usertoken, |
716 | }, | 721 | }, |
717 | }) | 722 | }) |
718 | .then((response) => { | 723 | .then((response) => { |
719 | response.data.data.forEach((element) => { | 724 | response.data.data.forEach((element) => { |
720 | if (element.name) { | 725 | if (element.name) { |
721 | this.userList.push(element); | 726 | this.userList.push(element); |
722 | } | 727 | } |
723 | }); | 728 | }); |
724 | console.log("response", this.userList); | 729 | console.log("response", this.userList); |
725 | }) | 730 | }) |
726 | .catch((error) => console.log(error)); | 731 | .catch((error) => console.log(error)); |
727 | }, | 732 | }, |
728 | 733 | ||
729 | getTemplateList() { | 734 | getTemplateList() { |
730 | axios | 735 | axios |
731 | .get("/superAdmin/templates", { | 736 | .get("/superAdmin/templates", { |
732 | headers: { | 737 | headers: { |
733 | Authorization: "Bearer " + this.usertoken, | 738 | Authorization: "Bearer " + this.usertoken, |
734 | }, | 739 | }, |
735 | }) | 740 | }) |
736 | .then((response) => { | 741 | .then((response) => { |
737 | response.data.data.forEach((temp) => { | 742 | response.data.data.forEach((temp) => { |
738 | if ( | 743 | if ( |
739 | temp._id != "INTRO_oqkdMOVDrwRptsdWJ6Ye" && | 744 | temp._id != "INTRO_oqkdMOVDrwRptsdWJ6Ye" && |
740 | temp._id != "OUTRO_oqkdMOVDrwRptsdWJ6Ye" | 745 | temp._id != "OUTRO_oqkdMOVDrwRptsdWJ6Ye" |
741 | ) { | 746 | ) { |
742 | if (temp.bounceBoard) { | 747 | if (temp.bounceBoard) { |
743 | for (var i = 0; i < temp.commentBox; i++) { | 748 | for (var i = 0; i < temp.commentBox; i++) { |
744 | temp.metaData.comments.push({ | 749 | temp.metaData.comments.push({ |
745 | userId: null, | 750 | userId: null, |
746 | slideId: null, | 751 | slideId: null, |
747 | caseStudyId: null, | 752 | caseStudyId: null, |
748 | comment: null, | 753 | comment: null, |
749 | }); | 754 | }); |
750 | } | 755 | } |
751 | } | 756 | } |
752 | this.templateList.push(temp); | 757 | this.templateList.push(temp); |
753 | } | 758 | } |
754 | }); | 759 | }); |
755 | if (this.editMode) { | 760 | if (this.editMode) { |
756 | this.getSLideData(); | 761 | this.getSLideData(); |
757 | } | 762 | } |
758 | console.log("templates", this.templateList); | 763 | console.log("templates", this.templateList); |
759 | }) | 764 | }) |
760 | .catch((error) => console.log(error)); | 765 | .catch((error) => console.log(error)); |
761 | }, | 766 | }, |
762 | getInsightList() { | 767 | getInsightList() { |
763 | axios | 768 | axios |
764 | .get("/superAdmin/insight", { | 769 | .get("/superAdmin/insight", { |
765 | headers: { | 770 | headers: { |
766 | Authorization: "Bearer " + this.usertoken, | 771 | Authorization: "Bearer " + this.usertoken, |
767 | }, | 772 | }, |
768 | }) | 773 | }) |
769 | .then((response) => { | 774 | .then((response) => { |
770 | this.insightList = response.data.data; | 775 | this.insightList = response.data.data; |
771 | 776 | ||
772 | console.log("insight", response.data.data); | 777 | console.log("insight", response.data.data); |
773 | }) | 778 | }) |
774 | .catch((error) => console.log(error)); | 779 | .catch((error) => console.log(error)); |
775 | }, | 780 | }, |
776 | 781 | ||
777 | getSLideData() { | 782 | getSLideData() { |
778 | axios | 783 | axios |
779 | .get("/superAdmin/caseStudySlides?caseStudyId=" + this.caseId, { | 784 | .get("/superAdmin/caseStudySlides?caseStudyId=" + this.caseId, { |
780 | headers: { | 785 | headers: { |
781 | Authorization: "Bearer " + this.usertoken, | 786 | Authorization: "Bearer " + this.usertoken, |
782 | }, | 787 | }, |
783 | }) | 788 | }) |
784 | .then((response) => { | 789 | .then((response) => { |
785 | var finalArray = []; | 790 | var finalArray = []; |
786 | response.data.data.forEach((template_) => { | 791 | response.data.data.forEach((template_) => { |
787 | var keys = []; | 792 | var keys = []; |
788 | var i = this.templateList.findIndex( | 793 | var i = this.templateList.findIndex( |
789 | (temp_) => temp_._id == template_.templateId | 794 | (temp_) => temp_._id == template_.templateId |
790 | ); | 795 | ); |
791 | var obj = { | 796 | var obj = { |
792 | _id: this.templateList[i]._id, | 797 | _id: this.templateList[i]._id, |
793 | bounceBoard: this.templateList[i].bounceBoard, | 798 | bounceBoard: this.templateList[i].bounceBoard, |
794 | insight: this.templateList[i].insight, | 799 | insight: this.templateList[i].insight, |
795 | slideId:template_._id, | 800 | slideId:template_._id, |
796 | // commentBox: this.templateList[i].commentBox, | 801 | // commentBox: this.templateList[i].commentBox, |
797 | metaData: { | 802 | metaData: { |
798 | fields: [], | 803 | fields: [], |
799 | comments: [], | 804 | comments: [], |
800 | }, | 805 | }, |
801 | }; | 806 | }; |
802 | if (this.templateList[i].bounceBoard) { | 807 | if (this.templateList[i].bounceBoard) { |
803 | obj.commentBox = this.templateList[i].commentBox; | 808 | obj.commentBox = this.templateList[i].commentBox; |
804 | } | 809 | } |
805 | if (this.templateList[i].insight) { | 810 | if (this.templateList[i].insight) { |
806 | obj.insightId = template_.insightId; | 811 | obj.insightId = template_.insightId; |
807 | } | 812 | } |
808 | var fieldArray = []; | 813 | var fieldArray = []; |
809 | this.templateList[i].metaData.fields.forEach((element) => { | 814 | this.templateList[i].metaData.fields.forEach((element) => { |
810 | var fieldobj = { | 815 | var fieldobj = { |
811 | fieldName: element.fieldName, | 816 | fieldName: element.fieldName, |
812 | displayName: element.displayName, | 817 | displayName: element.displayName, |
813 | fieldValue: template_.metaData[element.fieldName], | 818 | fieldValue: template_.metaData[element.fieldName], |
814 | fieldType: element.fieldType, | 819 | fieldType: element.fieldType, |
815 | }; | 820 | }; |
816 | obj.metaData.fields.push(fieldobj); | 821 | obj.metaData.fields.push(fieldobj); |
817 | }); | 822 | }); |
818 | finalArray.push(obj); | 823 | finalArray.push(obj); |
819 | }); | 824 | }); |
820 | this.caseStudy.slides = finalArray; | 825 | this.caseStudy.slides = finalArray; |
821 | console.log("----", finalArray); | 826 | console.log("----", finalArray); |
822 | console.log(this.templateList, "getSLideData==>"); | 827 | console.log(this.templateList, "getSLideData==>"); |
823 | }) | 828 | }) |
824 | .catch((error) => console.log(error)); | 829 | .catch((error) => console.log(error)); |
825 | }, | 830 | }, |
826 | 831 | ||
827 | submit() { | 832 | submit() { |
828 | const latest = Object.create(this.caseStudy); | 833 | const latest = Object.create(this.caseStudy); |
829 | 834 | ||
830 | var slidArray = []; | 835 | var slidArray = []; |
831 | latest.slides.forEach((slides) => { | 836 | latest.slides.forEach((slides) => { |
832 | console.log("slides", slides); | 837 | console.log("slides", slides); |
833 | var slideData = {}; | 838 | var slideData = {}; |
834 | slideData.templateId = slides._id; | 839 | slideData.templateId = slides._id; |
835 | slideData.bounceBoard = slides.bounceBoard; | 840 | slideData.bounceBoard = slides.bounceBoard; |
836 | slideData.insight = slides.insight; | 841 | slideData.insight = slides.insight; |
837 | if(slides.slideId){ | 842 | if(slides.slideId){ |
838 | slideData.slideId = slides.slideId; | 843 | slideData.slideId = slides.slideId; |
839 | 844 | ||
840 | } | 845 | } |
841 | if(slides.insightId){ | 846 | if(slides.insightId){ |
842 | slideData.insightId = slides.insightId; | 847 | slideData.insightId = slides.insightId; |
843 | 848 | ||
844 | } | 849 | } |
845 | if (slides.metaData.comments && slides.metaData.comments.length > 0) { | 850 | if (slides.metaData.comments && slides.metaData.comments.length > 0) { |
846 | slideData.comments = slides.metaData.comments; | 851 | slideData.comments = slides.metaData.comments; |
847 | // this.getSLideData(); | 852 | // this.getSLideData(); |
848 | } | 853 | } |
849 | // var comments = []; | 854 | // var comments = []; |
850 | // if (slides.bounceBoard) { | 855 | // if (slides.bounceBoard) { |
851 | // slides.metaData.comments.forEach((element) => { | 856 | // slides.metaData.comments.forEach((element) => { |
852 | // comments.push(element.comment); | 857 | // comments.push(element.comment); |
853 | // }); | 858 | // }); |
854 | // slideData.comments = comments; | 859 | // slideData.comments = comments; |
855 | // } | 860 | // } |
856 | 861 | ||
857 | slides.metaData.fields.forEach((fields_) => { | 862 | slides.metaData.fields.forEach((fields_) => { |
858 | slideData[fields_.fieldName] = fields_.fieldValue; | 863 | slideData[fields_.fieldName] = fields_.fieldValue; |
859 | }); | 864 | }); |
860 | slidArray.push(slideData); | 865 | slidArray.push(slideData); |
861 | // delete slides.metaData.fields; | 866 | // delete slides.metaData.fields; |
862 | }); | 867 | }); |
863 | 868 | ||
864 | console.log("slideData", slidArray); | 869 | console.log("slideData", slidArray); |
865 | if (this.editMode) { | 870 | if (this.editMode) { |
866 | this.updateProfile(slidArray); | 871 | this.updateProfile(slidArray); |
867 | }else{ | 872 | }else{ |
868 | this.saveProfile(slidArray); | 873 | this.saveProfile(slidArray); |
869 | } | 874 | } |
870 | }, | 875 | }, |
871 | 876 | ||
872 | saveProfile(slides) { | 877 | saveProfile(slides) { |
873 | var obj = {}; | 878 | var obj = {}; |
874 | obj.caseStudyDetails = this.caseStudy.caseStudyDetails; | 879 | obj.caseStudyDetails = this.caseStudy.caseStudyDetails; |
875 | obj.caseStudyDetails.intro.readTime = Math.round( | 880 | obj.caseStudyDetails.intro.readTime = Math.round( |
876 | slides.length / 3 | 881 | slides.length / 3 |
877 | ).toString(); | 882 | ).toString(); |
878 | obj.slides = slides; | 883 | obj.slides = slides; |
879 | axios | 884 | axios |
880 | .post("/superAdmin/caseStudy", obj, { | 885 | .post("/superAdmin/caseStudy", obj, { |
881 | headers: { | 886 | headers: { |
882 | Authorization: "Bearer " + this.usertoken, | 887 | Authorization: "Bearer " + this.usertoken, |
883 | }, | 888 | }, |
884 | }) | 889 | }) |
885 | .then((response) => { | 890 | .then((response) => { |
886 | // this.userData = response.data.data; | 891 | // this.userData = response.data.data; |
887 | this.$toaster.success("Case Study Created"); | 892 | this.$toaster.success("Case Study Created"); |
888 | this.$router.go(this.$router.currentRoute) | 893 | this.$router.go(this.$router.currentRoute) |
889 | 894 | ||
890 | console.log(response); | 895 | console.log(response); |
891 | }) | 896 | }) |
892 | .catch((error) => { | 897 | .catch((error) => { |
893 | if (error.response) { | 898 | if (error.response) { |
894 | this.$toaster.error(error.response.data.message); | 899 | this.$toaster.error(error.response.data.message); |
895 | } | 900 | } |
896 | }); | 901 | }); |
897 | }, | 902 | }, |
898 | updateProfile(slides) { | 903 | updateProfile(slides) { |
899 | var obj = {}; | 904 | var obj = {}; |
900 | obj.caseStudyId = this.caseId, | 905 | obj.caseStudyId = this.caseId, |
901 | obj.caseStudyDetails = this.caseStudy.caseStudyDetails; | 906 | obj.caseStudyDetails = this.caseStudy.caseStudyDetails; |
902 | obj.caseStudyDetails.intro.readTime = Math.round( | 907 | obj.caseStudyDetails.intro.readTime = Math.round( |
903 | slides.length / 3 | 908 | slides.length / 3 |
904 | ).toString(); | 909 | ).toString(); |
905 | obj.slides = slides; | 910 | obj.slides = slides; |
911 | delete obj.caseStudyDetails.intro.focus; | ||
906 | axios | 912 | axios |
907 | .put("/superAdmin/caseStudy", obj, { | 913 | .put("/superAdmin/caseStudy", obj, { |
908 | headers: { | 914 | headers: { |
909 | Authorization: "Bearer " + this.usertoken, | 915 | Authorization: "Bearer " + this.usertoken, |
910 | }, | 916 | }, |
911 | }) | 917 | }) |
912 | .then((response) => { | 918 | .then((response) => { |
913 | // this.userData = response.data.data; | 919 | // this.userData = response.data.data; |
914 | this.$toaster.success("Case Study Updated"); | 920 | this.$toaster.success("Case Study Updated"); |
915 | this.$router.go(this.$router.currentRoute) | 921 | this.$router.go(this.$router.currentRoute) |
916 | 922 | ||
917 | 923 | ||
918 | console.log(response); | 924 | console.log(response); |
919 | }) | 925 | }) |
920 | .catch((error) => { | 926 | .catch((error) => { |
921 | if (error.response) { | 927 | if (error.response) { |
922 | this.$toaster.error(error.response.data.message); | 928 | this.$toaster.error(error.response.data.message); |
923 | } | 929 | } |
924 | }); | 930 | }); |
925 | }, | 931 | }, |
926 | listPage(url){ | 932 | listPage(url){ |
927 | this.$router.push(url); | 933 | this.$router.push(url); |
928 | }, | 934 | }, |
929 | 935 | ||
930 | addProfileDialog(slide) { | 936 | addProfileDialog(slide) { |
931 | console.log("slide",slide) | 937 | console.log("slide",slide) |
932 | this.templateImage = slide.templateImage; | 938 | this.templateImage = slide.templateImage; |
933 | $(".inner-wrp").addClass("body-blur"); | 939 | $(".inner-wrp").addClass("body-blur"); |
934 | $("#add-social-links").hide(); | 940 | $("#add-social-links").hide(); |
935 | $(".popup-wrp, #add-profile").show(); | 941 | $(".popup-wrp, #add-profile").show(); |
936 | }, | 942 | }, |
937 | 943 | ||
938 | closeDialog() { | 944 | closeDialog() { |
939 | this.templateImage = null; | 945 | this.templateImage = null; |
940 | $(".popup-wrp").hide(); | 946 | $(".popup-wrp").hide(); |
941 | $(".inner-wrp").removeClass("body-blur"); | 947 | $(".inner-wrp").removeClass("body-blur"); |
942 | // this.saveProfile(); | 948 | // this.saveProfile(); |
943 | }, | 949 | }, |
944 | hideDialog() { | 950 | hideDialog() { |
945 | this.templateImage = null; | 951 | this.templateImage = null; |
946 | $(".popup-wrp").hide(); | 952 | $(".popup-wrp").hide(); |
947 | $(".inner-wrp").removeClass("body-blur"); | 953 | $(".inner-wrp").removeClass("body-blur"); |
948 | }, | 954 | }, |
949 | 955 | ||
950 | async getMeatda(tempId) { | 956 | async getMeatda(tempId) { |
951 | var obj = [ | 957 | var obj = [ |
952 | { | 958 | { |
953 | tempId: "T1_RoeMG8130Xko1DvhC3Ou", | 959 | tempId: "T1_RoeMG8130Xko1DvhC3Ou", |
954 | metaData: { | 960 | metaData: { |
955 | fields: [ | 961 | fields: [ |
956 | { | 962 | { |
957 | fieldName: "authorImage", | 963 | fieldName: "authorImage", |
958 | displayName: "Author Image", | 964 | displayName: "Author Image", |
959 | fieldValue: null, | 965 | fieldValue: null, |
960 | fieldType: "image", | 966 | fieldType: "image", |
961 | }, | 967 | }, |
962 | { | 968 | { |
963 | fieldName: "mobileImage", | 969 | fieldName: "mobileImage", |
964 | displayName: "Mobile Image", | 970 | displayName: "Mobile Image", |
965 | fieldValue: null, | 971 | fieldValue: null, |
966 | fieldType: "image", | 972 | fieldType: "image", |
967 | }, | 973 | }, |
968 | { | 974 | { |
969 | fieldName: "textBox", | 975 | fieldName: "textBox", |
970 | displayName: "Text Box", | 976 | displayName: "Text Box", |
971 | fieldValue: null, | 977 | fieldValue: null, |
972 | fieldType: "text", | 978 | fieldType: "text", |
973 | }, | 979 | }, |
974 | ], | 980 | ], |
975 | }, | 981 | }, |
976 | }, | 982 | }, |
977 | { | 983 | { |
978 | tempId: "T2_ROsUOEy3vxsRAiQ72XdI", | 984 | tempId: "T2_ROsUOEy3vxsRAiQ72XdI", |
979 | metaData: { | 985 | metaData: { |
980 | fields: [ | 986 | fields: [ |
981 | { | 987 | { |
982 | fieldName: "authorImage", | 988 | fieldName: "authorImage", |
983 | displayName: "Author Image", | 989 | displayName: "Author Image", |
984 | fieldValue: null, | 990 | fieldValue: null, |
985 | fieldType: "image", | 991 | fieldType: "image", |
986 | }, | 992 | }, |
987 | ], | 993 | ], |
988 | comments: [{ comment: null }, { comment: null }, { comment: null }], | 994 | comments: [{ comment: null }, { comment: null }, { comment: null }], |
989 | }, | 995 | }, |
990 | }, | 996 | }, |
991 | { | 997 | { |
992 | tempId: "T3_cqNIf7tuqL4jyON63dA7", | 998 | tempId: "T3_cqNIf7tuqL4jyON63dA7", |
993 | metaData: { | 999 | metaData: { |
994 | fields: [ | 1000 | fields: [ |
995 | { | 1001 | { |
996 | fieldName: "authorImage", | 1002 | fieldName: "authorImage", |
997 | displayName: "Author Image", | 1003 | displayName: "Author Image", |
998 | fieldValue: null, | 1004 | fieldValue: null, |
999 | fieldType: "image", | 1005 | fieldType: "image", |
1000 | }, | 1006 | }, |
1001 | { | 1007 | { |
1002 | fieldName: "mobileImage", | 1008 | fieldName: "mobileImage", |
1003 | displayName: "Mobile Image", | 1009 | displayName: "Mobile Image", |
1004 | fieldValue: null, | 1010 | fieldValue: null, |
1005 | fieldType: "image", | 1011 | fieldType: "image", |
1006 | }, | 1012 | }, |
1007 | ], | 1013 | ], |
1008 | comments: [ | 1014 | comments: [ |
1009 | { comment: null }, | 1015 | { comment: null }, |
1010 | { comment: null }, | 1016 | { comment: null }, |
1011 | { comment: null }, | 1017 | { comment: null }, |
1012 | { comment: null }, | 1018 | { comment: null }, |
1013 | ], | 1019 | ], |
1014 | }, | 1020 | }, |
1015 | }, | 1021 | }, |
1016 | ]; | 1022 | ]; |
1017 | var i = obj.findIndex((obj_) => obj_.tempId == tempId); | 1023 | var i = obj.findIndex((obj_) => obj_.tempId == tempId); |
1018 | return obj[i]; | 1024 | return obj[i]; |
1019 | }, | 1025 | }, |
1020 | }, | 1026 | }, |
1021 | }; | 1027 | }; |
1022 | </script> | 1028 | </script> |