Commit 37f413ce84009268703055c2cd45fae13666c456
1 parent
0f877e866e
Exists in
admin
fixed select slide value
Showing
1 changed file
with
2 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')" | 205 | v-on:keyup.enter="addInsight('focus')" |
206 | 206 | ||
207 | /> | 207 | /> |
208 | <a href="javascript:void(0);" @click="addInsight('focus')" | 208 | <a href="javascript:void(0);" @click="addInsight('focus')" |
209 | ><img src="../assets/images/plus-circle.svg" | 209 | ><img src="../assets/images/plus-circle.svg" |
210 | /></a> | 210 | /></a> |
211 | </li> | 211 | </li> |
212 | 212 | ||
213 | <li | 213 | <li |
214 | v-for="(interest, i) in caseStudy.caseStudyDetails.focusAreas" | 214 | v-for="(interest, i) in caseStudy.caseStudyDetails.focusAreas" |
215 | :key="i" | 215 | :key="i" |
216 | > | 216 | > |
217 | <span>{{ interest }}</span> | 217 | <span>{{ interest }}</span> |
218 | <a | 218 | <a |
219 | href="javascript:void(0);" | 219 | href="javascript:void(0);" |
220 | @click="removeInsight(i, 'focus')" | 220 | @click="removeInsight(i, 'focus')" |
221 | class="cat-minus" | 221 | class="cat-minus" |
222 | ><img src="../assets/images/minus.svg" | 222 | ><img src="../assets/images/minus.svg" |
223 | /></a> | 223 | /></a> |
224 | </li> | 224 | </li> |
225 | </ul> | 225 | </ul> |
226 | </div> | 226 | </div> |
227 | </div> | 227 | </div> |
228 | 228 | ||
229 | <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"> |
230 | <div class="form-group floating-label"> | 230 | <div class="form-group floating-label"> |
231 | <label for="lname" class="lname">Select Insight Tags</label> | 231 | <label for="lname" class="lname">Select Insight Tags</label> |
232 | <select | 232 | <select |
233 | class="form-control" | 233 | class="form-control" |
234 | v-model="insightName" | 234 | v-model="insightName" |
235 | @change="addInsight('insight')" | 235 | @change="addInsight('insight')" |
236 | > | 236 | > |
237 | <option value="null">Select Insight Tag</option> | 237 | <option value="null">Select Insight Tag</option> |
238 | <option value="Design">Design</option> | 238 | <option value="Design">Design</option> |
239 | <option value="Product">Product</option> | 239 | <option value="Product">Product</option> |
240 | <option value="Marketing">Marketing</option> | 240 | <option value="Marketing">Marketing</option> |
241 | <option value="Pricing">Pricing</option> | 241 | <option value="Pricing">Pricing</option> |
242 | <option value="Psychology">Psychology</option> | 242 | <option value="Psychology">Psychology</option> |
243 | </select> | 243 | </select> |
244 | </div> | 244 | </div> |
245 | </div> | 245 | </div> |
246 | <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"> |
247 | <div class="form-group floating-label"> | 247 | <div class="form-group floating-label"> |
248 | <label for="lname" class="lname"></label> | 248 | <label for="lname" class="lname"></label> |
249 | <ul class="interests"> | 249 | <ul class="interests"> |
250 | <li | 250 | <li |
251 | v-for="(interest, i) in caseStudy.caseStudyDetails.insightTags" | 251 | v-for="(interest, i) in caseStudy.caseStudyDetails.insightTags" |
252 | :key="i" | 252 | :key="i" |
253 | > | 253 | > |
254 | <span>{{ interest }}</span> | 254 | <span>{{ interest }}</span> |
255 | <a | 255 | <a |
256 | href="javascript:void(0);" | 256 | href="javascript:void(0);" |
257 | @click="removeInsight(i, 'insight')" | 257 | @click="removeInsight(i, 'insight')" |
258 | class="cat-minus" | 258 | class="cat-minus" |
259 | ><img src="../assets/images/minus.svg" | 259 | ><img src="../assets/images/minus.svg" |
260 | /></a> | 260 | /></a> |
261 | </li> | 261 | </li> |
262 | </ul> | 262 | </ul> |
263 | </div> | 263 | </div> |
264 | </div> | 264 | </div> |
265 | </div> | 265 | </div> |
266 | <!-- 3rd row end --> | 266 | <!-- 3rd row end --> |
267 | 267 | ||
268 | <!-- outdor --> | 268 | <!-- outdor --> |
269 | <div class="row profile-tab-spc-top"> | 269 | <div class="row profile-tab-spc-top"> |
270 | <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"> |
271 | <ul class="navbar-nav mr-auto"> | 271 | <ul class="navbar-nav mr-auto"> |
272 | <li class="nav-item active"> | 272 | <li class="nav-item active"> |
273 | <h5 class="nav-link">Outro Screen Record</h5> | 273 | <h5 class="nav-link">Outro Screen Record</h5> |
274 | </li> | 274 | </li> |
275 | </ul> | 275 | </ul> |
276 | </div> | 276 | </div> |
277 | </div> | 277 | </div> |
278 | 278 | ||
279 | <!-- 1st row --> | 279 | <!-- 1st row --> |
280 | <div class="row"> | 280 | <div class="row"> |
281 | <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"> |
282 | <div class="form-group floating-label"> | 282 | <div class="form-group floating-label"> |
283 | <label for="lname" class="lname">Designer Name</label> | 283 | <label for="lname" class="lname">Designer Name</label> |
284 | <input | 284 | <input |
285 | type="text" | 285 | type="text" |
286 | class="form-control" | 286 | class="form-control" |
287 | value="" | 287 | value="" |
288 | placeholder=" " | 288 | placeholder=" " |
289 | v-model="caseStudy.caseStudyDetails.outro.designer" | 289 | v-model="caseStudy.caseStudyDetails.outro.designer" |
290 | /> | 290 | /> |
291 | </div> | 291 | </div> |
292 | </div> | 292 | </div> |
293 | 293 | ||
294 | <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"> |
295 | <div class="form-group floating-label"> | 295 | <div class="form-group floating-label"> |
296 | <label for="lname" class="lname">Illustrations Name</label> | 296 | <label for="lname" class="lname">Illustrations Name</label> |
297 | <input | 297 | <input |
298 | type="text" | 298 | type="text" |
299 | class="form-control" | 299 | class="form-control" |
300 | value="" | 300 | value="" |
301 | placeholder=" " | 301 | placeholder=" " |
302 | v-model="caseStudy.caseStudyDetails.outro.illustrations" | 302 | v-model="caseStudy.caseStudyDetails.outro.illustrations" |
303 | /> | 303 | /> |
304 | </div> | 304 | </div> |
305 | </div> | 305 | </div> |
306 | 306 | ||
307 | <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"> |
308 | <div class="form-group floating-label"> | 308 | <div class="form-group floating-label"> |
309 | <label for="lname" class="lname"> Author Image</label> | 309 | <label for="lname" class="lname"> Author Image</label> |
310 | <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]" |
311 | /> | 311 | /> |
312 | <input | 312 | <input |
313 | @change="createImage('outdor')" | 313 | @change="createImage('outdor')" |
314 | type="file" | 314 | type="file" |
315 | name="photos" | 315 | name="photos" |
316 | id="outdor" | 316 | id="outdor" |
317 | accept="image/*" | 317 | accept="image/*" |
318 | /> | 318 | /> |
319 | </div> | 319 | </div> |
320 | </div> | 320 | </div> |
321 | </div> | 321 | </div> |
322 | <!-- 1st row --> | 322 | <!-- 1st row --> |
323 | <!-- outdoor ends --> | 323 | <!-- outdoor ends --> |
324 | 324 | ||
325 | <!-- outdor --> | 325 | <!-- outdor --> |
326 | <div class="row profile-tab-spc-top"> | 326 | <div class="row profile-tab-spc-top"> |
327 | <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"> |
328 | <ul class="navbar-nav mr-auto"> | 328 | <ul class="navbar-nav mr-auto"> |
329 | <li class="nav-item active"> | 329 | <li class="nav-item active"> |
330 | <h5 class="nav-link">Add SLides</h5> | 330 | <h5 class="nav-link">Add SLides</h5> |
331 | </li> | 331 | </li> |
332 | </ul> | 332 | </ul> |
333 | </div> | 333 | </div> |
334 | </div> | 334 | </div> |
335 | 335 | ||
336 | 336 | ||
337 | 337 | ||
338 | <!-- case study slides--> | 338 | <!-- case study slides--> |
339 | <div | 339 | <div |
340 | class="row profile-tab-spc-top" | 340 | class="row profile-tab-spc-top" |
341 | v-for="(slide, i) in caseStudy.slides" | 341 | v-for="(slide, i) in caseStudy.slides" |
342 | :key="i" | 342 | :key="i" |
343 | > | 343 | > |
344 | <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"> |
345 | <ul class="navbar-nav mr-auto"> | 345 | <ul class="navbar-nav mr-auto"> |
346 | <li class="nav-item active"> | 346 | <li class="nav-item active"> |
347 | <p class="nav-link"> | 347 | <p class="nav-link"> |
348 | <b>Screen {{ i + 1 }}</b> | 348 | <b>Screen {{ i + 1 }}</b> |
349 | <a | 349 | <a |
350 | style="cursor: pointer; color: red; font-size: 0.8rem" | 350 | style="cursor: pointer; color: red; font-size: 0.8rem" |
351 | @click="removeSlide(i)" | 351 | @click="removeSlide(i)" |
352 | > | 352 | > |
353 | Remove</a | 353 | Remove</a |
354 | > | 354 | > |
355 | <a | 355 | <a |
356 | style="cursor: pointer; color: blue; font-size: 0.8rem" | 356 | style="cursor: pointer; color: blue; font-size: 0.8rem" |
357 | @click="addProfileDialog(slide)" | 357 | @click="addProfileDialog(slide)" |
358 | > | 358 | > |
359 | View</a | 359 | View</a |
360 | > | 360 | > |
361 | </p> | 361 | </p> |
362 | </li> | 362 | </li> |
363 | <li class="nav-item active" v-if="slide.insight"> | 363 | <li class="nav-item active" v-if="slide.insight"> |
364 | <div class="form-group floating-label"> | 364 | <div class="form-group floating-label"> |
365 | <label for="lname" class="lname">Insight</label> | 365 | <label for="lname" class="lname">Insight</label> |
366 | <select | 366 | <select |
367 | class="form-control" | 367 | class="form-control" |
368 | v-model="insightId" | 368 | v-model="insightId" |
369 | v-on:change="insightSelected(slide)" | 369 | v-on:change="insightSelected(slide)" |
370 | > | 370 | > |
371 | <option value="null">Select Insight</option> | 371 | <option value="null">Select Insight</option> |
372 | <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"> |
373 | {{ insight._id }} | 373 | {{ insight.title }} |
374 | </option> | 374 | </option> |
375 | </select> | 375 | </select> |
376 | </div> | 376 | </div> |
377 | </li> | 377 | </li> |
378 | </ul> | 378 | </ul> |
379 | </div> | 379 | </div> |
380 | 380 | ||
381 | 381 | ||
382 | 382 | ||
383 | 383 | ||
384 | 384 | ||
385 | 385 | ||
386 | <div class="row"> | 386 | <div class="row"> |
387 | <div | 387 | <div |
388 | 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" |
389 | v-for="(field, j) in slide.metaData.fields" | 389 | v-for="(field, j) in slide.metaData.fields" |
390 | :key="j" | 390 | :key="j" |
391 | > | 391 | > |
392 | <div | 392 | <div |
393 | class="form-group floating-label" | 393 | class="form-group floating-label" |
394 | v-if="field.fieldType == 'text'" | 394 | v-if="field.fieldType == 'text'" |
395 | > | 395 | > |
396 | <label for="lname" class="lname">{{ field.displayName }}</label> | 396 | <label for="lname" class="lname">{{ field.displayName }}</label> |
397 | <input | 397 | <input |
398 | type="text" | 398 | type="text" |
399 | class="form-control" | 399 | class="form-control" |
400 | value="" | 400 | value="" |
401 | placeholder=" " | 401 | placeholder=" " |
402 | v-model="field.fieldValue" | 402 | v-model="field.fieldValue" |
403 | /> | 403 | /> |
404 | </div> | 404 | </div> |
405 | 405 | ||
406 | <div | 406 | <div |
407 | class="form-group floating-label" | 407 | class="form-group floating-label" |
408 | v-if="field.fieldType == 'image'" | 408 | v-if="field.fieldType == 'image'" |
409 | > | 409 | > |
410 | <label for="lname" class="lname"> {{ field.displayName }}</label> | 410 | <label for="lname" class="lname"> {{ field.displayName }}</label> |
411 | <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" |
412 | /> | 412 | /> |
413 | <input | 413 | <input |
414 | @change="fieldcreateImage(i, j)" | 414 | @change="fieldcreateImage(i, j)" |
415 | type="file" | 415 | type="file" |
416 | name="photo" | 416 | name="photo" |
417 | :id="i + '' + j" | 417 | :id="i + '' + j" |
418 | accept="image/*" | 418 | accept="image/*" |
419 | /> | 419 | /> |
420 | </div> | 420 | </div> |
421 | </div> | 421 | </div> |
422 | </div> | 422 | </div> |
423 | 423 | ||
424 | <div class="row"> | 424 | <div class="row"> |
425 | <div | 425 | <div |
426 | 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" |
427 | v-for="(cum, j) in slide.metaData.comments" | 427 | v-for="(cum, j) in slide.metaData.comments" |
428 | :key="j" | 428 | :key="j" |
429 | > | 429 | > |
430 | <div class="form-group floating-label"> | 430 | <div class="form-group floating-label"> |
431 | <label for="lname" class="lname">Comment Box {{ j + 1 }}</label> | 431 | <label for="lname" class="lname">Comment Box {{ j + 1 }}</label> |
432 | <input | 432 | <input |
433 | type="text" | 433 | type="text" |
434 | class="form-control" | 434 | class="form-control" |
435 | value="" | 435 | value="" |
436 | placeholder=" " | 436 | placeholder=" " |
437 | v-model="cum.comment" | 437 | v-model="cum.comment" |
438 | v-on:blur="updateComment(cum)" | 438 | v-on:blur="updateComment(cum)" |
439 | /> | 439 | /> |
440 | </div> | 440 | </div> |
441 | </div> | 441 | </div> |
442 | </div> | 442 | </div> |
443 | 443 | ||
444 | </div> | 444 | </div> |
445 | 445 | ||
446 | 446 | ||
447 | <!-- 1st row --> | 447 | <!-- 1st row --> |
448 | <div class="row"> | 448 | <div class="row"> |
449 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 449 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
450 | <div class="form-group floating-label"> | 450 | <div class="form-group floating-label"> |
451 | <label for="lname" class="lname">Slides Name</label> | 451 | <label for="lname" class="lname">Slides Name</label> |
452 | <select | 452 | <select |
453 | class="form-control" | 453 | class="form-control" |
454 | v-model="slideId" | 454 | v-model="slideId" |
455 | v-on:change="slideSelected(slideId)" | 455 | v-on:change="slideSelected(slideId)" |
456 | > | 456 | > |
457 | <option value="null">Select Slide</option> | 457 | <option value="null">Select Slide</option> |
458 | <option v-for="(template, i) in templateList" :key="i" :value="i"> | 458 | <option v-for="(template, i) in templateList" :key="i" :value="i"> |
459 | {{ template.name }} | 459 | {{ template.name }} |
460 | </option> | 460 | </option> |
461 | </select> | 461 | </select> |
462 | </div> | 462 | </div> |
463 | </div> | 463 | </div> |
464 | </div> | 464 | </div> |
465 | <!-- 1st row --> | 465 | <!-- 1st row --> |
466 | 466 | ||
467 | <!-- 1st row end --> | 467 | <!-- 1st row end --> |
468 | <!-- case study ends --> | 468 | <!-- case study ends --> |
469 | <div class="clearfix"></div> | 469 | <div class="clearfix"></div> |
470 | 470 | ||
471 | <!-- users land image --> | 471 | <!-- users land image --> |
472 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 472 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
473 | <div class="form-layout signup-frm-spc"> | 473 | <div class="form-layout signup-frm-spc"> |
474 | <form> | 474 | <form> |
475 | <a | 475 | <a |
476 | href="javascript:void(0);" | 476 | href="javascript:void(0);" |
477 | class="btn btn-lg sb-button" | 477 | class="btn btn-lg sb-button" |
478 | type="submit" | 478 | type="submit" |
479 | @click="submit" | 479 | @click="submit" |
480 | > | 480 | > |
481 | <img src="../assets/images/key.svg" /> submit | 481 | <img src="../assets/images/key.svg" /> submit |
482 | </a> | 482 | </a> |
483 | </form> | 483 | </form> |
484 | </div> | 484 | </div> |
485 | </div> | 485 | </div> |
486 | 486 | ||
487 | <!-- data wrp --> | 487 | <!-- data wrp --> |
488 | <!-- body wrapper --> | 488 | <!-- body wrapper --> |
489 | </div> | 489 | </div> |
490 | </main> | 490 | </main> |
491 | </template> | 491 | </template> |
492 | 492 | ||
493 | <script> | 493 | <script> |
494 | import Vue from "vue"; | 494 | import Vue from "vue"; |
495 | import router from "../router"; | 495 | import router from "../router"; |
496 | import $ from "jquery"; | 496 | import $ from "jquery"; |
497 | import axios from "axios"; | 497 | import axios from "axios"; |
498 | 498 | ||
499 | export default { | 499 | export default { |
500 | name: "Profile", | 500 | name: "Profile", |
501 | 501 | ||
502 | data() { | 502 | data() { |
503 | return { | 503 | return { |
504 | object:null, | 504 | object:null, |
505 | loggedinFlag: false, | 505 | loggedinFlag: false, |
506 | templateImage:null, | 506 | templateImage:null, |
507 | caseId: null, | 507 | caseId: null, |
508 | editMode: false, | 508 | editMode: false, |
509 | userData: null, | 509 | userData: null, |
510 | usertoken: null, | 510 | usertoken: null, |
511 | insightName: null, | 511 | insightName: null, |
512 | focusName: null, | 512 | focusName: null, |
513 | slideId: null, | 513 | slideId: null, |
514 | userList: [], | 514 | userList: [], |
515 | templateList: [], | 515 | templateList: [], |
516 | insightList: [], | 516 | insightList: [], |
517 | insightId:null, | 517 | insightId:null, |
518 | caseStudy: { | 518 | caseStudy: { |
519 | caseStudyDetails: { | 519 | caseStudyDetails: { |
520 | userId: [], | 520 | userId: [], |
521 | intro: { | 521 | intro: { |
522 | name: null, | 522 | name: null, |
523 | logoURL: null, | 523 | logoURL: null, |
524 | app: null, | 524 | app: null, |
525 | type: null, | 525 | type: null, |
526 | readTime: null, | 526 | readTime: null, |
527 | platForm: null, | 527 | platForm: null, |
528 | authors: [], | 528 | authors: [], |
529 | }, | 529 | }, |
530 | outro: { | 530 | outro: { |
531 | authorImage: [], | 531 | authorImage: [], |
532 | authors: [], | 532 | authors: [], |
533 | designer: null, | 533 | designer: null, |
534 | illustrations: null, | 534 | illustrations: null, |
535 | }, | 535 | }, |
536 | insightTags: [], | 536 | insightTags: [], |
537 | focusAreas: [], | 537 | focusAreas: [], |
538 | }, | 538 | }, |
539 | slides: [], | 539 | slides: [], |
540 | }, | 540 | }, |
541 | }; | 541 | }; |
542 | }, | 542 | }, |
543 | mounted() { | 543 | mounted() { |
544 | if (this.$route.fullPath.split("?").length == 2) { | 544 | if (this.$route.fullPath.split("?").length == 2) { |
545 | this.editMode = true; | 545 | this.editMode = true; |
546 | this.caseId = this.$route.fullPath.split("?")[1]; | 546 | this.caseId = this.$route.fullPath.split("?")[1]; |
547 | var introData = localStorage.getItem("spotlight_caseStudy" + this.caseId); | 547 | var introData = localStorage.getItem("spotlight_caseStudy" + this.caseId); |
548 | if (introData) { | 548 | if (introData) { |
549 | introData = JSON.parse(introData); | 549 | introData = JSON.parse(introData); |
550 | console.log("introData", introData); | 550 | console.log("introData", introData); |
551 | if(introData.intro.focus){ | 551 | if(introData.intro.focus){ |
552 | delete introData.intro.focus; | 552 | delete introData.intro.focus; |
553 | } | 553 | } |
554 | this.caseStudy.caseStudyDetails.intro = introData.intro; | 554 | this.caseStudy.caseStudyDetails.intro = introData.intro; |
555 | this.caseStudy.caseStudyDetails.userId = introData.userId; | 555 | this.caseStudy.caseStudyDetails.userId = introData.userId; |
556 | this.caseStudy.caseStudyDetails.outro = introData.outro; | 556 | this.caseStudy.caseStudyDetails.outro = introData.outro; |
557 | this.caseStudy.caseStudyDetails.insightTags = introData.insightTags; | 557 | this.caseStudy.caseStudyDetails.insightTags = introData.insightTags; |
558 | this.caseStudy.caseStudyDetails.focusAreas = introData.focusAreas; | 558 | this.caseStudy.caseStudyDetails.focusAreas = introData.focusAreas; |
559 | } | 559 | } |
560 | } | 560 | } |
561 | var userdata = localStorage.getItem("spotlight_usertoken"); | 561 | var userdata = localStorage.getItem("spotlight_usertoken"); |
562 | if (userdata) { | 562 | if (userdata) { |
563 | userdata = JSON.parse(userdata); | 563 | userdata = JSON.parse(userdata); |
564 | this.usertoken = userdata.token; | 564 | this.usertoken = userdata.token; |
565 | this.getUserList(); | 565 | this.getUserList(); |
566 | this.getTemplateList(); | 566 | this.getTemplateList(); |
567 | this.getInsightList(); | 567 | this.getInsightList(); |
568 | } | 568 | } |
569 | }, | 569 | }, |
570 | methods: { | 570 | methods: { |
571 | selectUser(i) { | 571 | selectUser(i) { |
572 | this.userList[i]; | 572 | this.userList[i]; |
573 | this.caseStudy.caseStudyDetails.intro.authors.push(this.userList[i].name); | 573 | this.caseStudy.caseStudyDetails.intro.authors.push(this.userList[i].name); |
574 | this.caseStudy.caseStudyDetails.outro.authors.push(this.userList[i].name); | 574 | this.caseStudy.caseStudyDetails.outro.authors.push(this.userList[i].name); |
575 | this.caseStudy.caseStudyDetails.userId.push(this.userList[i]._id); | 575 | this.caseStudy.caseStudyDetails.userId.push(this.userList[i]._id); |
576 | console.log("-", this.caseStudy); | 576 | console.log("-", this.caseStudy); |
577 | }, | 577 | }, |
578 | 578 | ||
579 | logout() { | 579 | logout() { |
580 | this.$router.push("/"); | 580 | this.$router.push("/"); |
581 | }, | 581 | }, |
582 | addInsight(type) { | 582 | addInsight(type) { |
583 | if (type == "focus") { | 583 | if (type == "focus") { |
584 | this.caseStudy.caseStudyDetails.focusAreas.push(this.focusName); | 584 | this.caseStudy.caseStudyDetails.focusAreas.push(this.focusName); |
585 | this.focusName = null; | 585 | this.focusName = null; |
586 | } else if (type == "insight") { | 586 | } else if (type == "insight") { |
587 | this.caseStudy.caseStudyDetails.insightTags.push(this.insightName); | 587 | this.caseStudy.caseStudyDetails.insightTags.push(this.insightName); |
588 | this.insightName = null; | 588 | this.insightName = null; |
589 | } | 589 | } |
590 | }, | 590 | }, |
591 | removeInsight(i, type) { | 591 | removeInsight(i, type) { |
592 | if (type == "focus") { | 592 | if (type == "focus") { |
593 | this.caseStudy.caseStudyDetails.focusAreas.splice(i, 1); | 593 | this.caseStudy.caseStudyDetails.focusAreas.splice(i, 1); |
594 | } else if (type == "insight") { | 594 | } else if (type == "insight") { |
595 | this.caseStudy.caseStudyDetails.insightTags.splice(i, 1); | 595 | this.caseStudy.caseStudyDetails.insightTags.splice(i, 1); |
596 | } | 596 | } |
597 | }, | 597 | }, |
598 | 598 | ||
599 | async slideSelected(i) { | 599 | async slideSelected(i) { |
600 | console.log("id is", this.templateList[i]); | 600 | console.log("id is", this.templateList[i]); |
601 | this.object = JSON.parse(JSON.stringify(this.templateList[i])); | 601 | this.object = JSON.parse(JSON.stringify(this.templateList[i])); |
602 | 602 | ||
603 | // var keys = Object.keys(this.templateList[i]); | 603 | // var keys = Object.keys(this.templateList[i]); |
604 | // keys.forEach(element => { | 604 | // keys.forEach(element => { |
605 | // obj[element] = this.templateList[i][element]; | 605 | // obj[element] = this.templateList[i][element]; |
606 | // }); | 606 | // }); |
607 | 607 | ||
608 | console.log("obj", this.object) | 608 | console.log("obj", this.object) |
609 | // slideMetadata = await this.getMeatda(this.templateList[i]._id); | 609 | // slideMetadata = await this.getMeatda(this.templateList[i]._id); |
610 | this.slideId = null; | 610 | this.slideId = null; |
611 | // this.templateList[i].metaData = slideMetadata.metaData; | 611 | // this.templateList[i].metaData = slideMetadata.metaData; |
612 | this.caseStudy.slides.push( this.object); | 612 | this.caseStudy.slides.push( this.object); |
613 | this.templateList[i].metaData.fields.forEach(fields_ => { | 613 | this.templateList[i].metaData.fields.forEach(fields_ => { |
614 | fields_.fieldValue == null | 614 | fields_.fieldValue == null |
615 | }); | 615 | }); |
616 | if(this.templateList[i].metaData.comments){ | 616 | if(this.templateList[i].metaData.comments){ |
617 | this.templateList[i].metaData.comments.forEach(coments_ => { | 617 | this.templateList[i].metaData.comments.forEach(coments_ => { |
618 | coments_.comment == null | 618 | coments_.comment == null |
619 | }); | 619 | }); |
620 | 620 | ||
621 | } | 621 | } |
622 | console.log("this.caseStudy.slides", this.caseStudy.slides); | 622 | console.log("this.caseStudy.slides", this.caseStudy.slides); |
623 | }, | 623 | }, |
624 | async insightSelected(data) { | 624 | async insightSelected(data) { |
625 | 625 | ||
626 | // this.caseStudy.slides.push(this.templateList[i]); | 626 | // this.caseStudy.slides.push(this.templateList[i]); |
627 | 627 | ||
628 | console.log("data",data); | 628 | console.log("data",data); |
629 | data.insightId = this.insightId; | 629 | data.insightId = this.insightId; |
630 | this.insightId = null; | 630 | // this.insightId = null; |
631 | }, | 631 | }, |
632 | 632 | ||
633 | removeSlide(i) { | 633 | removeSlide(i) { |
634 | this.caseStudy.slides.splice(i, 1); | 634 | this.caseStudy.slides.splice(i, 1); |
635 | }, | 635 | }, |
636 | 636 | ||
637 | createImage(type) { | 637 | createImage(type) { |
638 | var that = this; | 638 | var that = this; |
639 | console.log(document.getElementById(type)); | 639 | console.log(document.getElementById(type)); |
640 | var file = document.getElementById(type).files[0]; | 640 | var file = document.getElementById(type).files[0]; |
641 | console.log("file", file); | 641 | console.log("file", file); |
642 | var reader = new FileReader(); | 642 | var reader = new FileReader(); |
643 | reader.onload = function (e) { | 643 | reader.onload = function (e) { |
644 | console.log("e.target.result ", e.target.result); | 644 | console.log("e.target.result ", e.target.result); |
645 | that.uploadImage(type, e.target.result); | 645 | that.uploadImage(type, e.target.result); |
646 | }; | 646 | }; |
647 | reader.onerror = function (error) { | 647 | reader.onerror = function (error) { |
648 | alert(error); | 648 | alert(error); |
649 | }; | 649 | }; |
650 | if (file) { | 650 | if (file) { |
651 | reader.readAsDataURL(file); | 651 | reader.readAsDataURL(file); |
652 | } | 652 | } |
653 | }, | 653 | }, |
654 | uploadImage(type, base64) { | 654 | uploadImage(type, base64) { |
655 | console.log("type", type); | 655 | console.log("type", type); |
656 | var obj = { | 656 | var obj = { |
657 | image: base64, | 657 | image: base64, |
658 | }; | 658 | }; |
659 | axios | 659 | axios |
660 | .post("/superAdmin/uploadImage", obj, { | 660 | .post("/superAdmin/uploadImage", obj, { |
661 | headers: { | 661 | headers: { |
662 | Authorization: "Bearer " + this.usertoken, | 662 | Authorization: "Bearer " + this.usertoken, |
663 | }, | 663 | }, |
664 | }) | 664 | }) |
665 | .then((response) => { | 665 | .then((response) => { |
666 | if (type == "logo") { | 666 | if (type == "logo") { |
667 | 667 | ||
668 | setTimeout(() => this.caseStudy.caseStudyDetails.intro.logoURL = response.data.data, 99); | 668 | setTimeout(() => this.caseStudy.caseStudyDetails.intro.logoURL = response.data.data, 99); |
669 | } else if (type == "outdor") { | 669 | } else if (type == "outdor") { |
670 | this.caseStudy.caseStudyDetails.outro.authorImage = []; | 670 | this.caseStudy.caseStudyDetails.outro.authorImage = []; |
671 | setTimeout(() => this.caseStudy.caseStudyDetails.outro.authorImage.push( | 671 | setTimeout(() => this.caseStudy.caseStudyDetails.outro.authorImage.push( |
672 | response.data.data | 672 | response.data.data |
673 | ), 99); | 673 | ), 99); |
674 | 674 | ||
675 | } | 675 | } |
676 | 676 | ||
677 | console.log(response.data.data); | 677 | console.log(response.data.data); |
678 | console.log(this.caseStudy); | 678 | console.log(this.caseStudy); |
679 | }) | 679 | }) |
680 | .catch((error) => { | 680 | .catch((error) => { |
681 | if (error.response) { | 681 | if (error.response) { |
682 | this.$toaster.error(error.response.data.message); | 682 | this.$toaster.error(error.response.data.message); |
683 | } | 683 | } |
684 | }); | 684 | }); |
685 | }, | 685 | }, |
686 | 686 | ||
687 | fieldcreateImage(i, j) { | 687 | fieldcreateImage(i, j) { |
688 | console.log("i", i); | 688 | console.log("i", i); |
689 | console.log("j", j); | 689 | console.log("j", j); |
690 | var that = this; | 690 | var that = this; |
691 | var id = i + "" + j; | 691 | var id = i + "" + j; |
692 | console.log(document.getElementById(id)); | 692 | console.log(document.getElementById(id)); |
693 | var file = document.getElementById(id).files[0]; | 693 | var file = document.getElementById(id).files[0]; |
694 | // var file = document.querySelector("input[type=file]").files[0]; | 694 | // var file = document.querySelector("input[type=file]").files[0]; |
695 | console.log("file", file); | 695 | console.log("file", file); |
696 | var reader = new FileReader(); | 696 | var reader = new FileReader(); |
697 | reader.onload = function (e) { | 697 | reader.onload = function (e) { |
698 | // console.log("e.target.result ",e.target.result ) | 698 | // console.log("e.target.result ",e.target.result ) |
699 | that.fielduploadImage(i, j, e.target.result); | 699 | that.fielduploadImage(i, j, e.target.result); |
700 | }; | 700 | }; |
701 | reader.onerror = function (error) { | 701 | reader.onerror = function (error) { |
702 | alert(error); | 702 | alert(error); |
703 | }; | 703 | }; |
704 | if (file) { | 704 | if (file) { |
705 | reader.readAsDataURL(file); | 705 | reader.readAsDataURL(file); |
706 | } | 706 | } |
707 | }, | 707 | }, |
708 | fielduploadImage(i, j, base64) { | 708 | fielduploadImage(i, j, base64) { |
709 | var obj = { | 709 | var obj = { |
710 | image: base64, | 710 | image: base64, |
711 | }; | 711 | }; |
712 | axios | 712 | axios |
713 | .post("/superAdmin/uploadImage", obj, { | 713 | .post("/superAdmin/uploadImage", obj, { |
714 | headers: { | 714 | headers: { |
715 | Authorization: "Bearer " + this.usertoken, | 715 | Authorization: "Bearer " + this.usertoken, |
716 | }, | 716 | }, |
717 | }) | 717 | }) |
718 | .then((response) => { | 718 | .then((response) => { |
719 | setTimeout(() => this.caseStudy.slides[i].metaData.fields[j].fieldValue = | 719 | setTimeout(() => this.caseStudy.slides[i].metaData.fields[j].fieldValue = |
720 | response.data.data, 10); | 720 | response.data.data, 10); |
721 | 721 | ||
722 | 722 | ||
723 | console.log(response.data.data); | 723 | console.log(response.data.data); |
724 | console.log(this.caseStudy); | 724 | console.log(this.caseStudy); |
725 | }) | 725 | }) |
726 | .catch((error) => { | 726 | .catch((error) => { |
727 | if (error.response) { | 727 | if (error.response) { |
728 | this.$toaster.error(error.response.data.message); | 728 | this.$toaster.error(error.response.data.message); |
729 | } | 729 | } |
730 | }); | 730 | }); |
731 | }, | 731 | }, |
732 | 732 | ||
733 | getUserList() { | 733 | getUserList() { |
734 | axios | 734 | axios |
735 | .get("/superAdmin/users", { | 735 | .get("/superAdmin/users", { |
736 | headers: { | 736 | headers: { |
737 | Authorization: "Bearer " + this.usertoken, | 737 | Authorization: "Bearer " + this.usertoken, |
738 | }, | 738 | }, |
739 | }) | 739 | }) |
740 | .then((response) => { | 740 | .then((response) => { |
741 | response.data.data.forEach((element) => { | 741 | response.data.data.forEach((element) => { |
742 | if (element.name) { | 742 | if (element.name) { |
743 | this.userList.push(element); | 743 | this.userList.push(element); |
744 | } | 744 | } |
745 | }); | 745 | }); |
746 | console.log("response", this.userList); | 746 | console.log("response", this.userList); |
747 | }) | 747 | }) |
748 | .catch((error) => console.log(error)); | 748 | .catch((error) => console.log(error)); |
749 | }, | 749 | }, |
750 | 750 | ||
751 | getTemplateList() { | 751 | getTemplateList() { |
752 | axios | 752 | axios |
753 | .get("/superAdmin/templates", { | 753 | .get("/superAdmin/templates", { |
754 | headers: { | 754 | headers: { |
755 | Authorization: "Bearer " + this.usertoken, | 755 | Authorization: "Bearer " + this.usertoken, |
756 | }, | 756 | }, |
757 | }) | 757 | }) |
758 | .then((response) => { | 758 | .then((response) => { |
759 | response.data.data.forEach((temp) => { | 759 | response.data.data.forEach((temp) => { |
760 | if ( | 760 | if ( |
761 | temp._id != "INTRO_oqkdMOVDrwRptsdWJ6Ye" && | 761 | temp._id != "INTRO_oqkdMOVDrwRptsdWJ6Ye" && |
762 | temp._id != "OUTRO_oqkdMOVDrwRptsdWJ6Ye" | 762 | temp._id != "OUTRO_oqkdMOVDrwRptsdWJ6Ye" |
763 | ) { | 763 | ) { |
764 | if (temp.bounceBoard) { | 764 | if (temp.bounceBoard) { |
765 | for (var i = 0; i < temp.commentBox; i++) { | 765 | for (var i = 0; i < temp.commentBox; i++) { |
766 | temp.metaData.comments.push({ | 766 | temp.metaData.comments.push({ |
767 | userId: null, | 767 | userId: null, |
768 | slideId: null, | 768 | slideId: null, |
769 | caseStudyId: null, | 769 | caseStudyId: null, |
770 | comment: null, | 770 | comment: null, |
771 | }); | 771 | }); |
772 | } | 772 | } |
773 | } | 773 | } |
774 | this.templateList.push(temp); | 774 | this.templateList.push(temp); |
775 | } | 775 | } |
776 | }); | 776 | }); |
777 | if (this.editMode) { | 777 | if (this.editMode) { |
778 | this.getSLideData(); | 778 | this.getSLideData(); |
779 | } | 779 | } |
780 | console.log("templates", this.templateList); | 780 | console.log("templates", this.templateList); |
781 | }) | 781 | }) |
782 | .catch((error) => console.log(error)); | 782 | .catch((error) => console.log(error)); |
783 | }, | 783 | }, |
784 | getInsightList() { | 784 | getInsightList() { |
785 | axios | 785 | axios |
786 | .get("/superAdmin/insight", { | 786 | .get("/superAdmin/insight", { |
787 | headers: { | 787 | headers: { |
788 | Authorization: "Bearer " + this.usertoken, | 788 | Authorization: "Bearer " + this.usertoken, |
789 | }, | 789 | }, |
790 | }) | 790 | }) |
791 | .then((response) => { | 791 | .then((response) => { |
792 | this.insightList = response.data.data; | 792 | this.insightList = response.data.data; |
793 | 793 | ||
794 | console.log("insight", response.data.data); | 794 | console.log("insight", response.data.data); |
795 | }) | 795 | }) |
796 | .catch((error) => console.log(error)); | 796 | .catch((error) => console.log(error)); |
797 | }, | 797 | }, |
798 | 798 | ||
799 | getSLideData() { | 799 | getSLideData() { |
800 | axios | 800 | axios |
801 | .get("/superAdmin/caseStudySlides?caseStudyId=" + this.caseId, { | 801 | .get("/superAdmin/caseStudySlides?caseStudyId=" + this.caseId, { |
802 | headers: { | 802 | headers: { |
803 | Authorization: "Bearer " + this.usertoken, | 803 | Authorization: "Bearer " + this.usertoken, |
804 | }, | 804 | }, |
805 | }) | 805 | }) |
806 | .then((response) => { | 806 | .then((response) => { |
807 | var finalArray = []; | 807 | var finalArray = []; |
808 | response.data.data.forEach((template_) => { | 808 | response.data.data.forEach((template_) => { |
809 | console.log("template_",template_) | 809 | console.log("template_",template_) |
810 | var keys = []; | 810 | var keys = []; |
811 | var i = this.templateList.findIndex( | 811 | var i = this.templateList.findIndex( |
812 | (temp_) => temp_._id == template_.templateId | 812 | (temp_) => temp_._id == template_.templateId |
813 | ); | 813 | ); |
814 | var obj = { | 814 | var obj = { |
815 | _id: this.templateList[i]._id, | 815 | _id: this.templateList[i]._id, |
816 | bounceBoard: this.templateList[i].bounceBoard, | 816 | bounceBoard: this.templateList[i].bounceBoard, |
817 | insight: this.templateList[i].insight, | 817 | insight: this.templateList[i].insight, |
818 | slideId:template_._id, | 818 | slideId:template_._id, |
819 | // commentBox: this.templateList[i].commentBox, | 819 | // commentBox: this.templateList[i].commentBox, |
820 | metaData: { | 820 | metaData: { |
821 | fields: [], | 821 | fields: [], |
822 | comments: [], | 822 | comments: [], |
823 | }, | 823 | }, |
824 | }; | 824 | }; |
825 | if (this.templateList[i].bounceBoard) { | 825 | if (this.templateList[i].bounceBoard) { |
826 | obj.commentBox = this.templateList[i].commentBox; | 826 | obj.commentBox = this.templateList[i].commentBox; |
827 | obj.metaData.comments = template_.comments; | 827 | obj.metaData.comments = template_.comments; |
828 | } | 828 | } |
829 | if (this.templateList[i].insight) { | 829 | if (this.templateList[i].insight) { |
830 | obj.insightId = template_.insightId; | 830 | obj.insightId = template_.insightId; |
831 | } | 831 | } |
832 | var fieldArray = []; | 832 | var fieldArray = []; |
833 | this.templateList[i].metaData.fields.forEach((element) => { | 833 | this.templateList[i].metaData.fields.forEach((element) => { |
834 | var fieldobj = { | 834 | var fieldobj = { |
835 | fieldName: element.fieldName, | 835 | fieldName: element.fieldName, |
836 | displayName: element.displayName, | 836 | displayName: element.displayName, |
837 | fieldValue: template_.metaData[element.fieldName], | 837 | fieldValue: template_.metaData[element.fieldName], |
838 | fieldType: element.fieldType, | 838 | fieldType: element.fieldType, |
839 | }; | 839 | }; |
840 | obj.metaData.fields.push(fieldobj); | 840 | obj.metaData.fields.push(fieldobj); |
841 | }); | 841 | }); |
842 | finalArray.push(obj); | 842 | finalArray.push(obj); |
843 | }); | 843 | }); |
844 | this.caseStudy.slides = finalArray; | 844 | this.caseStudy.slides = finalArray; |
845 | console.log("----", finalArray); | 845 | console.log("----", finalArray); |
846 | console.log(this.templateList, "getSLideData==>"); | 846 | console.log(this.templateList, "getSLideData==>"); |
847 | }) | 847 | }) |
848 | .catch((error) => console.log(error)); | 848 | .catch((error) => console.log(error)); |
849 | }, | 849 | }, |
850 | 850 | ||
851 | submit() { | 851 | submit() { |
852 | const latest = Object.create(this.caseStudy); | 852 | const latest = Object.create(this.caseStudy); |
853 | 853 | ||
854 | var slidArray = []; | 854 | var slidArray = []; |
855 | latest.slides.forEach((slides) => { | 855 | latest.slides.forEach((slides) => { |
856 | console.log("slides", slides); | 856 | console.log("slides", slides); |
857 | var slideData = {}; | 857 | var slideData = {}; |
858 | slideData.templateId = slides._id; | 858 | slideData.templateId = slides._id; |
859 | slideData.bounceBoard = slides.bounceBoard; | 859 | slideData.bounceBoard = slides.bounceBoard; |
860 | slideData.insight = slides.insight; | 860 | slideData.insight = slides.insight; |
861 | if(slides.slideId){ | 861 | if(slides.slideId){ |
862 | slideData.slideId = slides.slideId; | 862 | slideData.slideId = slides.slideId; |
863 | 863 | ||
864 | } | 864 | } |
865 | if(slides.insightId){ | 865 | if(slides.insightId){ |
866 | slideData.insightId = slides.insightId; | 866 | slideData.insightId = slides.insightId; |
867 | 867 | ||
868 | } | 868 | } |
869 | if (slides.metaData.comments && slides.metaData.comments.length > 0) { | 869 | if (slides.metaData.comments && slides.metaData.comments.length > 0) { |
870 | slideData.comments = slides.metaData.comments; | 870 | slideData.comments = slides.metaData.comments; |
871 | // this.getSLideData(); | 871 | // this.getSLideData(); |
872 | } | 872 | } |
873 | // var comments = []; | 873 | // var comments = []; |
874 | // if (slides.bounceBoard) { | 874 | // if (slides.bounceBoard) { |
875 | // slides.metaData.comments.forEach((element) => { | 875 | // slides.metaData.comments.forEach((element) => { |
876 | // comments.push(element.comment); | 876 | // comments.push(element.comment); |
877 | // }); | 877 | // }); |
878 | // slideData.comments = comments; | 878 | // slideData.comments = comments; |
879 | // } | 879 | // } |
880 | 880 | ||
881 | slides.metaData.fields.forEach((fields_) => { | 881 | slides.metaData.fields.forEach((fields_) => { |
882 | slideData[fields_.fieldName] = fields_.fieldValue; | 882 | slideData[fields_.fieldName] = fields_.fieldValue; |
883 | }); | 883 | }); |
884 | slidArray.push(slideData); | 884 | slidArray.push(slideData); |
885 | // delete slides.metaData.fields; | 885 | // delete slides.metaData.fields; |
886 | }); | 886 | }); |
887 | 887 | ||
888 | console.log("slideData", slidArray); | 888 | console.log("slideData", slidArray); |
889 | if (this.editMode) { | 889 | if (this.editMode) { |
890 | this.updateProfile(slidArray); | 890 | this.updateProfile(slidArray); |
891 | }else{ | 891 | }else{ |
892 | this.saveProfile(slidArray); | 892 | this.saveProfile(slidArray); |
893 | } | 893 | } |
894 | }, | 894 | }, |
895 | updateComment(cmnt){ | 895 | updateComment(cmnt){ |
896 | if(!cmnt._id){ | 896 | if(!cmnt._id){ |
897 | return; | 897 | return; |
898 | } | 898 | } |
899 | console.log("cmnts",cmnt); | 899 | console.log("cmnts",cmnt); |
900 | var obj = { | 900 | var obj = { |
901 | 'slideId':cmnt.slideId, | 901 | 'slideId':cmnt.slideId, |
902 | 'commentId':cmnt._id, | 902 | 'commentId':cmnt._id, |
903 | 'comment':cmnt.comment | 903 | 'comment':cmnt.comment |
904 | }; | 904 | }; |
905 | axios | 905 | axios |
906 | .put("/superAdmin/comment", obj, { | 906 | .put("/superAdmin/comment", obj, { |
907 | headers: { | 907 | headers: { |
908 | Authorization: "Bearer " + this.usertoken, | 908 | Authorization: "Bearer " + this.usertoken, |
909 | }, | 909 | }, |
910 | }) | 910 | }) |
911 | .then((response) => { | 911 | .then((response) => { |
912 | 912 | ||
913 | console.log(response); | 913 | console.log(response); |
914 | }) | 914 | }) |
915 | .catch((error) => { | 915 | .catch((error) => { |
916 | 916 | ||
917 | }); | 917 | }); |
918 | }, | 918 | }, |
919 | 919 | ||
920 | saveProfile(slides) { | 920 | saveProfile(slides) { |
921 | var obj = {}; | 921 | var obj = {}; |
922 | obj.caseStudyDetails = this.caseStudy.caseStudyDetails; | 922 | obj.caseStudyDetails = this.caseStudy.caseStudyDetails; |
923 | obj.caseStudyDetails.intro.readTime = Math.round( | 923 | obj.caseStudyDetails.intro.readTime = Math.round( |
924 | slides.length / 3 | 924 | slides.length / 3 |
925 | ).toString(); | 925 | ).toString(); |
926 | obj.slides = slides; | 926 | obj.slides = slides; |
927 | axios | 927 | axios |
928 | .post("/superAdmin/caseStudy", obj, { | 928 | .post("/superAdmin/caseStudy", obj, { |
929 | headers: { | 929 | headers: { |
930 | Authorization: "Bearer " + this.usertoken, | 930 | Authorization: "Bearer " + this.usertoken, |
931 | }, | 931 | }, |
932 | }) | 932 | }) |
933 | .then((response) => { | 933 | .then((response) => { |
934 | // this.userData = response.data.data; | 934 | // this.userData = response.data.data; |
935 | this.$toaster.success("Case Study Created"); | 935 | this.$toaster.success("Case Study Created"); |
936 | this.$router.go(this.$router.currentRoute) | 936 | this.$router.go(this.$router.currentRoute) |
937 | 937 | ||
938 | console.log(response); | 938 | console.log(response); |
939 | }) | 939 | }) |
940 | .catch((error) => { | 940 | .catch((error) => { |
941 | if (error.response) { | 941 | if (error.response) { |
942 | this.$toaster.error(error.response.data.message); | 942 | this.$toaster.error(error.response.data.message); |
943 | } | 943 | } |
944 | }); | 944 | }); |
945 | }, | 945 | }, |
946 | 946 | ||
947 | updateProfile(slides) { | 947 | updateProfile(slides) { |
948 | var obj = {}; | 948 | var obj = {}; |
949 | obj.caseStudyId = this.caseId, | 949 | obj.caseStudyId = this.caseId, |
950 | obj.caseStudyDetails = this.caseStudy.caseStudyDetails; | 950 | obj.caseStudyDetails = this.caseStudy.caseStudyDetails; |
951 | obj.caseStudyDetails.intro.readTime = Math.round( | 951 | obj.caseStudyDetails.intro.readTime = Math.round( |
952 | slides.length / 3 | 952 | slides.length / 3 |
953 | ).toString(); | 953 | ).toString(); |
954 | obj.slides = slides; | 954 | obj.slides = slides; |
955 | delete obj.caseStudyDetails.intro.focus; | 955 | delete obj.caseStudyDetails.intro.focus; |
956 | axios | 956 | axios |
957 | .put("/superAdmin/caseStudy", obj, { | 957 | .put("/superAdmin/caseStudy", obj, { |
958 | headers: { | 958 | headers: { |
959 | Authorization: "Bearer " + this.usertoken, | 959 | Authorization: "Bearer " + this.usertoken, |
960 | }, | 960 | }, |
961 | }) | 961 | }) |
962 | .then((response) => { | 962 | .then((response) => { |
963 | // this.userData = response.data.data; | 963 | // this.userData = response.data.data; |
964 | this.$toaster.success("Case Study Updated"); | 964 | this.$toaster.success("Case Study Updated"); |
965 | this.$router.go(this.$router.currentRoute) | 965 | this.$router.go(this.$router.currentRoute) |
966 | 966 | ||
967 | 967 | ||
968 | console.log(response); | 968 | console.log(response); |
969 | }) | 969 | }) |
970 | .catch((error) => { | 970 | .catch((error) => { |
971 | if (error.response) { | 971 | if (error.response) { |
972 | this.$toaster.error(error.response.data.message); | 972 | this.$toaster.error(error.response.data.message); |
973 | } | 973 | } |
974 | }); | 974 | }); |
975 | }, | 975 | }, |
976 | listPage(url){ | 976 | listPage(url){ |
977 | this.$router.push(url); | 977 | this.$router.push(url); |
978 | }, | 978 | }, |
979 | 979 | ||
980 | addProfileDialog(slide) { | 980 | addProfileDialog(slide) { |
981 | console.log("slide",slide) | 981 | console.log("slide",slide) |
982 | this.templateImage = slide.templateImage; | 982 | this.templateImage = slide.templateImage; |
983 | $(".inner-wrp").addClass("body-blur"); | 983 | $(".inner-wrp").addClass("body-blur"); |
984 | $("#add-social-links").hide(); | 984 | $("#add-social-links").hide(); |
985 | $(".popup-wrp, #add-profile").show(); | 985 | $(".popup-wrp, #add-profile").show(); |
986 | }, | 986 | }, |
987 | 987 | ||
988 | closeDialog() { | 988 | closeDialog() { |
989 | this.templateImage = null; | 989 | this.templateImage = null; |
990 | $(".popup-wrp").hide(); | 990 | $(".popup-wrp").hide(); |
991 | $(".inner-wrp").removeClass("body-blur"); | 991 | $(".inner-wrp").removeClass("body-blur"); |
992 | // this.saveProfile(); | 992 | // this.saveProfile(); |
993 | }, | 993 | }, |
994 | hideDialog() { | 994 | hideDialog() { |
995 | this.templateImage = null; | 995 | this.templateImage = null; |
996 | $(".popup-wrp").hide(); | 996 | $(".popup-wrp").hide(); |
997 | $(".inner-wrp").removeClass("body-blur"); | 997 | $(".inner-wrp").removeClass("body-blur"); |
998 | }, | 998 | }, |
999 | 999 | ||
1000 | async getMeatda(tempId) { | 1000 | async getMeatda(tempId) { |
1001 | var obj = [ | 1001 | var obj = [ |
1002 | { | 1002 | { |
1003 | tempId: "T1_RoeMG8130Xko1DvhC3Ou", | 1003 | tempId: "T1_RoeMG8130Xko1DvhC3Ou", |
1004 | metaData: { | 1004 | metaData: { |
1005 | fields: [ | 1005 | fields: [ |
1006 | { | 1006 | { |
1007 | fieldName: "authorImage", | 1007 | fieldName: "authorImage", |
1008 | displayName: "Author Image", | 1008 | displayName: "Author Image", |
1009 | fieldValue: null, | 1009 | fieldValue: null, |
1010 | fieldType: "image", | 1010 | fieldType: "image", |
1011 | }, | 1011 | }, |
1012 | { | 1012 | { |
1013 | fieldName: "mobileImage", | 1013 | fieldName: "mobileImage", |
1014 | displayName: "Mobile Image", | 1014 | displayName: "Mobile Image", |
1015 | fieldValue: null, | 1015 | fieldValue: null, |
1016 | fieldType: "image", | 1016 | fieldType: "image", |
1017 | }, | 1017 | }, |
1018 | { | 1018 | { |
1019 | fieldName: "textBox", | 1019 | fieldName: "textBox", |
1020 | displayName: "Text Box", | 1020 | displayName: "Text Box", |
1021 | fieldValue: null, | 1021 | fieldValue: null, |
1022 | fieldType: "text", | 1022 | fieldType: "text", |
1023 | }, | 1023 | }, |
1024 | ], | 1024 | ], |
1025 | }, | 1025 | }, |
1026 | }, | 1026 | }, |
1027 | { | 1027 | { |
1028 | tempId: "T2_ROsUOEy3vxsRAiQ72XdI", | 1028 | tempId: "T2_ROsUOEy3vxsRAiQ72XdI", |
1029 | metaData: { | 1029 | metaData: { |
1030 | fields: [ | 1030 | fields: [ |
1031 | { | 1031 | { |
1032 | fieldName: "authorImage", | 1032 | fieldName: "authorImage", |
1033 | displayName: "Author Image", | 1033 | displayName: "Author Image", |
1034 | fieldValue: null, | 1034 | fieldValue: null, |
1035 | fieldType: "image", | 1035 | fieldType: "image", |
1036 | }, | 1036 | }, |
1037 | ], | 1037 | ], |
1038 | comments: [{ comment: null }, { comment: null }, { comment: null }], | 1038 | comments: [{ comment: null }, { comment: null }, { comment: null }], |
1039 | }, | 1039 | }, |
1040 | }, | 1040 | }, |
1041 | { | 1041 | { |
1042 | tempId: "T3_cqNIf7tuqL4jyON63dA7", | 1042 | tempId: "T3_cqNIf7tuqL4jyON63dA7", |
1043 | metaData: { | 1043 | metaData: { |
1044 | fields: [ | 1044 | fields: [ |
1045 | { | 1045 | { |
1046 | fieldName: "authorImage", | 1046 | fieldName: "authorImage", |
1047 | displayName: "Author Image", | 1047 | displayName: "Author Image", |
1048 | fieldValue: null, | 1048 | fieldValue: null, |
1049 | fieldType: "image", | 1049 | fieldType: "image", |
1050 | }, | 1050 | }, |
1051 | { | 1051 | { |
1052 | fieldName: "mobileImage", | 1052 | fieldName: "mobileImage", |
1053 | displayName: "Mobile Image", | 1053 | displayName: "Mobile Image", |
1054 | fieldValue: null, | 1054 | fieldValue: null, |
1055 | fieldType: "image", | 1055 | fieldType: "image", |
1056 | }, | 1056 | }, |
1057 | ], | 1057 | ], |
1058 | comments: [ | 1058 | comments: [ |
1059 | { comment: null }, | 1059 | { comment: null }, |
1060 | { comment: null }, | 1060 | { comment: null }, |
1061 | { comment: null }, | 1061 | { comment: null }, |
1062 | { comment: null }, | 1062 | { comment: null }, |
1063 | ], | 1063 | ], |
1064 | }, | 1064 | }, |
1065 | }, | 1065 | }, |
1066 | ]; | 1066 | ]; |
1067 | var i = obj.findIndex((obj_) => obj_.tempId == tempId); | 1067 | var i = obj.findIndex((obj_) => obj_.tempId == tempId); |
1068 | return obj[i]; | 1068 | return obj[i]; |
1069 | }, | 1069 | }, |
1070 | }, | 1070 | }, |
1071 | }; | 1071 | }; |
1072 | </script> | 1072 | </script> |
1073 | 1073 |