· 6 years ago · Apr 23, 2020, 12:02 PM
1<template>
2<section class="w-full ml-12">
3 <p class="font-basic tracking-normal text-3xl mb-4 mt-4 font-normal text-black ml-6">Edit Criminal Page
4 </p>
5 <div class="bg-white p-6 shadow-md w-4/5x">
6 <form id="setup-billing-form" @submit.prevent="updateProfile" method="POST" enctype="multipart/form-data">
7
8 <div class="input-group mb-6">
9 <h3 class="text-lg font-sans">Update Criminal Information of {{ criminal.full_name }}</h3>
10 </div>
11
12 <div class="flex inline-block mt-4">
13 <div class="input-group w-3/5">
14 <label for="name" class="block uppercase tracking-wide text-black-v2 text-xs font-bold mb-2">Criminals' Full /
15 Display Name
16 </label>
17 <input type="text" v-model="form.full_name" class="hover:bg-grey-lightest bg-grey-lighter w-full mb-2 p-2 leading-normal" id="display_name" name="pin" autocomplete="name" placeholder="" readonly required>
18 </div>
19 <div class="ml-2 w-3/5">
20 <label for="name" class="block uppercase tracking-wide text-black-v2 text-xs font-bold mb-2">
21 Alias
22 </label>
23 <input type="text" v-model="form.alias" class="hover:bg-grey-lightest bg-grey-lighter w-full mb-2 p-2 leading-normal" id="alias" name="alias" autocomplete="name" placeholder="" required>
24 </div>
25 </div>
26 <div class="flex inline-block">
27 <div class="w-3/5">
28 <label for="name" class="block uppercase tracking-wide text-black-v2 text-xs font-bold mb-2">First
29 Name
30 </label>
31 <input type="text" v-model="form.first_name" class="hover:bg-grey-lightest bg-grey-lighter w-full mb-2 p-2 leading-normal" id="first_name" name="first_name" autocomplete="name" placeholder="" required>
32 </div>
33 <div class="ml-2 w-3/5">
34 <label for="name" class="block uppercase tracking-wide text-black-v2 text-xs font-bold mb-2">
35 Middle Name
36 </label>
37 <input type="text" v-model="form.middle_name" class="hover:bg-grey-lightest bg-grey-lighter w-full mb-2 p-2 leading-normal" id="middle_name" name="last_name" autocomplete="name" placeholder="" required>
38 </div>
39 <div class="ml-2 w-3/5">
40 <label for="name" class="block uppercase tracking-wide text-black-v2 text-xs font-bold mb-2">
41 Last Name
42 </label>
43 <input type="text" v-model="form.last_name" class="hover:bg-grey-lightest bg-grey-lighter w-full mb-2 p-2 leading-normal" id="last_name" name="last_name" autocomplete="name" placeholder="" required>
44 </div>
45 </div>
46
47 <div class="flex inline-block">
48 <div class="w-3/5">
49 <label for="name" class="block uppercase tracking-wide text-black-v2 text-xs font-bold mb-2">Contact
50 Number**
51 </label>
52 <input type="text" v-model="form.contact_number" class="hover:bg-grey-lightest bg-grey-lighter w-full mb-2 p-2 leading-normal" id="contact_number" name="pin" autocomplete="name" placeholder="" required>
53 </div>
54
55 <div class="w-3/5 ml-2">
56 <label for="name" class="block uppercase tracking-wide text-black-v2 text-xs font-bold mb-2">Contact
57 Person**
58 </label>
59 <input type="text" v-model="form.contact_person" class="hover:bg-grey-lightest bg-grey-lighter w-full mb-2 p-2 leading-normal" id="contact_person" name="contact_person" autocomplete="name" placeholder="" required>
60 </div>
61
62 <div class="ml-2 w-3/5">
63 <label for="name" class="block uppercase tracking-wide text-black-v2 text-xs font-bold mb-2">Status
64 </label>
65 <select v-model="form.status" class="bg-grey-lighter w-full mb-2 p-2 leading-normal" name="" id="">
66 <option value="1">At Large</option>
67 <option value="0">Captured</option>
68 </select>
69 </div>
70 </div>
71
72 <div class="flex inline-block">
73 <div class="mr-2 w-1/2">
74 <label for="name" class="block uppercase tracking-wide text-black-v2 text-xs font-bold mb-2">Bounty
75 </label>
76 <input type="text" v-model="form.bounty" class="hover:bg-grey-lightest bg-grey-lighter w-full mb-2 p-2 leading-normal" id="bounty" name="pin" autocomplete="name" placeholder="" required>
77 </div>
78
79 <div class="mr-2 w-1/2">
80 <label for="currency" class="block uppercase tracking-wide text-black-v2 text-xs font-bold mb-2">Currency</label>
81 <select v-model="form.currency" name="currency" class="bg-grey-lighter w-full mb-2 p-2 leading-normal" id="currency">
82 <!-- @foreach ($countries as $country) -->
83 <option v-for="country in countries" :key="country.id" v-bind:value="country.currency_code">
84 {{ country.name }} {{ country.currency_code }} - {{ country.currency_symbol }}
85 </option>
86 <!-- @endforeach -->
87 </select>
88 </div>
89 </div>
90
91 <div class="flex inline-block">
92
93 <div class="mr-2 w-1/2">
94 <label for="country" class="block uppercase tracking-wide text-black-v2 text-xs font-bold mb-2">Country of
95 Origin</label>
96 <select v-model="form.country_id" name="country" class="bg-grey-lighter w-full mb-2 p-2 leading-normal" id="country">
97 <option v-for="country in countries" :value="country.id">{{ country.name }}</option>
98 </select>
99 </div>
100
101 <div class="w-3/5">
102 <label for="name" class="block uppercase tracking-wide text-black-v2 text-xs font-bold mb-2">Birthplace
103 </label>
104 <places v-model="form.birthplace" class="bg-grey-lighter w-full mb-2 p-2 leading-normal" id="birthplace" placeholder="Enter the full location details" @change="val => { form.birthplace = val }">
105 </places>
106 </div>
107
108 <div class="ml-4 w-3/5">
109 <label for="name" class="block uppercase tracking-wide text-black-v2 text-xs font-bold mb-2">Last
110 Seen in
111 </label>
112
113 <places v-model="form.last_seen" class="bg-grey-lighter w-full mb-2 p-2 leading-normal" id="last_seen" placeholder="Enter the full location details" @change="val => { form.last_seen = val }">
114 </places>
115 </div>
116 </div>
117 <div class="flex inline-block">
118 <div class="w-3/5">
119 <label for="name" class="block uppercase tracking-wide text-black-v2 text-xs font-bold mb-2">Birthdate
120 </label>
121 <datepicker :inline="inlinePicker" :format="customFormatter" wrapper-class="hover:bg-grey-lightest bg-grey-lighter w-full mb-2 p-2
122 leading-normal" v-model="form.birthdate" format="YYYY-M-D">
123 </datepicker>
124 </div>
125 <div class="ml-4 w-3/5">
126 <label for="name" class="block uppercase tracking-wide text-black-v2 text-xs font-bold mb-2">Eye
127 Color
128 </label>
129 <input type="text" v-model="form.eye_color" class="hover:bg-grey-lightest bg-grey-lighter w-full mb-2 p-2 leading-normal" id="eye_color" name="pin" autocomplete="name" placeholder="Blue," required>
130 </div>
131 </div>
132
133
134 <div class="flex inline-block">
135 <div class="w-3/5">
136 <label for="name" class="block uppercase tracking-wide text-black-v2 text-xs font-bold mb-2">Weight
137 In Kilos / Lbs ( Just specify )
138 </label>
139 <input type="text" v-model="form.weight" class="hover:bg-grey-lightest bg-grey-lighter mb-2 p-2 leading-normal" id="weight" name="weight" autocomplete="name" placeholder="any number like 50" required>
140 </div>
141
142 <div class="ml-4 w-3/5">
143 <label for="name" class="block uppe rcase tracking-wide text-black-v2 text-xs font-bold mb-2">Height(just specify
144 if it's cm or m or etc.)
145 </label>
146 <input class="hover:bg-grey-lightest bg-grey-lighter w-full mb-2 p-2 leading-normal" placeholder="168cm" type="text" v-model="form.height" id="height" name="pin" autocomplete="name" required>
147 </div>
148
149 <div class="ml-4 w-3/5">
150 <label for="name" class="block uppercase tracking-wide text-black-v2 text-xs
151 font-bold mb-2">Body Frame
152 </label>
153 <select class="hover:bg-grey-lightest bg-grey-lighter w-full mb-2 p-2 leading-normal" v-model="form.body_frame">
154 <option class="hover:bg-grey-lightest bg-grey-lighter w-full mb-2 p-2 leading-normal"
155 v-for="(option,index) in body_types" :value="option" :key="">
156 {{ option | capitalize }}
157 </option>
158 </select>
159 </div>
160 </div>
161
162 <div class="flex inline-block mt-2 mb-2">
163 <div class="w-1/2">
164 <label for="avatar" class="block uppercase tracking-wide text-black-v2 text-xs font-bold mb-2">
165 Update the photo of this criminal :
166 </label>
167 <!-- <div class="card-body">
168 <div class="row">
169 <div class="col-md-6" v-if="criminalAvatar">
170 <img :src="criminalAvatar" class="img-responsive" height="70" width="90" alt="Criminal Photo">
171 </div>
172 <div class="col-md-6 w-1/2">
173 <input type="file" name="avatar" id="avatar" v-on:change="onAvatarChange" class="form-control hover:bg-grey-lightest bg-grey-lighter w-full mb-2 p-2 leading-normal">
174 </div>
175 </div>
176 </div> -->
177 <div class="card-body">
178 <div class="row">
179 <div class="col-md-6" v-if="form.avatar">
180 <img :src="form.avatar" class="img-responsive" height="70" width="90" alt="Criminal Photo">
181 </div>
182 <div class="col-md-6">
183 <input type="file" name="form.avatar" id="avatar" @change="onAvatarChange" class="bg-white p-2 form-control">
184 </div>
185 </div>
186 </div>
187 </div>
188 </div>
189
190 <div class="w-full flex">
191 <label for="name" class="block uppercase tracking-wide text-black-v2 text-xs font-bold mb-2">
192 List all the Crimes for this person
193 </label>
194 </div>
195
196 <!-- if there are crimes for this person -->
197 <div v-if="criminalCrimes.length">
198 <div v-for="(crime, index) in criminalCrimes" :key="index">
199 <div class="flex w-full inline-block">
200 <select v-model="crime.id" class="hover:bg-grey-lightest bg-grey-lighter w-full mb-2 p-2 leading-normal w-1/3">
201 <option class="hover:bg-grey-lightest bg-grey-lighter w-full mb-2 p-2 leading-normal"
202 v-for="(option,index) in crimes" :value="option.id" :key="">
203 {{ option.criminal_offense }}
204 </option>
205 </select>
206 <input class="hover:bg-grey-lightest bg-grey-lightest w-full mb-2 p-2 leading-normal w-1/2" required type="text" v-model="crime.pivot.crime_description">
207 <span class="ml-2">
208 <button>
209 <i class="fas fa-minus-circle" @click.prevent.stop="removeCrime(index)"></i>
210 </button>
211 </span>
212 </div>
213 </div>
214 <!-- <input type="text" v-model="crime.description"> -->
215 </div>
216
217 <div v-if="newCrimes.length">
218 <div v-for="(crime, index) in newCrimes" :key="index">
219 <div class="flex w-full inline-block">
220 <select v-model="crime.crime_id" class="hover:bg-grey-lightest bg-grey-lighter w-full mb-2 p-2 leading-normal w-1/3">
221 <option class="hover:bg-grey-lightest bg-grey-lighter w-full mb-2 p-2 leading-normal"
222 v-for="(option,index) in crimes" :value="option.id" :key="">
223 {{ option.criminal_offense }}
224 </option>
225 </select>
226 <input class="hover:bg-grey-lightest bg-grey-lightest w-full mb-2 p-2 leading-normal w-1/2" required type="text" v-model="crime.crime_description">
227 <span class="ml-2">
228 <button>
229 <i class="fas fa-minus-circle" @click.prevent.stop="removeNewCrime(index)"></i>
230 </button>
231 </span>
232 </div>
233 </div>
234 <!-- <input type="text" v-model="crime.description"> -->
235 </div>
236 <!-- if there is none then just display the textbox -->
237 <div class="mb-2 mt-2" v-if="newCrimes.length==0 && criminalCrimes==0">
238 <h3>There are no crimes for this criminal. Click on Add new Crime Button to add one</h3>
239 </div>
240
241 <span>
242 <button class="bg-blue-dark text-white p-3 mb-2" @click.prevent.stop="addNewCrime()">Add new Crime
243 </button>
244 </span>
245
246 <label for="name" class="block uppercase tracking-wide text-black-v2 text-xs font-bold mb-2">Complete Background and Details
247 </label>
248
249 <div class="flex inline-block w-full">
250 <VueTrix class="editor1 w-full" inputId="editor1" @trix-change="handleEditorChange" @trix-initialize="handleTrixInit" @trix-attachment-remove="handleAttachmentRemove" @trix-attachment-add="handleAttachmentAdd" v-model="form.complete_description" />
251 </div>
252
253 <div class="mt-4 w-full text-center">
254 <button type="submit" :disabled="isLoading" class="p-4 hover:bg-purple bg-blue w-3/4 font-bold text-white">Save Criminal</button>
255 </div>
256 </form>
257 </div>
258 </div>
259</section>
260
261</template>
262<script>
263import VueTrix from "vue-trix";
264import api from "./scripts/api.js";
265import urls from "./scripts/endpoints.js";
266import Places from 'vue-places';
267import datepicker from 'vue-date-picker';
268import _ from "lodash";
269export default {
270 props : [ 'crimes', 'criminal', 'admins', 'countries','body_types'],
271
272 components : {
273 'VueTrix' : VueTrix,
274 'places' : Places,
275 'datepicker' : datepicker
276 },
277 data(){
278 return {
279 inlinePicker : true,
280
281 input: {
282 crimes : this.criminal.crimes
283 },
284
285 criminalCrimes : this.criminal.crimes,
286
287 newCrimes : [],
288
289 crimesList : [],
290
291 send_attachment_endpoint : urls.url_for_saving_photos ,
292
293 isLoading : null,
294
295 datepickerClass : ['hover:bg-grey-lightest','bg-grey-lighter','w-full','mb-2','p-2', 'leading-normal'],
296
297 country : this.criminal.country_id,
298
299 form : {
300 id :null ,
301 avatar : this.criminalAvatar,
302 birthplace : null ,
303 full_name :null ,
304 alias :null ,
305 first_name :null ,
306 posted_by :null ,
307 middle_name :null ,
308 last_name : null ,
309 contact_number :null ,
310 contact_person : null ,
311 status : null,
312 last_seen : null,
313 birthdate : null,
314 eye_color : null,
315 weight : null,
316 height : null,
317 country_of_origin : null,
318 avatar : null,
319 complete_description : null,
320 height_in_cm : null,
321 body_frame : null,
322 currency : null,
323 bounty : null,
324 maxFiles: 1,
325 uploadUrl: urls.urlSaveCriminal,
326 attachments : [],
327 country_id : 4 ,
328 },
329
330 posted_by : this.criminal.posted_by,
331
332 max_files: { // total # of files allowed to be uploaded
333 type: Number,
334 required: false,
335 default: 10
336 }
337 }
338 },
339
340 methods : {
341
342 handleTrixInit(file){
343 console.log("file",file);
344 },
345
346 customFormatter(date) {
347 return moment(date).format('MMMM Do YYYY, h:mm:ss a');
348 },
349
350 /*
351 removeCrime(input,index){
352 console.log(input);
353 // axios.delete(this.remove_crime_endpoint)
354 },*/
355
356 uploadAttachment(file,progressCallback,successCallback){
357 if(!file){
358 return;
359 }
360
361 const _this = this;
362 console.log('uploading!');
363 let formData = new FormData();
364 formData.append('file', file);
365 formData.append('attachable_type','App\CriminalInfo');
366 formData.append('field','complete_description');
367 axios.post(this.send_attachment_endpoint, formData, {
368 headers: {
369 'Content-Type': 'multipart/form-data',
370 },
371 onUploadProgress: (progressEvent) => {
372 const totalLength = progressEvent.lengthComputable
373 ? progressEvent.total
374 : progressEvent.target.getResponseHeader('content-length') ||
375 progressEvent.target.getResponseHeader('x-decompressed-content-length');
376 console.log('onUploadProgress', totalLength);
377 if (totalLength !== null) {
378 const progressData = Math.round((progressEvent.loaded * 100) / totalLength);
379 progressCallback(progressData);
380 }
381 },
382 }).then((response) => {
383 progressCallback(100);
384 // this bit is not axios way of doing it so I provided a value so it wont keep the loading bar
385 let attachment = response.data;
386 const attributes = {
387 url: attachment.url,
388 href: attachment.url +"?content-disposition=attachment"
389 };
390 successCallback(attributes);
391 }).catch((error) => {
392 console.log('FAILURE!!', error);
393 });
394 this.requesting = false;
395 },
396 /*Updating a profile.*/
397 updateProfile(){
398 this.$swal('Wait for sometime. The page will just refresh by its own');
399
400 if ( this.criminalCrimes.length > 0 || this.newCrimes.length > 0){
401 setTimeout(() => {
402 this.isLoading = false;
403 this.requesting = true;
404 this.creating = true;
405 this.resetting = false;
406 axios.put(this.endpoint, {
407 id : this.criminal.id,
408 form : this.form,
409 criminalCrimes : this.criminalCrimes,
410 newCrimes : this.newCrimes
411 }).then(response => {
412 // console.log(response);
413 window.location.replace("/admin/criminals/"+this.criminal.id);
414 }).catch((error) => {
415 // alert(error);
416 this.$swal("We encounter an error please check your inputs as there are some issues with your inputs");
417 });
418 this.requiredesting = false;
419 this.creating = false;
420 }, 1000);
421 }
422 else {
423 this.$swal('You cannot proceed if you don\'t add Crimes for this Criminal now');
424 }
425 },
426 updateUserRoute(){
427 return `/`;
428 },
429
430 onAvatarChange(e){
431 let files = e.target.files || e.dataTransfer.files;
432 if (!files.length)
433 return;
434 this.createImage(files[0]);
435 },
436
437
438 /* async setData(file) {
439 const formData = new FormData();
440 formData.append('type', file.type);
441 formData.append('file', await this.fileToBlob(file.location)); // filereader image object which can be sent to the server
442 formData.append('name', file.new_name);
443 formData.append('url', file.location);
444
445 return formData;
446 },*/
447
448 createImage(file){
449 let reader = new FileReader();
450 let vm = this;
451 vm.form.avatar = file;
452 reader.onload = (e) => {
453 vm.form.avatar = e.target.result;
454 };
455 reader.readAsDataURL(file);
456 },
457
458 mountAvatar(e){
459 let files = this.form.avatar;
460 if (!files.length)
461 return;
462 this.createImage(files[0]);
463 },
464
465 isEmpty(obj) {
466 return !obj || Object.keys(obj).length === 0;
467 },
468
469 addNewCrime(){
470 this.newCrimes.push({ crime_id: 1, crime_description : "" });
471 },
472
473 removeCrime(index) {
474 this.criminalCrimes.splice(index,1);
475 },
476 removeNewCrime(index) {
477 this.newCrimes.splice(index,1);
478 },
479
480 /*
481 this.inputs.push({
482 criminal_offense_id: Math.random().toFixed(2),
483 criminal_offense_description: this.form.complete_description
484})*/
485 // this.inputs.push({ criminal_offense_id: 1, criminal_offense_description : "" });
486
487 updateCriminal(){
488 setTimeout(() => {
489 this.isLoading = false;
490 this.requesting = true;
491 this.creating = true;
492 this.resetting = false;
493
494 axios.post(this.endpoint,{
495 form : this.form,
496 crimes : this.input
497 }).then(response => {
498 if ( response.status === 200){
499 alert("Successfully Registered This Criminal");
500 this.resetForm();
501 }
502 else {
503 alert("We encounter some errors while adding that criminal");
504 }
505 }).catch((error) => {
506 console.error((error));
507 alert("We encounter some errors while adding that criminal, try to check your inputs");
508 });
509 this.requesting = false;
510 this.creating = false;
511 }, 1000);
512
513 },
514
515 getInputValue(obj, key) {
516 const inputValue = document.getElementById(obj + "_" + key).value;
517 if (inputValue.length > 0) {
518 this.$set(this.form.obj, key, inputValue);
519 } else {
520 this.$delete(this.form.obj, key);
521 }
522 },
523
524 handleAttachmentAdd(event){
525 console.log("Description: "+this.form.complete_description);
526
527 console.log(event);
528 if(this.requesting || this.creating || this.resetting){
529 event.preventDefault();
530 return false;
531 }
532
533 const attachment = event.attachment;
534
535 if(!attachment.file){
536 return;
537 }
538
539 this.requesting = true;
540
541 this.uploadAttachment(attachment.file, setProgress, setAttributes);
542
543 function setProgress(progress) {
544 attachment.setUploadProgress(progress)
545 }
546
547 function setAttributes(attributes) {
548 attachment.setAttributes(attributes)
549 }
550
551 /*var attachment = event.attachment;
552 console.log(attachment);
553 if (attachment.file){
554 const data = attachment;
555 const config = {
556 onUploadProgress: progressEvent => {
557 var progress = progressEvent.loaded / progressEvent.total * 100;
558 attachment.setUploadProgress(progress);
559 }
560 }
561
562 axios.post(this.send_attachment_endpoint,data,config)
563 .then((response) => {
564 console.log("Response is:");
565 console.log(response);
566 if (response.status === 201) {
567 setTimeout(function() {
568 var url = response.data;
569 attachment.setAttributes({ url: url, href: url });
570 }, 30)
571 }
572 console.log(response.data);
573 }).catch(error => console.log(error));
574 attachment.setUploadProgress(10);
575 setTimeout(function(e) {
576 console.log("Set TimeOut:");
577 console.log(e);
578 // var url = xhr.responseText;
579 // return attachment.setAttributes({ url: url, href: url });
580 }, 30)
581 }
582 else {
583 return response("No file uploaded here",401);
584 }*/
585
586 },
587
588/*async handleAttachmentAdd(evt){
589let file = evt.attachment.file
590let form = new FormData()
591form.append('Content-Type', file.type)
592form.append('image', file)
593const resp = await this.$store.dispatch('imageUpload', form)
594evt.attachment.setUploadProgress(100)
595console.log(resp)
596evt.attachment.setAttributes({
597 url: resp.data.url,
598 href: resp.data.url
599})
600},*/
601
602handleEditorChange(file){
603 console.log('file',file);
604},
605
606handleAttachmentRemove(file){
607
608 // console.log(file);
609 // console.log("Trying to delete",file);
610 let url = file.attachment.attachment.attributes.values.url.split("/").pop();
611
612 console.log(url);
613
614 axios.delete(this.remove_attachment_endpoint + `${url}`).then(response => {
615 console.log(response);
616 }).catch(error => {
617 console.log(error);
618 });
619
620},
621},
622computed : {
623
624 criminalAvatar(){
625 if (this.criminal.photo == "default_avatar.jpg"){
626 return urls.urlDomain + `/assets/images/default_avatar.jpg`;
627 }
628 else {
629 return `${window.App.assetStorageCriminalsPath}/${this.criminal.photo}`;
630 }
631 },
632
633 endpoint(){
634 return urls.urlUpdateCriminal +"/" +this.criminal.id;
635 },
636
637 remove_attachment_endpoint(){
638 return api.app + '/api/v1/attachments/' ;
639 },
640 crimeTypes(){
641 return this.crimes
642 }
643},
644
645created(){
646
647
648 if (this.criminal.profile !== null){
649 alert("No profile was listed for this criminal, please create one for this criminal");
650 }
651
652 if(this.criminal){
653 this.form.id = this.criminal.id ;
654 this.form.full_name = this.criminal.full_name ,
655 this.form.first_name = this.criminal.first_name,
656 this.form.alias = this.criminal.alias,
657 this.form.posted_by = this.criminal.posted_by,
658 this.form.middle_name = this.criminal.middle_name,
659 this.form.last_name = this.criminal.last_name,
660 this.form.contact_number = this.criminal.contact_number,
661 this.form.contact_person = this.criminal.contact_person,
662 this.form.status = this.criminal.status
663 /*if there's a profile found*/
664 if(this.criminal.profile){
665 this.form.complete_description = _.unescape(this.criminal.profile.complete_description),
666 this.form.last_seen = this.criminal.profile.last_seen,
667 this.form.birthdate = this.criminal.profile.birthdate,
668 this.form.birthplace = this.criminal.profile.birthplace,
669 this.form.eye_color = this.criminal.profile.eye_color,
670 this.form.weight = this.criminal.profile.weight_in_kilos,
671 this.form.height = this.criminal.profile. height_in_feet_and_inches,
672 this.form.country_of_origin = this.criminal.profile.country_of_origin,
673 this.form.avatar = this.criminalAvatar,
674 /* this.form.complete_description = this.criminal.profile.complete_description,*/
675
676 this.form.height_in_cm = this.criminal.profile.height_in_feet_and_inches,
677 this.form.maxFiles = 1,
678 this.form.body_frame = this.criminal.profile.body_frame,
679 this.form.currency = this.criminal.profile.currency,
680 this.form.bounty = this.criminal.profile.bounty
681 }
682 else {
683 this.form.last_seen = this.criminal.profile.last_seen,
684 this.form.birthdate = this.criminal.profile.birthdate,
685 this.form.birthplace = this.criminal.profile.birthplace,
686 this.form.eye_color = this.criminal.profile.eye_color,
687 this.form.weight = this.criminal.profile.weight_in_kilos,
688 this.form.height = this.criminal.profile. height_in_feet_and_inches,
689 this.form.country_of_origin = this.criminal.profile.country_of_origin,
690 this.form.avatar = this.criminalAvatar,
691 this.form.complete_description = this.criminal.profile.complete_description,
692 this.form.height_in_cm = this.criminal.profile.height_in_feet_and_inches,
693 this.form.maxFiles = 1,
694 this.form.body_frame = this.criminal.profile.body_frame,
695 this.form.currency = this.criminal.profile.currency,
696 this.form.bounty = this.criminal.profile.bounty
697 }
698 }
699}
700
701};
702</script>
703
704<style>
705.trix-content {
706 height: 500px;
707 overflow-y: auto;
708}
709/*.vue_component__upload--image
710.upload_image_form__thumbnails
711.upload_image_form__thumbnail [&.bad-size, &.uploaded]
712.img [&.show, &:hover]
713span*/
714</style>