Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev Autor Línea Nro. Línea
16849 stevensc 1
<?php
16822 efrain 2
$currentUser = $this->currentUserHelper();
3
$currentUser = $currentUser->getUser();
16761 efrain 4
 
1 www 5
$routeTimeline = $this->url('feeds/timeline');
16761 efrain 6
 
7
 
16841 efrain 8
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
9
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
16822 efrain 10
 
16841 efrain 11
$this->inlineScript()->appendFile($this->basePath('assets/vendors/ckeditor/ckeditor.js'));
16822 efrain 12
 
13
 
16841 efrain 14
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/css/fileinput.min.css'));
15
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fa/theme.css'));
16822 efrain 16
 
16843 efrain 17
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/piexif.js'));
18
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/sortable.js'));
16841 efrain 19
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/fileinput.js'));
20
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/locales/es.js'));
21
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/fa/theme.js'));
22
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fa/theme.js'));
16822 efrain 23
 
24
 
25
 
16929 efrain 26
 
16841 efrain 27
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jsrender/jsrender.min.js'));
16822 efrain 28
 
29
 
16841 efrain 30
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootbox/bootbox.all.min.js'));
16822 efrain 31
 
32
$this->inlineScript()->captureStart();
33
echo <<<JS
34
jQuery( document ).ready(function( $ ) {
35
    var feed_unique_shared = '';
36
 
37
    $.validator.addMethod('requiredContent', function (value, element, param) {
38
        value = $.trim($.fn.stripHtml(value));
39
        return value.length > 0;
40
    }, 'ERROR_REQUIRED');
41
 
42
    $.fn.reload = function(page) {
43
        NProgress.start();
44
        $.ajax({
45
            'dataType'  : 'json',
46
            'accept'    : 'application/json',
47
            'method'    : 'get',
48
            'data'      : {
49
                'page' : page
50
            },
51
            'url'       :  '$routeTimeline'
52
        }).done(function(response) {
53
            if(response['success']) {
54
                $('.posts-section').empty();
55
 
56
                $( ".posts-section" ).append(
57
                    $( "#feedTemplate" ).render( response['data']['current']['items'] )
58
                );
59
 
60
 
61
                if(response['data']['total']['pages'] > 1 ) {
62
 
63
                    $('#paginator-process-comm').show();
64
                    if(response['data']['current']['page']  > 1) {
65
                        $('#btn-page-previous').data('page', response['data']['current']['page'] - 1);
66
                        $('#btn-page-previous').show();
67
                    } else {
68
                         $('#btn-page-previous').hide();
69
                    }
70
                    if(response['data']['current']['page'] <  response['data']['total']['pages']) {
71
                        $('#btn-page-next').data('page', response['data']['current']['page'] + 1);
72
                        $('#btn-page-next').show();
73
                    } else {
74
                         $('#btn-page-next').hide();
75
                    }
76
 
77
                    $('#paginator-process-comm').show();
78
 
79
                } else {
80
                    $('#paginator-process-comm').hide();
81
                }
82
 
83
 
84
            } else {
85
                $.fn.showError(response['data']);
86
            }
87
        }).fail(function( jqXHR, textStatus, errorThrown) {
88
            $.fn.showError(textStatus);
89
        }).always(function() {
90
            NProgress.done();
91
        });
92
 
93
    }
94
 
95
    $('#btn-page-previous').click(function(e) {
96
        e.preventDefault();
97
 
98
        var page = $(this).data('page');
99
        $.fn.reload(page);
100
 
101
    });
102
 
103
    $('#btn-page-next').click(function(e) {
104
        e.preventDefault();
105
 
106
        var page = $(this).data('page');
107
        $.fn.reload(page);
108
 
109
    });
110
 
111
 
112
 
113
 
114
    var validatorFeed = $('#form-feed').validate({
115
        debug: true,
116
        onclick: false,
117
        onkeyup: false,
118
        onfocusout: false,
119
        ignore: [],
120
        rules: {
121
            'shared_with' : {
122
                required: true,
123
            },
124
           'description': {
125
                updateCkeditor:function() {
126
                        CKEDITOR.instances.description_feed.updateElement();
127
                },
128
                required: true
129
            },
130
        },
131
 
132
        submitHandler: function(form)
133
        {
134
            $('input[type="submit"]').prop('disabled', true);
135
            NProgress.start();
136
            $.ajax({
137
                'dataType'  : 'json',
138
                'accept'    : 'application/json',
139
                'method'    : 'post',
140
                'url'       : $('#form-feed').attr('action'),
141
                'data'      : $('#form-feed').serialize(),
142
            }).done(function(response) {
143
                if(response['success']) {
144
                    var s = $( "#feedTemplate" ).render( response['data'] );
145
                    $(s).prependTo(".posts-section");
146
 
147
                   $('#form-feed')[0].reset()
148
                    $("#modal-feed-box").modal('hide');
149
                } else {
150
                    validatorFeed.resetForm();
151
                    if(jQuery.type(response['data']) == 'string') {
152
                        $.fn.showError(response['data']);
153
                    } else  {
154
                        $.each(response['data'], function( fieldname, errors ) {
155
                            $.fn.showFormErrorValidator('#form-feed #' + fieldname, errors);
156
                        });
157
                    }
158
                }
159
            }).fail(function( jqXHR, textStatus, errorThrown) {
160
                $.fn.showError(textStatus);
161
            }).always(function() {
162
                $('input[type="submit"]').prop('disabled', false);
163
                NProgress.done();
164
            });
165
            return false;
166
        },
167
        invalidHandler: function(form, validator) {
168
 
169
        }
170
    });
171
 
172
    $('.btn-modal-feed-close').click(function(e) {
173
        e.preventDefault();
174
        $('#form-feed')[0].reset()
175
        $('#modal-feed-box').modal('hide');
176
        return false;
177
    });
178
 
179
    $('#description-main, #btn-description-main').click(function(e) {
180
        e.preventDefault();
181
 
182
        $('#form-feed')[0].reset()
183
        validatorFeed.resetForm();
184
        $("#modal-feed-box").modal('show');
185
    })
186
 
187
    var validatorFeedImage = $('#form-feed-image').validate({
188
        debug: true,
189
        onclick: false,
190
        onkeyup: false,
191
        onfocusout: false,
192
        ignore: [],
193
        rules: {
194
            'shared_with' : {
195
                required: true,
196
            },
197
           'description': {
198
                updateCkeditor:function() {
199
                        CKEDITOR.instances.description_image.updateElement();
200
                },
201
                required: true
202
            },
203
           'file': {
204
                required: true,
205
                extension: 'jpg|jpeg|png',
206
                accept: 'image/jpg,image/jpeg,image/png'
207
            },
208
        },
209
 
210
        submitHandler: function(form)
211
        {
212
            var formdata = false;
213
            if (window.FormData){
214
                formdata = new FormData(form); //form[0]);
215
            }
216
 
217
            $('input[type="submit"]').prop('disabled', true);
218
            NProgress.start();
219
            $.ajax({
220
                'dataType'  : 'json',
221
                'accept'    : 'application/json',
222
                'method'    : 'post',
223
                'url'       :  $('#form-feed-image').attr('action'),
224
                'data'      : formdata ? formdata : $('#form-feed-image').serialize(),
225
                'processData': false,
226
                'contentType': false,
227
            }).done(function(response) {
228
                if(response['success']) {
229
 
230
 
231
                    var s = $( "#feedTemplate" ).render( response['data'] );
232
                    $(s).prependTo(".posts-section");
233
 
234
                    $("#modal-feed-image-box").modal('hide');
235
                } else {
236
                    validatorFeedImage.resetForm();
237
                    if(jQuery.type(response['data']) == 'string') {
238
                        $.fn.showError(response['data']);
239
                    } else  {
240
                        $.each(response['data'], function( fieldname, errors ) {
16929 efrain 241
 
242
                                $.fn.showFormErrorValidator('#form-feed-image #' + fieldname, errors);
243
 
16822 efrain 244
                        });
245
                    }
246
                }
247
            }).fail(function( jqXHR, textStatus, errorThrown) {
248
                $.fn.showError(textStatus);
249
            }).always(function() {
250
                $('input[type="submit"]').prop('disabled', false);
251
                NProgress.done();
252
            });
253
            return false;
254
        },
255
        invalidHandler: function(form, validator) {
256
 
257
        }
258
    });
259
 
260
    var validatorFeedVideo = $('#form-feed-video').validate({
261
        debug: true,
262
        onclick: false,
263
        onkeyup: false,
264
        onfocusout: false,
265
        ignore: [],
266
        rules: {
267
            'shared_with' : {
268
                required: true,
269
            },
270
           'description': {
271
                updateCkeditor:function() {
272
                        CKEDITOR.instances.description_video.updateElement();
273
                },
274
                required: true
275
            },
276
           'file': {
277
                required: true,
278
                extension: 'webm,mp4,webm',
279
                accept: 'video/webm,video/mpeg,video/mp4'
280
            },
281
        },
282
 
283
        submitHandler: function(form)
284
        {
285
            var formdata = false;
286
            if (window.FormData){
287
                formdata = new FormData(form); //form[0]);
288
            }
289
 
290
            $('input[type="submit"]').prop('disabled', true);
291
            NProgress.start();
292
            $.ajax({
293
                'dataType'  : 'json',
294
                'accept'    : 'application/json',
295
                'method'    : 'post',
296
                'url'       :  $('#form-feed-video').attr('action'),
297
                'data'      : formdata ? formdata : $('#form-feed-video').serialize(),
298
                'processData': false,
299
                'contentType': false,
300
            }).done(function(response) {
301
                if(response['success']) {
302
                    var s = $( "#feedTemplate" ).render( response['data'] );
303
                    $(s).prependTo(".posts-section");
304
 
305
                    $("#modal-feed-video-box").modal('hide');
306
                } else {
307
                    validatorFeedVideo.resetForm();
308
                    if(jQuery.type(response['data']) == 'string') {
309
                        $.fn.showError(response['data']);
310
                    } else  {
311
                        $.each(response['data'], function( fieldname, errors ) {
312
                            $.fn.showFormErrorValidator('#form-feed-video #' + fieldname, errors);
313
                        });
314
                    }
315
                }
316
            }).fail(function( jqXHR, textStatus, errorThrown) {
317
                $.fn.showError(textStatus);
318
            }).always(function() {
319
                $('input[type="submit"]').prop('disabled', false);
320
                NProgress.done();
321
            });
322
            return false;
323
        },
324
        invalidHandler: function(form, validator) {
325
 
326
        }
327
    });
328
 
329
    var validatorFeedDocument = $('#form-feed-document').validate({
330
        debug: true,
331
        onclick: false,
332
        onkeyup: false,
333
        onfocusout: false,
334
        ignore: [],
335
        rules: {
336
            'shared_with' : {
337
                required: true,
338
            },
339
           'description': {
340
                updateCkeditor:function() {
341
                        CKEDITOR.instances.description_document.updateElement();
342
                },
343
                required: true
344
            },
345
           'file': {
346
                required: true,
347
                extension: 'pdf',
348
                accept: 'application/pdf'
349
            },
350
        },
351
 
352
        submitHandler: function(form)
353
        {
354
            var formdata = false;
355
            if (window.FormData){
356
                formdata = new FormData(form); //form[0]);
357
            }
358
 
359
            $('input[type="submit"]').prop('disabled', true);
360
            NProgress.start();
361
            $.ajax({
362
                'dataType'  : 'json',
363
                'accept'    : 'application/json',
364
                'method'    : 'post',
365
                'url'       :  $('#form-feed-document').attr('action'),
366
                'data'      : formdata ? formdata : $('#form-feed-document').serialize(),
367
                'processData': false,
368
                'contentType': false,
369
            }).done(function(response) {
370
                if(response['success']) {
371
                    var s = $( "#feedTemplate" ).render( response['data'] );
372
                    $(s).prependTo(".posts-section");
373
 
374
                    $("#modal-feed-document-box").modal('hide');
375
                } else {
376
                    validatorFeedDocument.resetForm();
377
                    if(jQuery.type(response['data']) == 'string') {
378
                        $.fn.showError(response['data']);
379
                    } else  {
380
                        $.each(response['data'], function( fieldname, errors ) {
381
                            $.fn.showFormErrorValidator('#form-feed-document #' + fieldname, errors);
382
                        });
383
                    }
384
                }
385
            }).fail(function( jqXHR, textStatus, errorThrown) {
386
                $.fn.showError(textStatus);
387
            }).always(function() {
388
                $('input[type="submit"]').prop('disabled', false);
389
                NProgress.done();
390
            });
391
            return false;
392
        },
393
        invalidHandler: function(form, validator) {
394
 
395
        }
396
    });
397
 
398
 
399
 
400
 
401
 
16845 efrain 402
    $('i.fa-file').on('click', function(e){
16822 efrain 403
        e.preventDefault();
404
 
405
        $('#form-feed-document #shared_with').val('');
406
        $('#form-feed-document #file').val('');
407
        CKEDITOR.instances.description_document.setData('');
408
 
409
        $('#form-feed-document')[0].reset()
410
        validatorFeedDocument.resetForm();
411
        $('#modal-feed-document-box').modal('show');
412
    });
413
 
414
    $('#form-feed-document #file').fileinput({
415
        theme: 'fa',
416
        language: 'es',
417
        showUpload: false,
418
        dropZoneEnabled: false,
419
        maxFileCount: 1,
420
        allowedFileExtensions: ['pdf'],
421
    });
422
 
423
 
424
    $('.btn-modal-feed-document-close').on('click', function(e){
425
        e.preventDefault();
426
 
427
        $('#modal-feed-document-box').modal('hide');
428
        return false;
429
    });
430
 
431
 
16845 efrain 432
    $('i.fa-camera').on('click', function(e){
16822 efrain 433
        e.preventDefault();
434
 
435
        $('#form-feed-image #shared_with').val('');
436
        $('#form-feed-image #file').val('');
437
        CKEDITOR.instances.description_image.setData('');
438
 
439
        $('#form-feed-image')[0].reset()
440
        validatorFeedImage.resetForm();
441
        $('#modal-feed-image-box').modal('show');
442
    });
443
 
444
    $('#form-feed-image #file').fileinput({
445
        theme: 'fa',
446
        language: 'es',
447
        showUpload: false,
448
        dropZoneEnabled: false,
449
        maxFileCount: 1,
450
        allowedFileExtensions: ['jpg', 'jpeg', 'png', 'gif'],
451
    });
452
 
453
 
454
    $('.btn-modal-feed-image-close').on('click', function(e){
455
        e.preventDefault();
456
 
457
        $('#modal-feed-image-box').modal('hide');
458
        return false;
459
    });
460
 
461
 
16845 efrain 462
    $('i.fa-video').on('click', function(e){
16822 efrain 463
        e.preventDefault();
464
 
465
        $('#form-feed-video #shared_with').val('');
466
        $('#form-feed-video #file').val('');
467
        CKEDITOR.instances.description_video.setData('');
468
 
469
 
470
        $('#form-feed-video')[0].reset()
471
        validatorFeedVideo.resetForm();
472
        $('#modal-feed-video-box').modal('show');
473
    });
474
 
475
    $('#form-feed-video #file').fileinput({
476
        theme: 'fa',
477
        language: 'es',
478
        showUpload: false,
479
        dropZoneEnabled: false,
480
        maxFileCount: 1,
481
        allowedFileExtensions: ['mp4', 'mpeg','webm'],
482
    });
483
 
484
 
485
    $('.btn-modal-feed-video-close').on('click', function(e){
486
        e.preventDefault();
487
 
488
        $('#modal-feed-video-box').modal('hide');
489
        return false;
490
    });
491
 
492
    $('body').on('click', 'a.btn-indicator', function(e) {
493
 
494
        e.preventDefault();
495
    });
496
 
497
 
498
 
499
 
500
 
501
 
502
    $('body').on('submit', 'form.form-comment-feed', function(e) {
503
        e.preventDefault();
504
 
505
        var form = $(this);
506
        var url = form.attr('action');
507
        var unique  = $(this).data('feed-unique');
508
 
509
        NProgress.start();
510
        $.ajax({
511
            'dataType'  : 'json',
512
            'accept'    : 'application/json',
513
            'method'    : 'post',
514
            'url'       :  url,
515
            'data'      : form.serialize(),
516
        }).done(function(response) {
517
            if(response['success']) {
518
                $('#comment-' + unique).val('');
519
 
520
                var s = $( "#commentTemplate" ).render( response['data'] );
521
                $(s).appendTo('.comment-sec-' + unique + ' ul');
522
 
16845 efrain 523
                $('#btn-comments-' + unique).html('<i class="<i class="fa fa-comments"></i>"></i> ' + response['total_comments']);
16822 efrain 524
 
525
                $('form.form-comment-feed > input[name="comment"]').val('');
526
 
527
            } else {
528
               $.fn.showError(response['data']);
529
            }
530
        }).fail(function( jqXHR, textStatus, errorThrown) {
531
            $.fn.showError(textStatus);
532
        }).always(function() {
533
            NProgress.done();
534
        });
535
        return false;
536
 
537
    });
538
 
539
 
540
    $.fn.deleteFeed = function(url, feed_unique) {
541
 
542
 
543
        NProgress.start();
544
        $.ajax({
545
            'dataType'  : 'json',
546
            'accept'    : 'application/json',
547
            'method'    : 'post',
548
            'url'       :  url,
549
        }).done(function(response) {
550
            if(response['success']) {
551
              $('.post-bar-' +  feed_unique).remove();
552
 
553
                $.fn.showSuccess(response['data']);
554
            } else {
555
                $.fn.showError(response['data']);
556
            }
557
        }).fail(function( jqXHR, textStatus, errorThrown) {
558
            $.fn.showError(textStatus);
559
        }).always(function() {
560
            NProgress.done();
561
        });
562
 
563
    }
564
 
565
    $('body').on('click', 'a.btn-feed-trash', function(e) {
566
        e.preventDefault();
567
        var url = $(this).data('link');
568
        var feed_unique = $(this).data('feed-unique');
569
 
570
          swal.fire({
571
            title: 'LABEL_ARE_YOU_SURE',
572
            message: 'LABEL_QUESTION_DELETE_POST',
573
            icon: 'question',
574
            cancelButtonText: 'LABEL_NO',
575
            showCancelButton: true,
576
            confirmButtonText: 'LABEL_YES'
577
          }).then((result) => {
578
            if (result.isConfirmed) {
579
                $.fn.deleteFeed(url, feed_unique);
580
            }
581
        });
582
    });
583
 
584
 
585
    $.fn.deleteComment = function(url, unique) {
586
 
587
         var feed_unique = $('.comment-' + unique).closest('div.comment-sec').data('feed-unique');
588
 
589
        NProgress.start();
590
        $.ajax({
591
            'dataType'  : 'json',
592
            'accept'    : 'application/json',
593
            'method'    : 'post',
594
            'url'       :  url,
595
        }).done(function(response) {
596
            if(response['success']) {
597
 
598
                $('.comment-' + unique).closest('li').remove();
599
                $('#btn-comments-' + feed_unique).html('<i class="fa fa-comments"></i> ' + response['data']['total_comments']);
600
 
601
                $.fn.showSuccess(response['data']['message']);
602
            } else {
603
                $.fn.showError(response['data']);
604
            }
605
        }).fail(function( jqXHR, textStatus, errorThrown) {
606
            $.fn.showError(textStatus);
607
        }).always(function() {
608
            NProgress.done();
609
        });
610
 
611
 
612
    }
613
 
614
 
615
    $('body').on('click', 'a.btn-comment-trash', function(e) {
616
        e.preventDefault();
617
        var url = $(this).data('link');
618
        var unique = $(this).data('comment-unique');
619
 
620
          swal.fire({
621
            title: 'LABEL_ARE_YOU_SURE',
622
            message: 'LABEL_QUESTION_DELETE_COMMENT',
623
            icon: 'question',
624
            cancelButtonText: 'LABEL_NO',
625
            showCancelButton: true,
626
            confirmButtonText: 'LABEL_YES'
627
          }).then((result) => {
628
            if (result.isConfirmed) {
629
                   $.fn.deleteComment(url, unique);
630
            }
631
        });
632
    });
633
 
634
 
635
    $('div.modal').on("hide.bs.modal", function() {
636
    	$(".wrapper").removeClass("overlay");
637
    })
638
 
639
 
640
    $.fn.reload(1);
641
 
642
    CKEDITOR.replace('description_feed');
643
    CKEDITOR.replace('description_video');
644
    CKEDITOR.replace('description_image');
645
    CKEDITOR.replace('description_document');
646
 
647
 
648
});
649
 
