Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 6670 | Rev 6672 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
5050 efrain 1
<?php
6552 stevensc 2
 
6521 efrain 3
use LeadersLinked\Model\ContentReaction;
4
 
6388 efrain 5
$acl            = $this->viewModel()->getRoot()->getVariable('acl');
6
$currentUser    = $this->currentUserHelper();
7
$roleName       = $currentUser->getUserTypeId();
5050 efrain 8
 
6388 efrain 9
$routeQuestions     = $this->url('my-coach/questions');
10
$routeQuestionAdd   = $this->url('my-coach/questions/add');
11
$allowQuestionAdd   = $acl->isAllowed($roleName, 'my-coach/questions/add') ? 1 : 0;
5050 efrain 12
 
6388 efrain 13
 
14
 
15
 
16
$this->inlineScript()->appendFile($this->basePath('vendors/ckeditor/ckeditor.js'));
17
 
18
$this->headLink()->appendStylesheet($this->basePath('vendors/nprogress/nprogress.css'));
19
$this->inlineScript()->appendFile($this->basePath('vendors/nprogress/nprogress.js'));
20
 
21
$this->headLink()->appendStylesheet($this->basePath('vendors/select2/css/select2.min.css'));
22
$this->headLink()->appendStylesheet($this->basePath('vendors/select2-bootstrap4-theme/select2-bootstrap4.min.css'));
23
$this->inlineScript()->appendFile($this->basePath('vendors/select2/js/select2.min.js'));
24
 
