Proyectos de Subversion LeadersLinked - Backend

Rev

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