650
 
7154 stevensc 651
JS;
16822 efrain 652
$this->inlineScript()->captureEnd();
7154 stevensc 653
 
1 www 654
?>
655
 
16822 efrain 656
<div class="container">
16933 efrain 657
    <h6 class="mb-2">LABEL_FEEDS</h6>
16849 stevensc 658
 
16885 stevensc 659
        <main class="feed-section">
660
            <form class="theme-container p-2" id="form-main" name="form-main">
661
                <input id="description-main" name="description-main" placeholder="¿Qué tienes en mente?" class="cursor-pointer mb-2" readonly="readonly" rows="2"></input>
16849 stevensc 662
 
16885 stevensc 663
                <div class="d-flex align-items-center justify-content-end gap-2">
664
                    <a class="btn btn-trans btn-icon add-tooltip" href="#"><i class="fa fa-video"></i></a>
665
                    <a class="btn btn-trans btn-icon add-tooltip" href="#"><i class="fa fa-camera"></i></a>
666
                    <a class="btn btn-trans btn-icon add-tooltip" href="#"><i class="fa fa-file "></i></a>
667
                    <button class="btn btn-sm btn-primary" type="button" id="btn-description-main">
668
                        <i class="fa fa-edit"></i> LABEL_SHARE
669
                    </button>
