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