25
$this->inlineScript()->appendFile($this->basePath('vendors/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
26
$this->inlineScript()->appendFile($this->basePath('vendors/jsrender/jsrender.min.js'));
27
 
28
 
29
$this->inlineScript()->appendFile($this->basePath('vendors/jquery-validation/jquery.validate.js'));
30
$this->inlineScript()->appendFile($this->basePath('vendors/jquery-validation/additional-methods.js'));
31
$this->inlineScript()->appendFile($this->basePath('vendors/jquery-validation/localization/messages_es.js'));
32
 
33
$this->inlineScript()->captureStart();
34
echo <<<JS
35
 
36
jQuery( document ).ready(function( $ ) {
37
 
6547 efrain 38
    $.fn.confirmationAnswers = function() {
6521 efrain 39
 
6547 efrain 40
        $('button.btn-my-coach-delete-answer').confirmation({
41
            rootSelector: 'button.btn-my-coach-delete-answer',
42
            title : 'LABEL_ARE_YOU_SURE',
43
            singleton : true,
44
            btnOkLabel: 'LABEL_YES',
45
            btnCancelLabel: 'LABEL_NO',
46
            onConfirm: function(value) {
47
                var action = $(this).data('link');
48
                var question = $(this).data('question');
49
                var answer = $(this).data('answer');
50
 
51
 
52
                NProgress.start();
53
                $.ajax({
54
                    'dataType'  : 'json',
55
                    'accept'    : 'application/json',
56
                    'method'    : 'post',
57
                    'url'       :  action,
58
                }).done(function(response) {
59
                    if(response['success']) {
60
 
61
                        $('#row-' + answer).remove();
62
 
63
                        $('#answers-' + question).html(response['data']['total_answers']);
6649 stevensc 64
                        $('#my-coach-question-answer-count-answers').html(response['data']['total_answers'] + ' LABEL_MY_COACH_ANSWERS');
6547 efrain 65
 
66
                        $('#reactions-' + question).html( response['data']['total_reactions']);
6649 stevensc 67
                        $('#my-coach-question-answer-count-reactions').html( response['data']['total_reactions'] + ' LABEL_MY_COACH_REACTIONS');
6547 efrain 68
 
69
                        $('#comments-' + question).html(response['data']['total_comments']);
6649 stevensc 70
                        $('#my-coach-question-answer-count-comments').html(response['data']['total_comments'] + ' LABEL_COMMENTS');
6547 efrain 71
 
72
                    } else {
73
                        $.fn.showError(response['data']);
74
                    }
75
                }).fail(function( jqXHR, textStatus, errorThrown) {
76
                    $.fn.showError(textStatus);
77
                }).always(function() {
78
                    NProgress.done();
79
                });
80
 
81
                return false;
82
            },
83
        });
84
    }
85
 
86
 
6521 efrain 87
    $.fn.reloadAnswers = function() {
88
 
89
        var action = $('#row-view').data('link-answers');
90
 
6388 efrain 91
        NProgress.start();
92
        $.ajax({
93
            'dataType'  : 'json',
94
            'accept'    : 'application/json',
95
            'method'    : 'get',
6521 efrain 96
            'url'       : action,
97
        }).done(function(response) {
98
            if(response['success']) {
99
                $('#my-coach-question-answers-list').empty();
100
                if(response['data']['items'].length > 0) {
101
                    $( "#my-coach-question-answers-list" ).html(
102
                		$( "#answerTemplate" ).render( response['data']['items'] )
103
                	);
6523 efrain 104
                }
6547 efrain 105
                $.fn.confirmationAnswers();
6521 efrain 106
 
6547 efrain 107
 
6521 efrain 108
 
109
            } else {
110
                $.fn.showError(response['data']);
111
            }
112
        }).fail(function( jqXHR, textStatus, errorThrown) {
113
            $.fn.showError(textStatus);
114
        }).always(function() {
115
            NProgress.done();
116
        });
117
 
118
    }
119
 
120
    $.fn.reload = function() {
121
 
122
        NProgress.start();
123
        $.ajax({
124
            'dataType'  : 'json',
125
            'accept'    : 'application/json',
126
            'method'    : 'get',
6388 efrain 127
            'url'       :  '$routeQuestions',
128
            'data'      : {
129
                'search' : $('#form-filter #search').val(),
130
                'category_id' : $('li.my-coach-category-li-selected > a.my-coach-category-a').data('uuid') ,
131
 
132
            }
133
        }).done(function(response) {
134
            if(response['success']) {
135
                $('#my-coach-record-list').empty();
136
 
137
 
138
                if(response['data']['items'].length > 0) {
139
 
140
 
141
 
142
                    $( "#my-coach-record-list" ).html(
143
                		$( "#recordTemplate" ).render( response['data']['items'] )
144
                	);
145
                } else {
146
                    var html = '<div class="company-title"><div class="widget widget-jobs"><div class="sd-title">ERROR_NO_RECORD_MATCHED_YOUR_QUERY</div></div></div>';
147
                    $( "#my-coach-record-list" ).html(html);
148
                }
149
 
150
 
6521 efrain 151
                $('button.btn-my-coach-delete-question').confirmation({
152
                    rootSelector: 'button.btn-my-coach-delete-question',
6388 efrain 153
                    title : 'LABEL_ARE_YOU_SURE',
154
                    singleton : true,
155
                    btnOkLabel: 'LABEL_YES',
156
                    btnCancelLabel: 'LABEL_NO',
157
                    onConfirm: function(value) {
158
                        var action = $(this).data('link');
159
                        NProgress.start();
160
                        $.ajax({
161
                            'dataType'  : 'json',
162
                            'accept'    : 'application/json',
163
                            'method'    : 'post',
164
                            'url'       :  action,
165
                        }).done(function(response) {
166
                            if(response['success']) {
167
                                $.fn.showSuccess(response['data']);
168
 
169
                                $.fn.reload();
170
                            } else {
171
                                $.fn.showError(response['data']);
172
                            }
173
                        }).fail(function( jqXHR, textStatus, errorThrown) {
174
                            $.fn.showError(textStatus);
175
                        }).always(function() {
176
                            NProgress.done();
177
                        });
178
 
179
                        return false;
180
                    },
181
                });
182
 
183
            } else {
184
                $.fn.showError(response['data']);
185
            }
186
        }).fail(function( jqXHR, textStatus, errorThrown) {
187
            $.fn.showError(textStatus);
188
        }).always(function() {
189
            NProgress.done();
190
        });
191
 
192
    }
193
 
194
 
195
    $.validator.setDefaults({
196
        debug: true,
197
        highlight: function(element) {
198
            $(element).addClass('is-invalid');
199
        },
200
        unhighlight: function(element) {
201
            $(element).removeClass('is-invalid');
202
        },
203
        errorElement: 'span',
204
        errorClass: 'error invalid-feedback',
205
        errorPlacement: function(error, element) {
206
            if(element.parent('.btn-file').length) {
207
                error.insertAfter(element.parent().parent());
208
            } else if(element.parent('.toggle').length) {
209
                error.insertAfter(element.parent().parent());
210
            } else {
211
                error.insertAfter(element.parent());
212
            }
213
        }
214
    });
215
 
216
 
217
    $.fn.showFormErrorValidator = function(fieldname, errors) {
218
        var field = $(fieldname);
219
        if(field) {
220
            $(field).addClass('is-invalid');
221
 
222
 
223
            var error = $('<span id="' + fieldname +'-error" class="error invalid-feedback">' + errors + '</div>');
224
            if(element.parent('.btn-file').length) {
225
                error.insertAfter(element.parent().parent());
226
            } else if(element.parent('.toggle').length) {
227
                error.insertAfter(element.parent().parent());
228
            } else {
229
                error.insertAfter(element.parent());
230
            }
231
        }
232
    };
233
 
234
    var validatorQuestion = $('#form-question').validate({
235
        debug: true,
236
        onclick: false,
237
        onkeyup: false,
238
        ignore: [],
239
        rules: {
240
            'category_id': {
241
                required: true,
242
            },
243
            'title': {
244
                required: true,
245
                maxlength: 128,
246
            },
247
            'description': {
248
                updateCkeditor:function() {
249
                        CKEDITOR.instances.description_question.updateElement();
250
                },
251
 
252
                required: true
253
            },
254
 
255
        },
256
        submitHandler: function(form)
257
        {
258
 
259
 
260
			NProgress.start();
261
            $.ajax({
262
                'dataType'  : 'json',
263
                'accept'    : 'application/json',
264
                'method'    : 'post',
265
                'url'       :  $('#form-question').attr('action'),
266
                'data'      :  $('#form-question').serialize(),
267
 
268
            }).done(function(response) {
269
 
270
				if(response['success']) {
271
 
272
                    $('#modal-question').modal('hide');
273
 
274
                    $.fn.showSuccess(response['data']);
275
                    $.fn.reload();
276
 
277
 
278
 
279
                } else {
280
                    validatorQuestion.resetForm();
281
                    if(jQuery.type(response['data']) == 'string') {
282
                        $.fn.showError(response['data']);
283
                    } else  {
284
                        $.each(response['data'], function( fieldname, errors ) {
285
                            $.fn.showFormErrorValidator('#form-question #' + fieldname, errors);
286
                        });
287
                    }
288
                }
289
            }).fail(function( jqXHR, textStatus, errorThrown) {
290
                $.fn.showError(textStatus);
291
            }).always(function() {
292
                NProgress.done();
293
            });
294
            return false;
295
        },
296
        invalidHandler: function(form, validator) {
297
 
298
        }
299
    });
300
 
6547 efrain 301
    var  validatorAnswer = $('#form-answer').validate({
6521 efrain 302
        debug: true,
303
        onclick: false,
304
        onkeyup: false,
305
        ignore: [],
306
        rules: {
307
            'description': {
308
                updateCkeditor:function() {
309
                        CKEDITOR.instances.description_answer.updateElement();
310
                },
311
 
312
                required: true
313
            },
314
 
315
        },
316
        submitHandler: function(form)
317
        {
6547 efrain 318
 
6388 efrain 319
 
6521 efrain 320
			NProgress.start();
321
            $.ajax({
322
                'dataType'  : 'json',
323
                'accept'    : 'application/json',
324
                'method'    : 'post',
325
                'url'       :  $('#form-answer').attr('action'),
326
                'data'      :  $('#form-answer').serialize(),
327
 
328
            }).done(function(response) {
329
				if(response['success']) {
6547 efrain 330
                    var method = $('#form-answer').data('method');
331
                    var answer = $('#form-answer').data('answer');
332
 
333
 
6521 efrain 334
                    $('#modal-answer').modal('hide');
335
 
6547 efrain 336
                    if(method == 'add') {
337
                        var uuid = $('#row-view').data('question-uuid');
338
                        $('#answers-' + uuid).html(response['data']['answers']);
6649 stevensc 339
                        $('#my-coach-question-answer-count-answers').html(response['data']['answers'] + ' LABEL_MY_COACH_ANSWERS');
6547 efrain 340
                        $('#my-coach-question-answers-list').prepend(
341
                            $('#answerTemplate').render(response['data']['item'])
342
                        );
343
                        $.fn.confirmationAnswers()
344
                    } else {
345
                        $('#answer-text-' + answer).empty();
346
                        $('#answer-text-' + answer).html(response['data']['description']);
347
                    }
6521 efrain 348
                } else {
349
                    validatorAnswer.resetForm();
350
                    if(jQuery.type(response['data']) == 'string') {
351
                        $.fn.showError(response['data']);
352
                    } else  {
353
                        $.each(response['data'], function( fieldname, errors ) {
354
                            $.fn.showFormErrorValidator('#form-answer #' + fieldname, errors);
355
                        });
356
                    }
357
                }
358
            }).fail(function( jqXHR, textStatus, errorThrown) {
359
                $.fn.showError(textStatus);
360
            }).always(function() {
361
                NProgress.done();
362
            });
363
            return false;
364
        },
365
        invalidHandler: function(form, validator) {
366
 
367
        }
368
    });
369
 
370
 
6388 efrain 371
    $('a.my-coach-category-a').click(function(e) {
372
        e.preventDefault();
373
 
374
 
375
        $('li.my-coach-category-li').removeClass('my-coach-category-li-selected');
376
        $(this).closest('li.my-coach-category-li').addClass('my-coach-category-li-selected');
377
 
378
        $.fn.reload();
379
    });
380
 
381
    $('body').on('click', 'button.btn-my-coach-edit', function(e) {
382
        e.preventDefault();
383
        var action = $(this).data('link');
384
        NProgress.start();
385
        $.ajax({
386
            'dataType'  : 'json',
387
            'accept'    : 'application/json',
388
            'method'    : 'get',
389
            'url'       :  action,
390
        }).done(function(response) {
391
            if(response['success']) {
392
 
393
                $('#form-question').attr('action', action);
394
                $('#form-question #category_id').val(response['data']['category_id']).trigger('change');
395
                $('#form-question #title').val(response['data']['title']);
396
                CKEDITOR.instances.description_question.setData(response['data']['description']);
397
 
398
                $('#modal-question').modal('show');
399
            } else {
400
                $.fn.showError(response['data']);
401
            }
402
        }).fail(function( jqXHR, textStatus, errorThrown) {
403
            $.fn.showError(textStatus);
404
        }).always(function() {
405
            NProgress.done();
406
        });
407
 
408
    });
409
 
410
 
411
    $('#form-filter #search').keyup(function(e) {
412
 
413
        e.preventDefault();
414
 
415
        $.fn.reload();
416
    })
417
 
418
    $('button.btn-search').click(function(e) {
419
        e.preventDefault();
420
 
421
        $.fn.reload();
422
    });
423
 
424
    $('#my-coach-add-question').click(function(e) {
425
        e.preventDefault();
426
 
427
        $('#form-question').attr('action', '$routeQuestionAdd');
428
        $('#form-question #title').val('');
429
        $('#form-question #category_id').val('').trigger('change');
430
        CKEDITOR.instances.description_question.setData('');
431
 
432
        $('#modal-question').modal('show');
433
    });
434
 
435
    $('#form-question #category_id').select2({
436
        theme: 'bootstrap4'
437
    })
438
 
439
    $('button.btn-cancel').click(function(e) {
440
        e.preventDefault();
441
 
442
 
443
        $('#modal-question').modal('hide');
6521 efrain 444
        $('#modal-answer').modal('hide');
6388 efrain 445
    });
446
 
6521 efrain 447
    $('#my-coach-question-answer-btn-delete').confirmation({
448
        rootSelector: 'button.my-coach-question-answer-btn-delete',
449
        title : 'LABEL_ARE_YOU_SURE',
450
        singleton : true,
451
        btnOkLabel: 'LABEL_YES',
452
        btnCancelLabel: 'LABEL_NO',
453
        onConfirm: function(value) {
454
            var action = $(this).data('link');
455
            var uuid = $(this).data('question-uuid');
456
 
457
            NProgress.start();
458
            $.ajax({
459
                'dataType'  : 'json',
460
                'accept'    : 'application/json',
461
                'method'    : 'post',
462
                'url'       :  action,
463
            }).done(function(response) {
464
                if(response['success']) {
465
                    $.fn.showSuccess(response['data']);
466
 
467
                    var uuid = $('#row-view').data('question-uuid');
468
                    var key = 'my-coach-record-card-question-' + uuid;
469
                    $('#' + key).remove();
470
 
471
                    $('#row-view').hide();
472
 
473
                    $('#my-coach-add-question').show();
474
                    $('#row-list').show();
475
 
476
 
477
 
478
                } else {
479
                    $.fn.showError(response['data']);
480
                }
481
            }).fail(function( jqXHR, textStatus, errorThrown) {
482
                $.fn.showError(textStatus);
483
            }).always(function() {
484
                NProgress.done();
485
            });
486
 
487
            return false;
488
        },
489
    });
490
 
491
 
492
    $('body').on('click', 'button.btn-my-coach-edit-view', function(e) {
493
        e.preventDefault();
494
        var action = $(this).data('link');
495
 
496
        NProgress.start();
497
        $.ajax({
498
            'dataType'  : 'json',
499
            'accept'    : 'application/json',
500
            'method'    : 'get',
501
            'url'       :  action,
502
        }).done(function(response) {
503
            if(response['success']) {
504
                $('#row-view').data('link-answers', response['data']['link_answers']);
505
                $('#row-view').data('question-uuid', response['data']['uuid']);
506
 
507
 
6547 efrain 508
                if(!response['data']['link_answers_add']) {
509
                    $('#my-coach-question-answer-btn-answer').hide();
510
                } else {
511
                    $('#my-coach-question-answer-btn-answer').data('link', response['data']['link_answers_add']);
512
                    $('#my-coach-question-answer-btn-answer').show();
513
                }
6521 efrain 514
 
6547 efrain 515
                if(!response['data']['link_delete']) {
516
                    $('#my-coach-question-answer-btn-delete').hide();
517
                } else {
518
                    $('#my-coach-question-answer-btn-delete').data('link', response['data']['link_delete']);
519
                    $('#my-coach-question-answer-btn-delete').show();
520
                }
6521 efrain 521
 
522
                $('#my-coach-question-user-image').attr('src', response['data']['user_image']);
523
                $('#my-coach-question-user-name').html(response['data']['user_name']);
524
                $('#my-coach-question-title').html(response['data']['title']);
6569 stevensc 525
                $('#my-coach-question-description').html(response['data']['description'].replace('<p>',''));
6521 efrain 526
 
527
                $('#my-coach-answer-categories').empty();
528
                $.each(response['data']['categories'], function(key, value) {
529
 
530
                    var li = $('<li>');
531
                    li.text(value.category).appendTo('#my-coach-answer-categories')
532
                });
533
 
6568 stevensc 534
                $('#my-coach-question-answer-question-date').append(response['data']['added_on']);
535
                $('#my-coach-question-answer-last-date').append(response['data']['last_answer_on']);
6648 stevensc 536
                $('#my-coach-question-answer-count-answers').html(response['data']['answers'] + ' LABEL_MY_COACH_ANSWERS');
6649 stevensc 537
                $('#my-coach-question-answer-count-reactions').html(response['data']['reactions'] + ' LABEL_MY_COACH_REACTIONS');
538
                $('#my-coach-question-answer-count-views').html(response['data']['views'] + ' LABEL_MY_COACH_VIEWS');
539
                $('#my-coach-question-answer-count-comments').html(response['data']['comments'] + ' LABEL_COMMENTS');
6521 efrain 540
 
541
                $('#views-' + response['data']['uuid']).html( response['data']['views'] );
542
 
543
 
544
                $('#my-coach-add-question').hide();
545
                $('#row-list').hide();
546
                $('#row-view').show();
547
 
548
                $.fn.reloadAnswers();
549
 
550
            } else {
551
                $.fn.showError(response['data']);
552
            }
553
        }).fail(function( jqXHR, textStatus, errorThrown) {
554
            $.fn.showError(textStatus);
555
        }).always(function() {
556
            NProgress.done();
557
        });
558
    });
559
 
560
    $('#my-coach-question-answer-btn-back').click(function(e) {
561
        e.preventDefault();
562
 
563
        $('#my-coach-add-question').show();
564
        $('#row-view').hide();
565
        $('#row-list').show();
566
 
567
    });
568
 
6547 efrain 569
    /****** RESPUESTAS ******/
6521 efrain 570
 
6547 efrain 571
    $('body').on('click', 'button.btn-my-coach-edit-answer', function(e) {
572
        e.preventDefault();
573
        var action = $(this).data('link');
574
        var answer = $(this).data('answer');
575
        NProgress.start();
576
        $.ajax({
577
            'dataType'  : 'json',
578
            'accept'    : 'application/json',
579
            'method'    : 'get',
580
            'url'       :  action,
581
        }).done(function(response) {
582
            if(response['success']) {
583
 
584
                $('#modal-answer-title').html('LABEL_MY_COACH_ANSWER_EDIT');
585
                $('#form-answer').attr('action', action );
586
                $('#form-answer').data('method','edit');
587
                $('#form-answer').data('answer', answer);
588
                CKEDITOR.instances.description_answer.setData(response['data']['description']);
589
                validatorAnswer.resetForm();
590
 
591
                $('#modal-answer').modal('show');
592
            } else {
593
                $.fn.showError(response['data']);
594
            }
595
        }).fail(function( jqXHR, textStatus, errorThrown) {
596
            $.fn.showError(textStatus);
597
        }).always(function() {
598
            NProgress.done();
599
        });
600
 
601
    });
602
 
603
 
6521 efrain 604
    $('#my-coach-question-answer-btn-answer').click(function(e) {
605
        e.preventDefault();
6547 efrain 606
        console.log('agregar respuesta link = ' + $(this).data('link') );
6521 efrain 607
 
6547 efrain 608
        $('#modal-answer-title').html('LABEL_MY_COACH_ANSWER_ADD');
6521 efrain 609
        $('#form-answer').attr('action', $(this).data('link') );
6547 efrain 610
        $('#form-answer').data('method','add');
611
        $('#form-answer').data('answer', '');
6521 efrain 612
        CKEDITOR.instances.description_answer.setData('');
6547 efrain 613
        validatorAnswer.resetForm();
6521 efrain 614
 
615
        $('#modal-answer').modal('show');
616
    });
617
 
618
    $('body').on('click', 'a.btn-comment-trash', function(e) {
619
        e.preventDefault();
620
        var action = $(this).data('link');
621
        var unique = $(this).data('comment-unique');
622
        var answer_uuid = $(this).data('answer-uuid');
623
        var question_uuid = $('#row-view').data('question-uuid');
624
 
625
 
626
 
627
        NProgress.start();
628
        $.ajax({
629
            'dataType'  : 'json',
630
            'accept'    : 'application/json',
631
            'method'    : 'post',
632
            'url'       :  action,
633
        }).done(function(response) {
634
            if(response['success']) {
635
                $('div.comment-' + unique).remove();
636
 
637
                //Listado de la respuesta
638
                $('#answer-total-comment-' + answer_uuid).html( response['data']['total_comments_answer'] );
639
 
640
                //Encabezado pregunta del view
6649 stevensc 641
                $('#my-coach-question-answer-count-comments').html( response['data']['total_comments_question'] + ' LABEL_COMMENTS');
6521 efrain 642
 
643
                //Listado de preguntas
644
                $('#comments-' + question_uuid).html( response['data']['total_comments_question'] );
645
 
646
 
647
            } else {
648
                $.fn.showError(response['data']);
649
            }
650
        }).fail(function( jqXHR, textStatus, errorThrown) {
651
            $.fn.showError(textStatus);
652
        }).always(function() {
653
            NProgress.done();
654
        });
655
 
656
    });
657
 
658
    $('body').on('submit', 'form.feedCommentContainer', function(e) {
659
        e.preventDefault();
660
 
661
        var action          = $(this).attr('action');
662
        var answer_uuid     = $(this).data('answer');
663
        var question_uuid   = $('#row-view').data('question-uuid');
664
        var form_id         = $(this).attr('id');
665
 
666
        var comment = $('#' + form_id + ' #comment').val().trim();
667
        if(comment.length == 0) {
668
            return;
669
        }
670
 
671
        NProgress.start();
672
        $.ajax({
673
            'dataType'  : 'json',
674
            'accept'    : 'application/json',
675
            'method'    : 'post',
676
            'url'       : action,
677
            'data'      : $(this).serialize()
678
 
679
        }).done(function(response) {
680
		  if(response['success']) {
681
            $('#' + form_id + ' #comment').val('');
682
            $('#comment-list-' + answer_uuid).prepend(
683
                $( "#commentTemplate" ).render( response['data']['item'] )
684
            );
685
 
686
            //Listado de la respuesta
687
            $('#answer-total-comment-' + answer_uuid).html( response['data']['total_comments_answer'] );
688
 
689
            //Encabezado pregunta del view
6649 stevensc 690
            $('#my-coach-question-answer-count-comments').html( response['data']['total_comments_question'] + ' LABEL_COMMENTS');
6521 efrain 691
 
692
            //Listado de preguntas
693
            $('#comments-' + question_uuid).html( response['data']['total_comments_question'] );
694
 
695
          } else {
696
            $.fn.showError(textStatus);
697
          }
698
 
699
        }).fail(function( jqXHR, textStatus, errorThrown) {
700
            $.fn.showError(textStatus);
701
        }).always(function() {
702
            NProgress.done();
703
        });
704
        return false;
705
 
706
    });
707
 
708
  $('body').on('click', 'button.btn-save-reaction', function(e) {
709
        e.preventDefault();
710
        var reaction = $(this).data('reaction');
711
        var action = $(this).data('link');
712
        var answer_uuid = $(this).data('answer');
713
        var question_uuid   = $('#row-view').data('question-uuid');
714
 
715
        NProgress.start();
716
        $.ajax({
717
            'dataType'  : 'json',
718
            'accept'    : 'application/json',
719
            'method'    : 'post',
720
            'url'       :  action,
721
            'data'      : {
722
                'reaction' : reaction
723
            }
724
        }).done(function(response) {
725
            if(response['success']) {
726
 
727
                $('#reactions-' + question_uuid).html(response['data']['total_reactions_question']) ;
6649 stevensc 728
                $('#my-coach-question-answer-count-reactions').html(response['data']['total_reactions_question'] + ' LABEL_MY_COACH_REACTIONS') ;
6521 efrain 729
                $('#answer-total-reactions-' + answer_uuid).html(response['data']['total_reactions_answer']) ;
730
 
731
                $('#' + 'current-reaction-' + answer_uuid).data('reaction', response['data']['reaction']);
732
                $('#' + 'current-reaction-' + answer_uuid).html(
733
                    $('#reactionTemplate').render({reaction: reaction})
734
                );
735
            } else {
736
                $.fn.showError(response['data']);
737
            }
738
        }).fail(function( jqXHR, textStatus, errorThrown) {
739
            $.fn.showError(textStatus);
740
        }).always(function() {
741
            NProgress.done();
742
        });
743
 
744
    });
745
 
746
    $('body').on('click', 'button.reaction-btn', function(e) {
747
        e.preventDefault();
748
        var reaction = $(this).data('reaction');
749
 
750
        if(!reaction) return
751
        var action = $(this).data('link');
752
 
753
        var answer_uuid = $(this).data('answer');
754
        var question_uuid   = $('#row-view').data('question-uuid');
755
 
756
        NProgress.start();
757
        $.ajax({
758
            'dataType'  : 'json',
759
            'accept'    : 'application/json',
760
            'method'    : 'post',
761
            'url'       :  action,
762
        }).done(function(response) {
763
            if(response['success']) {
764
                $('#' + 'current-reaction-' + answer_uuid).data('reaction', response['data']['reaction']);
765
                $('#' + 'current-reaction-' + answer_uuid).html(
766
                    $('#reactionTemplate').render({reaction: ''})
767
                );
768
 
769
                $('#reactions-' + question_uuid).html(response['data']['total_reactions_question']) ;
6649 stevensc 770
                $('#my-coach-question-answer-count-reactions').html(response['data']['total_reactions_question'] + ' LABEL_MY_COACH_REACTIONS') ;
6521 efrain 771
                $('#answer-total-reactions-' + answer_uuid).html(response['data']['total_reactions_answer']) ;
772
 
773
            } else {
774
                $.fn.showError(response['data']);
775
            }
776
        }).fail(function( jqXHR, textStatus, errorThrown) {
777
            $.fn.showError(textStatus);
778
        }).always(function() {
779
            NProgress.done();
780
        });
781
    });
782
 
783
    let isMouseHover;
784
 
785
    $('body').on('mouseover', '#reaction-container', function(e) {
786
        isMouseHover = true;
6581 stevensc 787
 
6582 stevensc 788
        setTimeout(() => $(e.target).find('.reactions').addClass('active'), 500);
6521 efrain 789
    });
6581 stevensc 790
 
6521 efrain 791
    $('body').on('mouseout', '#reaction-container', function(e) {
792
        isMouseHover = false;
6581 stevensc 793
 
6583 stevensc 794
        setTimeout(() => !isMouseHover && $(e.target).find('.reactions').removeClass('active'), 500);
6521 efrain 795
    });
796
 
797
    $('#paginator-process-comm').click(function(e) {
798
        e.preventDefault();
799
 
800
        var next_page = $(this).data('next-page');
801
        $.fn.reload(false, next_page);
802
 
803
    });
804
 
6388 efrain 805
    $.fn.reload()
806
 
807
    CKEDITOR.replace('description_question',{
808
        toolbar: [
809
                    { name: 'editing', items: ['Scayt'] },
810
                    { name: 'links', items: ['Link', 'Unlink'] },
811
                    { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
812
                    { name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
813
                    '/',
814
                    { name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
815
                    { name: 'styles', items: ['Styles', 'Format'] },
816
                    { name: 'tools', items: ['Maximize'] }
817
                ],
818
                removePlugins: 'elementspath,Anchor',
819
                heigth: 100
820
    });
6521 efrain 821
 
822
    CKEDITOR.replace('description_answer',{
823
        toolbar: [
824
                    { name: 'editing', items: ['Scayt'] },
825
                    { name: 'links', items: ['Link', 'Unlink'] },
826
                    { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
827
                    { name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
828
                    '/',
829
                    { name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
830
                    { name: 'styles', items: ['Styles', 'Format'] },
831
                    { name: 'tools', items: ['Maximize'] }
832
                ],
833
                removePlugins: 'elementspath,Anchor',
834
                heigth: 100
835
    });
6388 efrain 836
});
5050 efrain 837
JS;
6388 efrain 838
 
839
$this->inlineScript()->captureEnd();
840
$this->headLink()->appendStylesheet('/look-and-field/my-coach.css');
5050 efrain 841
?>
842
 
6645 stevensc 843
<section class="container px-0 d-flex flex-column gap-3">
6388 efrain 844
    <div class="company-title">
6645 stevensc 845
        <h1 class="title">LABEL_MY_COACH</h1>
6552 stevensc 846
        <?php if ($allowQuestionAdd) : ?>
6388 efrain 847
            <h2 class="title cursor-pointer" id="my-coach-add-question">
848
                LABEL_MY_COACH_QUESTION_ADD
849
            </h2>
6552 stevensc 850
        <?php endif; ?>
5050 efrain 851
 
6388 efrain 852
    </div>
5050 efrain 853
 
6388 efrain 854
    <div class="row gap-3" id="row-list">
6552 stevensc 855
        <div class="my-coach-category-list col-12 col-md-3">
6388 efrain 856
            <ul>
857
                <li class="my-coach-category-li my-coach-category-li-selected">
858
                    <a class="my-coach-category-a" href="" data-uuid="">LABEL_MY_COACH_CATEGORY_ALL</a>
859
                </li>
860
                <?php
6521 efrain 861
                foreach ($categories as $uuid => $name) :
6388 efrain 862
                ?>
863
                    <li class="my-coach-category-li">
6521 efrain 864
                        <a class="my-coach-category-a" href="" data-uuid="<?php echo $uuid ?>"><?php echo $name ?></a>
6388 efrain 865
                    </li>
866
 
867
                <?php endforeach; ?>
868
            </ul>
869
        </div>
870
 
871
 
872
        <div class="col px-0">
873
            <div class="search-box">
874
                <form id="form-filter" name="form-filter">
875
                    <input type="text" name="search" id="search" class="form-control"><button class="btn btn-search">LABEL_SEARCH</button>
876
                </form>
877
            </div>
878
 
6644 stevensc 879
            <div id="my-coach-record-list" class="my-coach-record-list mt-3 ">
6388 efrain 880
            </div>
881
 
882
            <div id="my-coach-pagination">
883
            </div>
884
 
885
        </div>
886
    </div>
6552 stevensc 887
 
888
 
6562 stevensc 889
    <div id="row-view" class="my-coach-answers-list" style="display: none">
6563 stevensc 890
        <div class="my-coach-record-card-container col-md-8 mx-auto">
891
            <div class="my-coach-record-card-details">
6562 stevensc 892
                <div class="my-coach-record-card-resume">
6563 stevensc 893
                    <img id="my-coach-question-user-image" src="" />
894
                    <p id="my-coach-question-user-name"></p>
6562 stevensc 895
                </div>
6597 stevensc 896
                <ul id="my-coach-answer-categories" class="my-coach-record-card-categories">
6596 stevensc 897
                </ul>
6563 stevensc 898
            </div>
6552 stevensc 899
 
6567 stevensc 900
            <h2 id="my-coach-question-title"></h2>
6568 stevensc 901
 
6595 stevensc 902
            <div class="d-flex flex-wrap align-items-center justify-content-between mb-3">
6568 stevensc 903
                <span id="my-coach-question-answer-question-date">LABEL_MY_COACH_QUESTION </span>
904
                <span id="my-coach-question-answer-last-date">LABEL_MY_COACH_LAST_ANSWER </span>
905
            </div>
906
 
6567 stevensc 907
            <p id="my-coach-question-description"></p>
6552 stevensc 908
 
6596 stevensc 909
            <div class="my-coach-record-card-info">
6648 stevensc 910
                <span id="my-coach-question-answer-count-answers"></span>
6649 stevensc 911
                <span id="my-coach-question-answer-count-reactions"></span>
912
                <span id="my-coach-question-answer-count-views"></span>
913
                <span id="my-coach-question-answer-count-comments"></span>
6596 stevensc 914
            </div>
6552 stevensc 915
 
6579 stevensc 916
            <div class="my-coach-record-card-actions">
6586 stevensc 917
                <button class="feed__share-option" id="my-coach-question-answer-btn-back"> <i class="fa fa-chevron-left" aria-hidden="true"></i> LABEL_BACK </button>
6584 stevensc 918
                <button class="feed__share-option" id="my-coach-question-answer-btn-answer"> <i class="fa fa-pencil" aria-hidden="true"></i> LABEL_REPLY </button>
919
                <button class="feed__share-option" id="my-coach-question-answer-btn-delete"> <i class="fa fa-trash" aria-hidden="true"></i> LABEL_DELETE </button>
6552 stevensc 920
            </div>
921
        </div>
922
 
6553 stevensc 923
        <div id="my-coach-question-answers-list" class="my-coach-answers-list">
6521 efrain 924
        </div>
6552 stevensc 925
    </div>
926
</section>
6521 efrain 927
 
6552 stevensc 928
 
6388 efrain 929
<!-- The Modal -->
930
<div class="modal" id="modal-question">
6646 stevensc 931
    <div class="modal-dialog  modal-lg">
6388 efrain 932
        <div class="modal-content">
933
 
934
            <!-- Modal Header -->
935
            <div class="modal-header">
6650 stevensc 936
                <h4 class="modal-title h4">LABEL_TOPIC_TO_WORK</h4>
6388 efrain 937
                <button type="button" class="close" data-dismiss="modal">&times;</button>
938
            </div>
939
 
940
            <!-- Modal body -->
941
            <div class="modal-body">
942
                <?php
943
                $form = $this->formQuestion;
944
                $form->setAttributes([
945
                    'method'    => 'post',
946
                    'name'      => 'form-questiom',
947
                    'id'        => 'form-question'
948
                ]);
949
 
950
                $form->prepare();
951
                echo $this->form()->openTag($form);
952
                ?>
953
                <div class="form-group">
954
                    <?php
955
                    $element = $form->get('title');
956
                    $element->setOptions(['label' => 'LABEL_TITLE']);
957
                    $element->setAttributes(['class' => 'form-control']);
958
 
959
                    echo $this->formLabel($element);
960
                    echo $this->formText($element);
961
                    ?>
962
                </div>
6552 stevensc 963
                <div class="form-group">
6388 efrain 964
                    <?php
965
                    $element = $form->get('description');
966
                    $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
967
                    $element->setAttributes(['class' => 'form-control', 'id' => 'description_question']);
6552 stevensc 968
 
6388 efrain 969
                    echo $this->formLabel($element);
970
                    echo $this->formTextArea($element);
971
                    ?>
972
                </div>
973
                <div class="form-group">
974
                    <?php
6552 stevensc 975
 
6388 efrain 976
                    $element = $form->get('category_id');
977
                    $element->setOptions(['label' => 'LABEL_CATEGORY']);
6552 stevensc 978
 
6388 efrain 979
                    echo $this->formLabel($element);
980
                    echo $this->formSelect($element);
981
                    ?>
982
                </div>
983
                <div class="text-right">
984
                    <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
985
                    <button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
986
                </div>
987
                <?php echo $this->form()->closeTag($form); ?>
988
            </div>
989
 
990
 
991
        </div>
992
    </div>
993
</div>
6552 stevensc 994
 
6521 efrain 995
<div class="modal" id="modal-answer">
6647 stevensc 996
    <div class="modal-dialog modal-lg">
6521 efrain 997
        <div class="modal-content">
6388 efrain 998
 
6521 efrain 999
            <!-- Modal Header -->
1000
            <div class="modal-header">
6647 stevensc 1001
                <h4 class="modal-title h4" id="modal-answer-title"></h4>
6521 efrain 1002
                <button type="button" class="close" data-dismiss="modal">&times;</button>
1003
            </div>
6388 efrain 1004
 
6521 efrain 1005
            <!-- Modal body -->
1006
            <div class="modal-body">
1007
                <?php
1008
                $form = $this->formAnswer;
1009
                $form->setAttributes([
1010
                    'method'    => 'post',
1011
                    'name'      => 'form-answer',
1012
                    'id'        => 'form-answer',
1013
                ]);
6388 efrain 1014
 
6521 efrain 1015
                $form->prepare();
1016
                echo $this->form()->openTag($form);
1017
                ?>
6552 stevensc 1018
                <div class="form-group">
6521 efrain 1019
                    <?php
1020
                    $element = $form->get('description');
1021
                    $element->setOptions(['label' => 'LABEL_TEXT']);
1022
                    $element->setAttributes(['class' => 'form-control', 'id' => 'description_answer']);
6552 stevensc 1023
 
6521 efrain 1024
                    echo $this->formLabel($element);
1025
                    echo $this->formTextArea($element);
1026
                    ?>
1027
                </div>
1028
                <div class="text-right">
1029
                    <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1030
                    <button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
1031
                </div>
1032
                <?php echo $this->form()->closeTag($form); ?>
1033
            </div>
6388 efrain 1034
 
6521 efrain 1035
 
1036
        </div>
1037
    </div>
1038
</div>
1039
 
1040
<script id="answerTemplate" type="text/x-jsrender">
6557 stevensc 1041
    <div class="my-coach-record-card-container col-md-8 mx-auto" id="row-{{:uuid}}">
6554 stevensc 1042
            <div class="my-coach-record-card-details">
6556 stevensc 1043
                <div class="my-coach-record-card-resume">
1044
                    <img src="{{:user_image}}" />
1045
                    <p>{{:user_name}}</p>
1046
                </div>
6594 stevensc 1047
                <div class="my-coach-record-card-info">
1048
                    <span>LABEL_PUBLISHED LABEL_AGO_SMALL {{:time_elapsed}}</span>
1049
                    <span id="answer-total-comment-{{:uuid}}">{{:total_comments}} LABEL_COMMENTS</span>
1050
                    <span id="answer-total-reactions-{{:uuid}}">{{:total_reactions}} LABEL_REACTIONS</span>
1051
                </div>
6553 stevensc 1052
            </div>
6670 stevensc 1053
 
6666 stevensc 1054
            <div id="answer-text-{{:uuid}}" >{{:text}}</div>
6670 stevensc 1055
 
6557 stevensc 1056
            <div class="my-coach-record-card-actions">
1057
                {{if link_edit }}
6660 stevensc 1058
                <button data-link="{{>link_edit}}" data-answer="{{:uuid}}" class="btn btn-my-coach-edit-answer feed__share-option"> <i class="fa fa-pencil" aria-hidden="true"></i> LABEL_EDIT </button>
6557 stevensc 1059
                {{/if}}
6547 efrain 1060
 
6557 stevensc 1061
                {{if link_delete }}
6661 stevensc 1062
                <button data-link="{{>link_delete}}" data-question="{{:question_uuid}}" data-answer="{{:uuid}}" class="btn btn-my-coach-delete-answer feed__share-option"> <i class="fa fa-trash" aria-hidden="true"></i> LABEL_DELETE </button>
6557 stevensc 1063
                {{/if}}
1064
 
6582 stevensc 1065
                <div class="position-relative feed__share-option" id="reaction-container">
6660 stevensc 1066
                    <button class="btn reaction-btn p-0" data-answer="{{:uuid}}" data-link="{{:link_reaction_delete}}" data-reaction="{{:reaction}}" id="current-reaction-{{:uuid}}">
6521 efrain 1067
                        {{if reaction === '<?php echo ContentReaction::REACTION_FUN ?>'}}
1068
                        <svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="EmojiEmotionsIcon" style="color: rgb(255, 127, 80);">
1069
                            <path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM8.5 8c.83 0 1.5.67 1.5 1.5S9.33 11 8.5 11 7 10.33 7 9.5 7.67 8 8.5 8zM12 18c-2.28 0-4.22-1.66-5-4h10c-.78 2.34-2.72 4-5 4zm3.5-7c-.83 0-1.5-.67-1.5-1.5S14.67 8 15.5 8s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"></path>
1070
                        </svg>
1071
                        LABEL_REACTION_FUN
1072
                        {{/if}}
1073
 
1074
                        {{if reaction === '<?php echo ContentReaction::REACTION_INTEREST ?>'}}
1075
                        <svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="TungstenIcon" style="color: rgb(245, 187, 92);transform: rotate(180deg);">
1076
                            <path d="M11 19h2v3h-2zm-9-8h3v2H2zm17 0h3v2h-3zm-3.106 6.8014 1.4072-1.4071 2.1213 2.1213-1.4071 1.4071zm-11.3099.7071 2.1214-2.1213 1.4071 1.4072-2.1213 2.1213zM15 8.02V3H9v5.02c-1.21.92-2 2.35-2 3.98 0 2.76 2.24 5 5 5s5-2.24 5-5c0-1.63-.79-3.06-2-3.98zM11 5h2v2.1c-.32-.06-.66-.1-1-.1s-.68.04-1 .1V5z"></path>
1077
                        </svg>
1078
                        LABEL_REACTION_INTEREST
1079
                        {{/if}}
1080
 
1081
 
1082
                        {{if reaction === '<?php echo ContentReaction::REACTION_LOVE ?>'}}
1083
                        <svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="FavoriteTwoToneIcon" style="color: rgb(223, 112, 77);">
1084
                            <path d="M16.5 5c-1.54 0-3.04.99-3.56 2.36h-1.87C10.54 5.99 9.04 5 7.5 5 5.5 5 4 6.5 4 8.5c0 2.89 3.14 5.74 7.9 10.05l.1.1.1-.1C16.86 14.24 20 11.39 20 8.5c0-2-1.5-3.5-3.5-3.5z" opacity=".3"></path>
1085
                            <path d="M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z"></path>
1086
                        </svg>
1087
                        LABEL_REACTION_LOVE
1088
                        {{/if}}
1089
 
1090
 
1091
                        {{if reaction === '<?php echo ContentReaction::REACTION_RECOMMENDED ?>'}}
1092
                        <svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="RecommendIcon" style="color: rgb(116, 5, 249);">
1093
                            <path d="M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm6 9.8a.9.9 0 0 1-.1.5l-2.1 4.9a1.34 1.34 0 0 1-1.3.8H9a2 2 0 0 1-2-2v-5a1.28 1.28 0 0 1 .4-1L12 5l.69.69a1.08 1.08 0 0 1 .3.7v.2L12.41 10H17a1 1 0 0 1 1 1z"></path>
1094
                        </svg>
1095
                        LABEL_REACTION_RECOMMENDED
1096
                        {{/if}}
1097
 
1098
                        {{if reaction === '<?php echo ContentReaction::REACTION_SUPPORT ?>'}}
1099
                        <svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="VolunteerActivismIcon" style="color: rgb(100, 149, 237);">
1100
                            <path d="M1 11h4v11H1zm15-7.75C16.65 2.49 17.66 2 18.7 2 20.55 2 22 3.45 22 5.3c0 2.27-2.91 4.9-6 7.7-3.09-2.81-6-5.44-6-7.7C10 3.45 11.45 2 13.3 2c1.04 0 2.05.49 2.7 1.25zM20 17h-7l-2.09-.73.33-.94L13 16h2.82c.65 0 1.18-.53 1.18-1.18 0-.49-.31-.93-.77-1.11L8.97 11H7v9.02L14 22l8.01-3c-.01-1.1-.9-2-2.01-2z"></path>
1101
                        </svg>
1102
                        LABEL_REACTION_SUPPORT
1103
                        {{/if}}
1104
 
1105
                        {{if reaction === ''}}
1106
                        <svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="RecommendIcon" style="color: gray;">
1107
                            <path d="M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm6 9.8a.9.9 0 0 1-.1.5l-2.1 4.9a1.34 1.34 0 0 1-1.3.8H9a2 2 0 0 1-2-2v-5a1.28 1.28 0 0 1 .4-1L12 5l.69.69a1.08 1.08 0 0 1 .3.7v.2L12.41 10H17a1 1 0 0 1 1 1z"></path>
1108
                        </svg>
1109
                        LABEL_REACTION_UNSET
1110
                        {{/if}}
1111
 
1112
 
6670 stevensc 1113
                    </button>
6582 stevensc 1114
                    <div class="reactions">
6521 efrain 1115
                        <button class="btn-save-reaction" data-link="{{:link_save_reaction}}" data-reaction="<?php echo ContentReaction::REACTION_RECOMMENDED ?>" title="LABEL_REACTION_RECOMMENDED" data-answer="{{:uuid}}">
6670 stevensc 1116
                            <svg xmlns="http://www.w3.org/2000/svg" class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" version="1.1" viewBox="0 0 100 100" xml:space="preserve">
1117
                                <path d="M71.6 57.78l-18.57-2.85a4.425 4.425 0 01-3.7-5.04 4.425 4.425 0 015.04-3.7l18.47 1.13c2.41.37 4.16 4.35 3.79 6.76a4.416 4.416 0 01-5.03 3.7zM69 68.57l-18.22-3.81c-2.37-.49-3.88-2.81-3.39-5.18.49-2.37 2.81-3.88 5.18-3.39l18.65 3.24c2.37.49 3.45 3.38 2.95 5.74-.48 2.37-2.8 3.89-5.17 3.4zM66.41 79.29l-17.86-4.44a4.327 4.327 0 01-3.35-5.11 4.327 4.327 0 015.11-3.35l17.99 3.76c2.34.49 3.83 2.78 3.35 5.11-.49 2.34-2.9 4.52-5.24 4.03zM60.56 89.05l-14.42-4.82c-2.18-.58-3.49-2.82-2.91-5 .58-2.18 2.82-3.49 5-2.91l15.9 4.15c2.18.58 3.49 2.82 2.91 5-.58 2.19-4.3 4.16-6.48 3.58z" class="st0"></path>
1118
                                <path d="M63.3 24.36c-.54-.8-2.31-2.51-3.33-1.04l-.61.89c-2.4 3.48-5.53 6.4-9.18 8.53-2.94 1.72-6.05 3.53-6.6 3.81-.57.29-4.94 3.59-8.96 6.66-4.28 3.27-14.92 5.05-14.92 5.05v28.86h2.98c3.69 0 7.34.83 10.67 2.44l7.94 3.83c.6.29 1.22-.34.93-.94-.01-.02-.02-.03-.02-.05a5.86 5.86 0 01-.56-2.95c.17-2.4 1.7-4.3 3.7-5.11a5.96 5.96 0 01-1.33-6.22c.35-.95.94-1.8 1.71-2.46.5-.42 1.05-.75 1.63-.99-.44-.45-.81-.98-1.1-1.57-.45-.91-.65-1.93-.58-2.94A5.976 5.976 0 0149.38 55a5.947 5.947 0 01-1.33-6.21c.35-.97.95-1.83 1.74-2.49 1.43-1.2 3.07-1.48 4.85-1.42l2.22.15 3.53-4.36c1.26-1.44 2.27-3.07 3.02-4.83l.48-1.14c1.42-3.35 1.2-7.17-.59-10.34zM6.19 80.62h8.67c1.76 0 3.19-1.43 3.19-3.19V48.26c0-1.76-1.43-3.19-3.19-3.19H6.19C4.43 45.07 3 46.5 3 48.26v29.17a3.18 3.18 0 003.19 3.19z" class="st0"></path>
1119
                                <g>
1120
                                    <path d="M83.93 38.06v.59c0 .97-.79 1.75-1.75 1.75h-.04c-.97 0-1.75-.78-1.75-1.75v-.59c.05.01.1.01.16.01h3.23c.04-.01.1-.01.15-.01z" class="st4"></path>
1121
                                    <path d="M82.17 41.19h-.04c-1.4 0-2.54-1.14-2.54-2.54v-.59a.797.797 0 01.9-.79h3.34c.23-.03.45.04.62.19.17.15.27.37.27.6v.59c0 1.4-1.14 2.54-2.55 2.54zm-.97-2.34c.1.43.48.75.94.75h.04c.46 0 .84-.32.94-.75H81.2z" class="st5"></path>
1122
                                    <path d="M88.87 25.23a7.483 7.483 0 00-2.78 5.8v1.26h-7.87v-1.21c0-2.24-.96-4.4-2.71-5.79a10.617 10.617 0 01-4.01-8.33c0-5.99 4.94-10.83 10.97-10.65 5.53.15 10.08 4.62 10.33 10.14.17 3.54-1.41 6.73-3.93 8.78z" class="st6"></path>
1123
                                    <path d="M86.09 33.08h-7.87c-.44 0-.79-.35-.79-.79v-1.21c0-2.03-.9-3.97-2.41-5.17a11.4 11.4 0 01-4.31-8.95c0-6.42 5.32-11.62 11.78-11.44 5.96.17 10.83 4.96 11.1 10.91.17 3.67-1.37 7.1-4.22 9.43-1.58 1.29-2.49 3.18-2.49 5.19v1.26c0 .42-.35.77-.79.77zm-7.08-1.58h6.29v-.47c0-2.49 1.12-4.82 3.07-6.41 2.46-2 3.79-4.96 3.64-8.13-.23-5.12-4.43-9.25-9.56-9.4-5.56-.16-10.16 4.33-10.16 9.86 0 3.02 1.35 5.83 3.71 7.72 1.91 1.52 3.01 3.86 3.01 6.41v.42z" class="st5"></path>
1124
                                    <path d="M78.22 32.29H86.09V35.23H78.22z" class="st4"></path>
1125
                                    <path d="M78.22 36.03a.787.787 0 01-.79-.79v-2.95c0-.44.35-.79.79-.79h7.87c.44 0 .79.35.79.79v2.94c0 .44-.35.79-.79.79l-7.87.01zm.79-2.95v1.37h6.29v-1.36h-6.29z" class="st5"></path>
1126
                                    <g>
1127
                                        <path d="M86.09 35.24v.51c0 1.23-.95 2.23-2.16 2.31-.05.01-.1.01-.16.01h-3.23c-.05 0-.11 0-.16-.01a2.31 2.31 0 01-2.16-2.31v-.51h7.87z" class="st4"></path>
1128
                                        <path d="M83.77 38.85h-3.23c-.08 0-.16 0-.23-.01a3.11 3.11 0 01-2.88-3.1v-.51c0-.44.35-.79.79-.79h7.87a.787.787 0 01.79.79v.51a3.11 3.11 0 01-2.88 3.1c-.07.01-.15.01-.23.01zm-4.73-2.82c.13.67.7 1.19 1.4 1.24.02 0 .04 0 .06.01h3.34c.74-.05 1.32-.57 1.44-1.25h-6.24z" class="st5"></path>
1129
                                    </g>
1130
                                    <g>
1131
                                        <path d="M83.93 33.08c-.44 0-.79-.34-.79-.78v-.03c0-3.96.47-7.93 1.39-11.78l.78-3.28-1.42.54c-.25.09-.53.06-.74-.1l-1.45-1.06a.785.785 0 01-.17-1.1c.26-.35.75-.43 1.1-.17l1.11.81 2.41-.91c.27-.1.58-.05.8.15.22.19.31.49.25.78l-1.13 4.72c-.89 3.74-1.35 7.58-1.35 11.42 0 .42-.36.79-.79.79z" class="st5"></path>
1132
                                    </g>
1133
                                    <g>
1134
                                        <path d="M80.39 33.08c-.44 0-.79-.34-.79-.78v-.03c0-3.84-.45-7.68-1.35-11.42l-1.13-4.72a.8.8 0 01.25-.78c.22-.19.53-.25.8-.15l2.41.91 1.11-.81c.35-.26.85-.18 1.1.17.26.35.18.85-.17 1.1l-1.45 1.06c-.22.16-.5.2-.74.1L79 17.21l.78 3.28c.92 3.85 1.39 7.82 1.39 11.78.01.44-.34.81-.78.81z" class="st5"></path>
1135
                                    </g>
1136
                                    <g>
1137
                                        <path d="M73.69 3.15L74 5.41a3.84 3.84 0 003.29 3.29l2.26.31-2.27.33a3.85 3.85 0 00-3.25 3.25l-.33 2.27-.33-2.27a3.85 3.85 0 00-3.25-3.25l-2.27-.33 2.24-.28a3.842 3.842 0 003.33-3.33l.27-2.25z" class="st7"></path>
1138
                                        <path d="M73.69 15.53c-.33 0-.6-.24-.65-.56l-.33-2.27a3.182 3.182 0 00-2.7-2.7l-2.27-.33a.65.65 0 01-.56-.66c0-.33.25-.61.58-.65L70 8.08a3.184 3.184 0 002.76-2.76l.28-2.24c.04-.33.32-.57.65-.58.33 0 .61.24.65.57l.31 2.26a3.203 3.203 0 002.73 2.73l2.26.31c.32.04.57.32.57.65s-.24.61-.56.65l-2.28.33a3.182 3.182 0 00-2.7 2.7l-.33 2.27c-.05.32-.33.56-.65.56zm-2.3-6.49a4.51 4.51 0 012.3 2.33 4.443 4.443 0 012.33-2.34 4.544 4.544 0 01-2.31-2.28 4.545 4.545 0 01-2.32 2.29z" class="st5"></path>
1139
                                    </g>
1140
                                </g>
6521 efrain 1141
                            </svg>
1142
                        </button>
1143
                        <button class="btn-save-reaction" data-link="{{:link_save_reaction}}" data-reaction="<?php echo ContentReaction::REACTION_SUPPORT ?>" title="LABEL_REACTION_SUPPORT" data-answer="{{:uuid}}">
6671 stevensc 1144
                            <svg xmlns="http://www.w3.org/2000/svg" class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" version="1.1" viewBox="0 0 100 100" xml:space="preserve"><text class="st28 st29" transform="translate(5.947 -6.888)">No es interesante</text><path d="M38.99 53.99c-.15-1.18.1-2.23.7-2.98.19-.24.44-.42.7-.58-.67-.49-1.18-1.25-1.27-2.54 0-.07.01-.15.01-.22-1.15 1.09-2.41 1.89-3.75 2.28-.05.02-.11.02-.16.02a.581.581 0 01-.16-1.14c2.34-.68 3.99-2.54 4.97-3.98 0 0 .01 0 .01-.01a.55.55 0 01.07-.09c.46-.48 1.05-.73 1.68-.73.13 0 .26.02.39.02-.14-.2-.26-.42-.35-.66-.45-1.2-.2-2.51.64-3.36.79-.79 2.03-.93 3.11-1.06.32-.04.62-.07.87-.12 1.63-.31 3.33-.61 5.06-.91 2.56-.44 5.16-.83 7.75-1.21.72-.61 1.21-1.41 1.23-2.07.01-.4-.15-.75-.48-1.06-.76-.69-1.95-.45-3.09-.22-.23.05-.46.09-.68.13-2.11.35-4.03.63-6.02.48-1.56-.12-3.08-.54-4.55-.94-.48-.13-.95-.26-1.42-.38-2.63-.66-5-.44-7.69.7-1.64.69-3.24 1.58-4.79 2.44-1.03.57-2.1 1.16-3.18 1.7-3.27 1.62-6.58 2.5-10.1 3.44l-.25.07c-4.51 1.2-9.12 2.24-13.71 3.08-.04.01-.07 0-.11.01-2.29.45-2.97 5.23-1.65 9.33 1.25 3.88 4.38 7.13 6.68 6.64 2.63-.56 5.06-1.94 7.48-3.04 2.21-1.01 4.5-2.06 6.86-2.85 2.57-.86 5.27-.79 7.22.21.35.18.67.4.98.61l.08.06c2.5 1.72 5.3 3.63 8.37 4.38-.13-.95.1-1.92.6-2.67-1.04-.55-1.87-1.38-2.05-2.78z" class="st30"></path><path d="M96.7 44.83c-.04 0-.06.03-.1.02-2.16-.42-4.42-.78-6.6-1.13-5.02-.81-10.21-1.65-15.03-3.26-.86-.29-1.75-.62-2.62-.94-3.38-1.25-6.87-2.55-10.24-2.07-3.47.49-6.97 1.04-10.42 1.63-1.72.3-3.42.6-5.04.91-.3.06-.62.09-.95.13-.9.1-1.92.22-2.42.73-.52.52-.67 1.35-.38 2.12.25.66.77 1.08 1.38 1.12.05 0 .08.04.12.06 2 .07 4.01.13 6 .28.32.02.56.3.54.63-.02.32-.3.56-.63.54-2.84-.21-5.71-.35-8.55-.39-.31 0-.57.11-.81.36l-.03.03c-.44.49-.7 1.35-.64 2.22.12 1.77 1.21 2.08 2.87 2.35 2.21.37 7.21.87 7.26.87.32.03.56.32.52.64-.03.3-.28.53-.58.53h-.06c-.21-.02-5.09-.51-7.34-.88-.34-.06-.73-.12-1.12-.23-.01 0-.01.01-.01.01-.51.05-.92.27-1.22.64-.4.5-.56 1.25-.45 2.11.22 1.77 2.03 2.29 4.02 2.69l.4.08c1.64.35 6.25.83 6.3.83.32.03.55.32.52.64-.03.3-.28.52-.58.52h-.06c-.19-.02-4.72-.49-6.43-.85l-.39-.08c-.54-.11-1.19-.25-1.84-.47-.58.65-.77 1.86-.37 2.74.57 1.27 1.78 1.5 3.05 1.74.15.03.3.06.44.09 1.64.33 6.74 1.82 10.73 3 .31.09.49.42.39.73-.08.25-.31.42-.56.42-.06 0-.11-.01-.17-.02-3.28-.98-5.92-1.74-7.81-2.26 1.29 1.42 2.74 2.99 4.25 3.64 2.73 1.17 5.44-.43 8.06-1.97.23-.14.47-.27.69-.41l10.37-6.03c.11-.06.22-.13.33-.2.7-.42 1.42-.86 2.35-.81 1.58.08 3.22.77 4.8 1.43.74.31 1.43.6 2.09.82 2.59.86 7.49 2.38 7.49 2.38 1.74.56 6.21-2.87 8.26-7.33 2.08-4.46 1.69-9.95.22-10.35z" class="st0"></path></svg>
6521 efrain 1145
                        </button>
1146
                        <button class="btn-save-reaction" data-link="{{:link_save_reaction}}" data-reaction="<?php echo ContentReaction::REACTION_LOVE ?>" title="LABEL_REACTION_LOVE" data-answer="{{:uuid}}">
1147
                            <svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="FavoriteTwoToneIcon" style="color: rgb(223, 112, 77);">
1148
                                <path d="M16.5 5c-1.54 0-3.04.99-3.56 2.36h-1.87C10.54 5.99 9.04 5 7.5 5 5.5 5 4 6.5 4 8.5c0 2.89 3.14 5.74 7.9 10.05l.1.1.1-.1C16.86 14.24 20 11.39 20 8.5c0-2-1.5-3.5-3.5-3.5z" opacity=".3"></path>
1149
                                <path d="M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z"></path>
1150
                            </svg>
1151
                        </button>
1152
                        <button class="btn-save-reaction" data-link="{{:link_save_reaction}}" data-reaction="<?php echo ContentReaction::REACTION_INTEREST ?>" title="LABEL_REACTION_INTEREST" data-answer="{{:uuid}}">
1153
                            <svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="TungstenIcon" style="color: rgb(245, 187, 92);transform: rotate(180deg);">
1154
                                <path d="M11 19h2v3h-2zm-9-8h3v2H2zm17 0h3v2h-3zm-3.106 6.8014 1.4072-1.4071 2.1213 2.1213-1.4071 1.4071zm-11.3099.7071 2.1214-2.1213 1.4071 1.4072-2.1213 2.1213zM15 8.02V3H9v5.02c-1.21.92-2 2.35-2 3.98 0 2.76 2.24 5 5 5s5-2.24 5-5c0-1.63-.79-3.06-2-3.98zM11 5h2v2.1c-.32-.06-.66-.1-1-.1s-.68.04-1 .1V5z"></path>
1155
                            </svg>
1156
                        </button>
1157
                        <button class="btn-save-reaction" data-link="{{:link_save_reaction}}" data-reaction="<?php echo ContentReaction::REACTION_FUN ?>" title="LABEL_REACTION_FUN" data-answer="{{:uuid}}">
1158
                            <svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="EmojiEmotionsIcon" style="color: rgb(255, 127, 80);">
1159
                                <path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM8.5 8c.83 0 1.5.67 1.5 1.5S9.33 11 8.5 11 7 10.33 7 9.5 7.67 8 8.5 8zM12 18c-2.28 0-4.22-1.66-5-4h10c-.78 2.34-2.72 4-5 4zm3.5-7c-.83 0-1.5-.67-1.5-1.5S14.67 8 15.5 8s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"></path>
1160
                             </svg>
1161
                        </button>
1162
                    </div>
1163
                </div>
1164
            </div>
1165
 
6656 stevensc 1166
            <div class="comments-container mt-2 show">
6521 efrain 1167
                <form class="feedCommentContainer"  id="form-comment-{{:uuid}}" class="form-comment-{{:uuid}}" action="{{:link_add_comment}}" data-answer="{{:uuid}}">
1168
                    <input class="commentInput" type="text" name="comment" id="comment" maxlength="256" placeholder="LABEL_WRITE_A_COMMENT">
1169
                    <button class="btn btn-primary" type="submit">LABEL_SEND</button>
1170
                </form>
1171
                <ul id="comment-list-{{:uuid}}" class="comment-list">
1172
                    {{for comments}}
1173
 
1174
                    <li>
1175
                        <div class="comment-container">
1176
	                       <div class="comment-content comment-{{:unique}}" >
1177
	                           <div class="info">
1178
                                    <a href="{{>user_url}}">
1179
                                        <h3>{{>user_name}}</h3>
1180
                                    </a>
1181
                                    <span>
1182
                                        {{>time_elapsed}}
1183
                                        {{if link_delete}}
1184
                                        <a href="#" class="btn-comment-trash" data-link="{{:link_delete}}" data-comment-unique="{{>unique}}" data-answer-uuid="{{>answer_uuid}}">
1185
                                        <i class="fa fa-trash"></i>
1186
                                        </a>
1187
                                        {{/if}}
1188
                                    </span>
1189
                                </div>
1190
		                        <p>{{>comment}}</p>
1191
		                  </div>
1192
	                   </div>
1193
                    </li>
1194
 
1195
 
1196
                    {{/for}}
1197
                </ul>
1198
 
1199
            </div>
1200
    </div>
1201
</script>
1202
 
1203
<script id="reactionTemplate" type="text/x-jsrender">
6552 stevensc 1204
    {{if reaction === '<?php echo ContentReaction::REACTION_FUN ?>'}}
1205
    <svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="EmojiEmotionsIcon" style="color: rgb(255, 127, 80);">
1206
        <path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM8.5 8c.83 0 1.5.67 1.5 1.5S9.33 11 8.5 11 7 10.33 7 9.5 7.67 8 8.5 8zM12 18c-2.28 0-4.22-1.66-5-4h10c-.78 2.34-2.72 4-5 4zm3.5-7c-.83 0-1.5-.67-1.5-1.5S14.67 8 15.5 8s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"></path>
1207
    </svg>
1208
    LABEL_REACTION_FUN
1209
    {{/if}}
6521 efrain 1210
 
6552 stevensc 1211
    {{if reaction === '<?php echo ContentReaction::REACTION_INTEREST ?>'}}
1212
    <svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="TungstenIcon" style="color: rgb(245, 187, 92);transform: rotate(180deg);">
1213
        <path d="M11 19h2v3h-2zm-9-8h3v2H2zm17 0h3v2h-3zm-3.106 6.8014 1.4072-1.4071 2.1213 2.1213-1.4071 1.4071zm-11.3099.7071 2.1214-2.1213 1.4071 1.4072-2.1213 2.1213zM15 8.02V3H9v5.02c-1.21.92-2 2.35-2 3.98 0 2.76 2.24 5 5 5s5-2.24 5-5c0-1.63-.79-3.06-2-3.98zM11 5h2v2.1c-.32-.06-.66-.1-1-.1s-.68.04-1 .1V5z"></path>
1214
    </svg>
1215
    LABEL_REACTION_INTEREST
1216
    {{/if}}
6521 efrain 1217
 
1218
 
6552 stevensc 1219
    {{if reaction === '<?php echo ContentReaction::REACTION_LOVE ?>'}}
1220
    <svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="FavoriteTwoToneIcon" style="color: rgb(223, 112, 77);">
1221
        <path d="M16.5 5c-1.54 0-3.04.99-3.56 2.36h-1.87C10.54 5.99 9.04 5 7.5 5 5.5 5 4 6.5 4 8.5c0 2.89 3.14 5.74 7.9 10.05l.1.1.1-.1C16.86 14.24 20 11.39 20 8.5c0-2-1.5-3.5-3.5-3.5z" opacity=".3"></path>
1222
        <path d="M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z"></path>
1223
    </svg>
1224
    LABEL_REACTION_LOVE
1225
    {{/if}}
6521 efrain 1226
 
1227
 
6552 stevensc 1228
    {{if reaction === '<?php echo ContentReaction::REACTION_RECOMMENDED ?>'}}
1229
    <svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="RecommendIcon" style="color: rgb(116, 5, 249);">
1230
        <path d="M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm6 9.8a.9.9 0 0 1-.1.5l-2.1 4.9a1.34 1.34 0 0 1-1.3.8H9a2 2 0 0 1-2-2v-5a1.28 1.28 0 0 1 .4-1L12 5l.69.69a1.08 1.08 0 0 1 .3.7v.2L12.41 10H17a1 1 0 0 1 1 1z"></path>
1231
    </svg>
1232
    LABEL_REACTION_RECOMMENDED
1233
    {{/if}}
6521 efrain 1234
 
6552 stevensc 1235
    {{if reaction === '<?php echo ContentReaction::REACTION_SUPPORT ?>'}}
1236
    <svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="VolunteerActivismIcon" style="color: rgb(100, 149, 237);">
1237
        <path d="M1 11h4v11H1zm15-7.75C16.65 2.49 17.66 2 18.7 2 20.55 2 22 3.45 22 5.3c0 2.27-2.91 4.9-6 7.7-3.09-2.81-6-5.44-6-7.7C10 3.45 11.45 2 13.3 2c1.04 0 2.05.49 2.7 1.25zM20 17h-7l-2.09-.73.33-.94L13 16h2.82c.65 0 1.18-.53 1.18-1.18 0-.49-.31-.93-.77-1.11L8.97 11H7v9.02L14 22l8.01-3c-.01-1.1-.9-2-2.01-2z"></path>
1238
    </svg>
1239
    LABEL_REACTION_SUPPORT
1240
    {{/if}}
1241
 
1242
    {{if reaction === ''}}
1243
    <svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="RecommendIcon" style="color: gray;">
1244
        <path d="M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm6 9.8a.9.9 0 0 1-.1.5l-2.1 4.9a1.34 1.34 0 0 1-1.3.8H9a2 2 0 0 1-2-2v-5a1.28 1.28 0 0 1 .4-1L12 5l.69.69a1.08 1.08 0 0 1 .3.7v.2L12.41 10H17a1 1 0 0 1 1 1z"></path>
1245
    </svg>
1246
    LABEL_REACTION_UNSET
1247
    {{/if}}
6521 efrain 1248
</script>
1249
 
1250
<script id="commentTemplate" type="text/x-jsrender">
1251
    <li>
1252
        <div class="comment-container">
1253
	        <div class="comment-content comment-{{:unique}}" >
1254
	            <div class="info">
1255
                    <a href="{{>user_url}}">
1256
                        <h3>{{>user_name}}</h3>
1257
                    </a>
1258
                    <span>
1259
                        {{>time_elapsed}}
1260
                        {{if link_delete}}
1261
                        <a href="#" class="btn-comment-trash" data-link="{{:link_delete}}" data-comment-unique="{{>unique}}"  data-answer-uuid="{{>answer_uuid}}">
1262
                            <i class="fa fa-trash"></i>
1263
                        </a>
1264
                        {{/if}}
1265
                    </span>
1266
                </div>
1267
		      <p>{{>comment}}</p>
1268
		  </div>
1269
	   </div>
1270
    </li>
1271
</script>
1272
 
6388 efrain 1273
<script id="recordTemplate" type="text/x-jsrender">
6644 stevensc 1274
    <div class="my-coach-record-card-container col" id="my-coach-record-card-question-{{:uuid}}">
6594 stevensc 1275
        <div class="my-coach-record-card-details">
1276
            <div class="my-coach-record-card-resume" >
1277
                <img class="my_coach_question_detail_user_image" src="{{:user_image}}" />
1278
                <p class="my_coach_question_detail_user_name">{{:user_name}}</p>
1279
            </div>
6651 stevensc 1280
            <ul class="my-coach-record-card-categories">
1281
                {{for categories}}
1282
                <li>{{:category}}</li>
1283
                {{/for}}
1284
            </ul>
6388 efrain 1285
        </div>
6652 stevensc 1286
        <h2>{{>title}}</h2>
1287
        <span>LABEL_MY_COACH_QUESTION {{:added_on}}</span>
1288
        <p class="my-3">{{>description}}</p>
6651 stevensc 1289
        <div class="my-coach-record-card-info mb-2">
1290
            <span id="answers-{{:uuid}}">{{:answers}} LABEL_MY_COACH_ANSWERS</span>
1291
            <span id="reactions-{{:uuid}}">{{:reactions}} LABEL_MY_COACH_REACTIONS</span>
1292
            <span id="views-{{:uuid}}">{{:views}} LABEL_MY_COACH_VIEWS</span>
1293
            <span id="comments-{{:uuid}}">{{:comments}} LABEL_COMMENTS</span>
1294
        </div>
6654 stevensc 1295
        <div class="my-coach-record-card-actions">
6655 stevensc 1296
            <button data-link="{{:link_view}}" class="btn feed__share-option btn-my-coach-edit-view"> <i class="fa fa-external-link" aria-hidden="true"></i> LABEL_VIEW </button>
6594 stevensc 1297
 
1298
            {{if link_edit }}
6663 stevensc 1299
            <button data-link="{{>link_edit}}" class="btn feed__share-option btn-my-coach-edit"> <i class="fa fa-pencil" aria-hidden="true"></i> LABEL_EDIT </button>
6594 stevensc 1300
            {{/if}}
1301
            {{if link_delete }}
6655 stevensc 1302
            <button data-link="{{>link_delete}}" class="btn feed__share-option btn-my-coach-delete-question"> <i class="fa fa-trash" aria-hidden="true"></i> LABEL_DELETE </button>
6594 stevensc 1303
            {{/if}}
1304
        </div>
1305
    </div>
6552 stevensc 1306
</script>