670
                </div>
671
            </form>
672
 
673
            <!--posts-section star-->
674
            <div class="posts-section w-100">
16849 stevensc 675
            </div>
16853 stevensc 676
 
16885 stevensc 677
            <div class="process-comm" id="paginator-process-comm" style="display: none">
678
                <button class="btn btn-sm btn-primary" data-page="0" id="btn-page-previous"> <i class="fa fa-chevron-left" aria-hidden="true"></i> LABEL_PREVIOUS </button>
679
                <button class="btn btn-sm btn-primary" data-page="0" id="btn-page-next"> LABEL_NEXT <i class="fa fa-chevron-right" aria-hidden="true"></i> </button>
680
            </div>
681
            <!--posts-section end-->
682
        </main>
16849 stevensc 683
 
16885 stevensc 684
        <!--main-ws-sec end-->
16822 efrain 685
</div>
686
 
687
 
16849 stevensc 688
</div>
689
 
690
 
16822 efrain 691
<div class="modal" tabindex="-1" role="dialog" id="modal-feed-image-box">
16849 stevensc 692
    <div class="modal-dialog" role="document">
693
        <?php
694
        $form = $this->formFeed;
16822 efrain 695
        $form->setAttributes([
696
            'method' => 'post',
697
            'action' => $this->url('feeds/add'),
698
            'name' => 'form-feed-image',
699
            'id' => 'form-feed-image',
16849 stevensc 700
            'enctype' => 'multipart/form-data'
16822 efrain 701
        ]);
702
        $form->prepare();
703
        echo $this->form()->openTag($form);
16849 stevensc 704
 
705
 
706
        ?>
707
        <div class="modal-content">
708
            <div class="modal-header">
709
                <h3 class="modal-title">LABEL_SHARE_IMAGE</h3>
710
            </div>
711
            <div class="modal-body">
16929 efrain 712
                <div class="row">
713
                   <div class="col-12 mt-3">
16849 stevensc 714
                    <?php
16822 efrain 715
                    $element = $form->get('description');
716
                    $element->setAttributes(['id' => 'description_image', 'rows' => '2', 'placeholder' => '¿Qué tienes en mente?', 'class' => 'form-control']);
717
                    echo $this->formTextArea($element);
718
                    ?>
16929 efrain 719
                    </div>
16849 stevensc 720
                </div>
16929 efrain 721
                <div class="row">
722
                   <div class="col-12 mt-3">
16849 stevensc 723
                        <?php
16822 efrain 724
                        $element = $form->get('file');
725
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
726
                        echo $this->formFile($element);
727
                        ?>
16849 stevensc 728
                    </div>
729
                </div>
730
            </div>
16929 efrain 731
            <div class="modal-footer text-right">
16849 stevensc 732
                <button type="submit" class="btn btn-sm btn-primary save">LABEL_UPLOAD</button>
733
                <button type="button" class="btn btn-light cancel btn-modal-feed-image-close">LABEL_CANCEL</button>
734
            </div>
735
 
736
        </div>
737
        <a href="#" title="" class="close-box btn-feed-image-close"><i class="la la-close"></i></a>
738
        <?php echo $this->form()->closeTag($form); ?>
739
    </div>
16822 efrain 740
</div>
741
 
742
 
743
<div class="modal" tabindex="-1" role="dialog" id="modal-feed-video-box">
16849 stevensc 744
    <div class="modal-dialog" role="document">
745
        <?php
746
        $form = $this->formFeed;
16822 efrain 747
        $form->setAttributes([
748
            'method' => 'post',
749
            'action' => $this->url('feeds/add'),
750
            'name' => 'form-feed-video',
751
            'id' => 'form-feed-video',
16849 stevensc 752
            'enctype' => 'multipart/form-data'
16822 efrain 753
        ]);
754
        $form->prepare();
755
        echo $this->form()->openTag($form);
756
 
16849 stevensc 757
 
758
        ?>
759
        <div class="modal-content">
760
            <div class="modal-header">
761
                <h3 class="modal-title">LABEL_SHARE_VIDEO</h3>
762
            </div>
763
            <div class="modal-body">
16929 efrain 764
              	<div class="row">
765
              		<div class="col-12 mt-3">
16849 stevensc 766
                    <?php
16822 efrain 767
                    $element = $form->get('description');
768
                    $element->setAttributes(['id' => 'description_video', 'rows' => '2', 'placeholder' => '¿Qué tienes en mente?', 'class' => 'form-control']);
769
                    echo $this->formTextArea($element);
770
                    ?>
16929 efrain 771
                    </div>
16849 stevensc 772
                </div>
16929 efrain 773
              	<div class="row">
774
              		<div class="col-12 mt-3">
16849 stevensc 775
                        <?php
16822 efrain 776
                        $element = $form->get('file');
777
                        $element->setAttributes(['accept' => 'video/webm,video/mpeg,video/mp4']);
778
                        echo $this->formFile($element);
779
                        ?>
16849 stevensc 780
                    </div>
781
                </div>
782
            </div>
783
            <div class="modal-footer">
784
                <button type="submit" class="btn btn-sm btn-primary save">LABEL_UPLOAD</button>
785
                <button type="button" class="btn btn-light cancel btn-modal-feed-video-close">LABEL_CANCEL</button>
786
            </div>
787
 
788
        </div>
789
        <a href="#" title="" class="close-box btn-feed-video-close"><i class="la la-close"></i></a>
790
        <?php echo $this->form()->closeTag($form); ?>
791
    </div>
16822 efrain 792
</div>
793
 
794
<div class="modal" tabindex="-1" role="dialog" id="modal-feed-document-box">
16849 stevensc 795
    <div class="modal-dialog" role="document">
796
        <?php
797
        $form = $this->formFeed;
16822 efrain 798
        $form->setAttributes([
799
            'method' => 'post',
800
            'action' => $this->url('feeds/add'),
801
            'name' => 'form-feed-document',
802
            'id' => 'form-feed-document',
16849 stevensc 803
            'enctype' => 'multipart/form-data'
16822 efrain 804
        ]);
805
        $form->prepare();
806
        echo $this->form()->openTag($form);
807
 
16849 stevensc 808
 
809
 
810
        ?>
811
        <div class="modal-content">
812
            <div class="modal-header">
813
                <h3 class="modal-title">LABEL_SHARE_DOCUMENT</h3>
814
            </div>
815
            <div class="modal-body">
16929 efrain 816
                <div class="row">
817
                    <div class="col-12 mt-3">
16849 stevensc 818
                    <?php
16822 efrain 819
                    $element = $form->get('description');
820
                    $element->setAttributes(['id' => 'description_document', 'rows' => '2', 'placeholder' => '¿Qué tienes en mente?', 'class' => 'form-control']);
821
                    echo $this->formTextArea($element);
822
                    ?>
16929 efrain 823
                    </div>
16849 stevensc 824
                </div>
16929 efrain 825
                <div class="row">
826
                    <div class="col-12 mt-3">
16849 stevensc 827
                        <?php
16822 efrain 828
                        $element = $form->get('file');
829
                        $element->setAttributes(['accept' => 'application/pdf']);
830
                        echo $this->formFile($element);
831
                        ?>
16849 stevensc 832
                    </div>
833
                </div>
834
            </div>
16891 efrain 835
            <div class="modal-footer text-right">
16849 stevensc 836
                <button type="submit" class="btn btn-sm btn-primary save">LABEL_UPLOAD</button>
837
                <button type="button" class="btn btn-light cancel btn-modal-feed-document-close">LABEL_CANCEL</button>
16822 efrain 838
            </div>
16849 stevensc 839
        </div>
840
        <a href="#" title="" class="close-box btn-feed-document-close"><i class="la la-close"></i></a>
841
        <?php echo $this->form()->closeTag($form); ?>
842
    </div>
16822 efrain 843
</div>
844
 
845
<div class="modal" tabindex="-1" role="dialog" id="modal-feed-box">
16849 stevensc 846
    <div class="modal-dialog" role="document">
847
        <?php
848
        $form = $this->formFeed;
16822 efrain 849
        $form->setAttributes([
850
            'method' => 'post',
851
            'action' => $this->url('feeds/add'),
852
            'name' => 'form-feed',
853
            'id' => 'form-feed',
854
        ]);
855
        $form->prepare();
856
        echo $this->form()->openTag($form);
857
 
16849 stevensc 858
 
859
 
860
        ?>
861
        <div class="modal-content">
862
            <div class="modal-header">
863
                <h3 class="modal-title">LABEL_SHARE</h3>
864
            </div>
865
            <div class="modal-body">
16929 efrain 866
                <div class="row">
867
                	<div class="col-12 mt-3">
16849 stevensc 868
                    <?php
16822 efrain 869
                    $element = $form->get('description');
870
                    $element->setAttributes(['id' => 'description_feed', 'rows' => '2', 'placeholder' => '¿Qué tienes en mente?', 'class' => 'form-control']);
871
                    echo $this->formTextArea($element);
872
                    ?>
16929 efrain 873
                    </div>
16849 stevensc 874
                </div>
875
            </div>
16891 efrain 876
            <div class="modal-footer text-right">
16849 stevensc 877
                <button type="submit" class="btn btn-sm btn-primary save">LABEL_SAVE</button>
878
                <button type="button" class="btn btn-light cancel btn-modal-feed-close">LABEL_CANCEL</button>
16822 efrain 879
            </div>
16849 stevensc 880
        </div>
881
        <a href="#" title="" class="close-box btn-modal-feed-close"><i class="la la-close"></i></a>
882
        <?php echo $this->form()->closeTag($form); ?>
883
    </div>
16822 efrain 884
</div>
885
 
886
 
887
 
888
 
889
<script id="commentTemplate" type="text/x-jsrender">
16849 stevensc 890
    <li>
16851 stevensc 891
        <div class="comment-list">
892
                <div class="comment comment-{{:unique}}" >
893
                    <a href="{{>user_url}}"><h3>{{>user_name}}</h3>
16929 efrain 894
                    <span><img src="<?php echo $this->basePath('assets/images/clock.png') ?>" alt="">{{>time_elapsed}}
16851 stevensc 895
                {{if link_delete}}
896
                    <a href="#" class="btn-comment-trash" data-link="{{:link_delete}}" data-comment-unique="{{>unique}}"><i class="fa fa-trash"></i></a>
897
                {{/if}}
898
                    </span>
899
 
900
                    <p>{{>comment}}</p>
901
                </div>
902
        </div>
903
    </li>
16822 efrain 904
</script>
905
 
906
<script id="feedTemplate" type="text/x-jsrender">
16867 stevensc 907
    <div class="theme-container feed-{{>feed_unique}} mb-2">
16849 stevensc 908
        <div class="feed-header">
16851 stevensc 909
            <a href="{{>owner_url}}">
16858 stevensc 910
                <img src="{{>owner_image}}" alt="">
16851 stevensc 911
            </a>
912
 
913
            <div class="feed-info">
16822 efrain 914
                <a href="{{>owner_url}}">
16852 stevensc 915
                    <h2>{{>owner_name}}</h2>
16822 efrain 916
                </a>
16853 stevensc 917
 
16851 stevensc 918
                <span>
16929 efrain 919
                    <img src="<?php echo $this->basePath('assets/images/clock.png') ?>" alt="">
16851 stevensc 920
                    {{>owner_time_elapse}}
921
                    {{if feed_delete_url}}
922
                        <a href="#" class="btn-feed-trash" data-link="{{:feed_delete_url}}" data-feed-unique="{{>feed_unique}}"><i class="fa fa-trash"></i></a>
923
                    {{/if}}
924
                </span>
16822 efrain 925
            </div>
926
        </div>
16849 stevensc 927
 
16853 stevensc 928
        <div class="feed-body px-0">
929
            <p class="show-read-more">
930
                {{:owner_description}}
16822 efrain 931
            </p>
932
            {{if owner_file_image}}
933
             <img src="{{>owner_file_image}}" class="Entradas">
934
            {{/if}}
935
            {{if owner_file_video}}
936
             <video src="{{>owner_file_video}}" controls  poster="{{>owner_file_image_preview}}">
937
            {{/if}}
938
            {{if owner_file_document}}
939
                <a href="{{>owner_file_document}}" target="_blank">Descargar</a>
940
            {{/if}}
941
 
16860 stevensc 942
        {{if shared_name}}
16867 stevensc 943
            <div class="theme-container">
16860 stevensc 944
                <div class="feed-header">
945
                    <img src="{{>shared_image}}" alt="" style="width:50px; height: auto">
16853 stevensc 946
 
16860 stevensc 947
                    <div class="feed-info">
948
                        <h3>{{>shared_name}}</h3>
949
                        <span>
16929 efrain 950
                            <img style="width: 12px; height: auto" src="<?php echo $this->basePath('assets/images/clock.png') ?>" alt="">
16860 stevensc 951
                            {{>shared_time_elapse}}
952
                        </span>
953
                    </div>
954
                </div>
16853 stevensc 955
 
16860 stevensc 956
                <div class="feed-body">
957
                    <p class="show-read-more">{{:shared_description}}</p>
16853 stevensc 958
 
16860 stevensc 959
                    {{if shared_file_image}}
960
                    <img src="{{>shared_file_image}}" class="Entradas">
961
                    {{/if}}
962
                    {{if shared_file_video}}
963
                    <video src="{{>shared_file_video}}" controls  poster="{{>shared_file_image_preview}}">
964
                    {{/if}}
965
                    {{if shared_file_document}}
966
                        <a href="{{>shared_file_document}}" target="_blank">Descargar</a>
967
                    {{/if}}
968
                </div>
969
            </div>
970
        {{/if}}
16822 efrain 971
        </div>
972
 
16849 stevensc 973
        <div class="feed-actions">
16850 stevensc 974
            <span id="btn-comments-{{>feed_unique}}" class="btn-indicator"><i class="fa fa-comments"></i> {{>owner_comments}}</span>
975
            <span id="btn-share-{{>feed_unique}}" class="btn-indicator"><i class="fa fa-share"></i> {{>owner_shared}}</span>
16822 efrain 976
        </div>
16849 stevensc 977
 
16860 stevensc 978
        {{if comments}}
979
            <ul class="comment-list comment-sec-{{>feed_unique}}" data-feed-unique="{{>feed_unique}}">
980
                {{for comments}}
981
                    <li>
982
                        <div class="comment-container comment-{{:unique}}">
983
                            <a href="{{>user_url}}">
16862 stevensc 984
                                <h2>{{>user_name}}</h2>
16860 stevensc 985
                            </a>
986
 
987
                            <span>
16929 efrain 988
                                <img src="<?php echo $this->basePath('assets/images/clock.png') ?>" alt="">
16860 stevensc 989
                                {{>time_elapsed}}
16862 stevensc 990
                                {{if link_delete}}
991
                                    <a href="#" class="btn-comment-trash" data-link="{{:link_delete}}" data-comment-unique="{{>unique}}">
992
                                        <i class="fa fa-trash"></i>
993
                                    </a>
994
                                {{/if}}
16860 stevensc 995
                            </span>
996
 
997
                            <p>{{>comment}}</p>
998
                        </div>
999
                    </li>
1000
                {{/for}}
1001
            </ul>
16822 efrain 1002
        {{/if}}
16860 stevensc 1003
 
16861 stevensc 1004
        <form class="comment-form px-2 mb-2" data-feed-unique="{{>feed_unique}}"  action="{{>comment_add_url}}">
16860 stevensc 1005
            <input type="text" name="comment" id="comment-{{>feed_unique}}" maxlength="256"  placeholder="LABEL_WRITE_A_COMMENT">
16885 stevensc 1006
            <button class="btn btn-primary" type="submit">LABEL_SEND</button>
16860 stevensc 1007
        </form>
16822 efrain 1008
    </div>
1009
</script>