Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 16852 | Rev 16854 | 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">
16849 stevensc 697
    <h6 class="card-title">LABEL_FEEDS</h6>
698
 
16853 stevensc 699
    <main class="mx-auto">
700
        <form class="feed-container p-2" id="form-main" name="form-main">
701
            <div class="post_topbar">
16849 stevensc 702
 
16853 stevensc 703
                <div class="mar-top clearfix">
704
                    <div class="form-group">
705
                    </div>
706
                    <div class="form-group">
707
                        <textarea id="description-main" name="description-main" placeholder="¿Qué tienes en mente?" class="form-control" readonly="readonly" rows="2"></textarea>
708
                    </div>
16849 stevensc 709
                </div>
16853 stevensc 710
                <div class="mar-top clearfix">
711
                    <button class="btn btn-sm btn-primary pull-right" type="button" id="btn-description-main"><i class="fa fa-pencil fa-fw"></i> LABEL_SHARE </button>
712
                    <a class="btn btn-trans btn-icon add-tooltip" href="#"><i class="fa fa-video"></i></a>
713
                    <a class="btn btn-trans btn-icon add-tooltip" href="#"><i class="fa fa-camera"></i></a>
714
                    <a class="btn btn-trans btn-icon add-tooltip" href="#"><i class="fa fa-file "></i></a>
16849 stevensc 715
                </div>
716
            </div>
16853 stevensc 717
        </form>
718
 
719
        <!--posts-section star-->
720
        <div class="posts-section">
16849 stevensc 721
        </div>
722
 
16853 stevensc 723
        <div class="process-comm" id="paginator-process-comm" style="display: none">
724
            <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>
725
            <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>
726
        </div>
727
        <!--posts-section end-->
728
    </main>
16849 stevensc 729
 
730
    <!--main-ws-sec end-->
16822 efrain 731
</div>
732
 
733
 
16849 stevensc 734
</div>
735
 
736
 
16822 efrain 737
<div class="modal" tabindex="-1" role="dialog" id="modal-feed-image-box">
16849 stevensc 738
    <div class="modal-dialog" role="document">
739
        <?php
740
        $form = $this->formFeed;
16822 efrain 741
        $form->setAttributes([
742
            'method' => 'post',
743
            'action' => $this->url('feeds/add'),
744
            'name' => 'form-feed-image',
745
            'id' => 'form-feed-image',
16849 stevensc 746
            'enctype' => 'multipart/form-data'
16822 efrain 747
        ]);
748
        $form->prepare();
749
        echo $this->form()->openTag($form);
16849 stevensc 750
 
751
 
752
        ?>
753
        <div class="modal-content">
754
            <div class="modal-header">
755
                <h3 class="modal-title">LABEL_SHARE_IMAGE</h3>
756
            </div>
757
            <div class="modal-body">
16822 efrain 758
                <div class="form-group">
16849 stevensc 759
                    <?php
16822 efrain 760
                    $element = $form->get('description');
761
                    $element->setAttributes(['id' => 'description_image', 'rows' => '2', 'placeholder' => '¿Qué tienes en mente?', 'class' => 'form-control']);
762
                    echo $this->formTextArea($element);
763
                    ?>
16849 stevensc 764
                </div>
765
                <div class="form-group">
766
                    <div class="file-loading">
767
                        <?php
16822 efrain 768
                        $element = $form->get('file');
769
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
770
                        echo $this->formFile($element);
771
                        ?>
16849 stevensc 772
                    </div>
773
                </div>
774
            </div>
775
            <div class="modal-footer">
776
                <button type="submit" class="btn btn-sm btn-primary save">LABEL_UPLOAD</button>
777
                <button type="button" class="btn btn-light cancel btn-modal-feed-image-close">LABEL_CANCEL</button>
778
            </div>
779
 
780
        </div>
781
        <a href="#" title="" class="close-box btn-feed-image-close"><i class="la la-close"></i></a>
782
        <?php echo $this->form()->closeTag($form); ?>
783
    </div>
16822 efrain 784
</div>
785
 
786
 
787
<div class="modal" tabindex="-1" role="dialog" id="modal-feed-video-box">
16849 stevensc 788
    <div class="modal-dialog" role="document">
789
        <?php
790
        $form = $this->formFeed;
16822 efrain 791
        $form->setAttributes([
792
            'method' => 'post',
793
            'action' => $this->url('feeds/add'),
794
            'name' => 'form-feed-video',
795
            'id' => 'form-feed-video',
16849 stevensc 796
            'enctype' => 'multipart/form-data'
16822 efrain 797
        ]);
798
        $form->prepare();
799
        echo $this->form()->openTag($form);
800
 
16849 stevensc 801
 
802
        ?>
803
        <div class="modal-content">
804
            <div class="modal-header">
805
                <h3 class="modal-title">LABEL_SHARE_VIDEO</h3>
806
            </div>
807
            <div class="modal-body">
16822 efrain 808
                <div class="form-group">
16849 stevensc 809
                    <?php
16822 efrain 810
                    $element = $form->get('description');
811
                    $element->setAttributes(['id' => 'description_video', 'rows' => '2', 'placeholder' => '¿Qué tienes en mente?', 'class' => 'form-control']);
812
                    echo $this->formTextArea($element);
813
                    ?>
16849 stevensc 814
                </div>
815
                <div class="form-group">
816
                    <div class="file-loading">
817
                        <?php
16822 efrain 818
                        $element = $form->get('file');
819
                        $element->setAttributes(['accept' => 'video/webm,video/mpeg,video/mp4']);
820
                        echo $this->formFile($element);
821
                        ?>
16849 stevensc 822
                    </div>
823
                </div>
824
            </div>
825
            <div class="modal-footer">
826
                <button type="submit" class="btn btn-sm btn-primary save">LABEL_UPLOAD</button>
827
                <button type="button" class="btn btn-light cancel btn-modal-feed-video-close">LABEL_CANCEL</button>
828
            </div>
829
 
830
        </div>
831
        <a href="#" title="" class="close-box btn-feed-video-close"><i class="la la-close"></i></a>
832
        <?php echo $this->form()->closeTag($form); ?>
833
    </div>
16822 efrain 834
</div>
835
 
836
<div class="modal" tabindex="-1" role="dialog" id="modal-feed-document-box">
16849 stevensc 837
    <div class="modal-dialog" role="document">
838
        <?php
839
        $form = $this->formFeed;
16822 efrain 840
        $form->setAttributes([
841
            'method' => 'post',
842
            'action' => $this->url('feeds/add'),
843
            'name' => 'form-feed-document',
844
            'id' => 'form-feed-document',
16849 stevensc 845
            'enctype' => 'multipart/form-data'
16822 efrain 846
        ]);
847
        $form->prepare();
848
        echo $this->form()->openTag($form);
849
 
16849 stevensc 850
 
851
 
852
        ?>
853
        <div class="modal-content">
854
            <div class="modal-header">
855
                <h3 class="modal-title">LABEL_SHARE_DOCUMENT</h3>
856
            </div>
857
            <div class="modal-body">
16822 efrain 858
                <div class="form-group">
16849 stevensc 859
                    <?php
16822 efrain 860
                    $element = $form->get('description');
861
                    $element->setAttributes(['id' => 'description_document', 'rows' => '2', 'placeholder' => '¿Qué tienes en mente?', 'class' => 'form-control']);
862
                    echo $this->formTextArea($element);
863
                    ?>
16849 stevensc 864
                </div>
865
                <div class="form-group">
866
                    <div class="file-loading">
867
                        <?php
16822 efrain 868
                        $element = $form->get('file');
869
                        $element->setAttributes(['accept' => 'application/pdf']);
870
                        echo $this->formFile($element);
871
                        ?>
16849 stevensc 872
                    </div>
873
                </div>
874
            </div>
16822 efrain 875
            <div class="modal-footer">
16849 stevensc 876
                <button type="submit" class="btn btn-sm btn-primary save">LABEL_UPLOAD</button>
877
                <button type="button" class="btn btn-light cancel btn-modal-feed-document-close">LABEL_CANCEL</button>
16822 efrain 878
            </div>
16849 stevensc 879
        </div>
880
        <a href="#" title="" class="close-box btn-feed-document-close"><i class="la la-close"></i></a>
881
        <?php echo $this->form()->closeTag($form); ?>
882
    </div>
16822 efrain 883
</div>
884
 
885
<div class="modal" tabindex="-1" role="dialog" id="modal-feed-box">
16849 stevensc 886
    <div class="modal-dialog" role="document">
887
        <?php
888
        $form = $this->formFeed;
16822 efrain 889
        $form->setAttributes([
890
            'method' => 'post',
891
            'action' => $this->url('feeds/add'),
892
            'name' => 'form-feed',
893
            'id' => 'form-feed',
894
        ]);
895
        $form->prepare();
896
        echo $this->form()->openTag($form);
897
 
16849 stevensc 898
 
899
 
900
        ?>
901
        <div class="modal-content">
902
            <div class="modal-header">
903
                <h3 class="modal-title">LABEL_SHARE</h3>
904
            </div>
905
            <div class="modal-body">
16822 efrain 906
                <div class="form-group">
16849 stevensc 907
                    <?php
16822 efrain 908
                    $element = $form->get('description');
909
                    $element->setAttributes(['id' => 'description_feed', 'rows' => '2', 'placeholder' => '¿Qué tienes en mente?', 'class' => 'form-control']);
910
                    echo $this->formTextArea($element);
911
                    ?>
16849 stevensc 912
                </div>
913
            </div>
16822 efrain 914
            <div class="modal-footer">
16849 stevensc 915
                <button type="submit" class="btn btn-sm btn-primary save">LABEL_SAVE</button>
916
                <button type="button" class="btn btn-light cancel btn-modal-feed-close">LABEL_CANCEL</button>
16822 efrain 917
            </div>
16849 stevensc 918
        </div>
919
        <a href="#" title="" class="close-box btn-modal-feed-close"><i class="la la-close"></i></a>
920
        <?php echo $this->form()->closeTag($form); ?>
921
    </div>
16822 efrain 922
</div>
923
 
924
 
925
 
926
 
927
<script id="commentTemplate" type="text/x-jsrender">
16849 stevensc 928
    <li>
16851 stevensc 929
        <div class="comment-list">
930
                <div class="comment comment-{{:unique}}" >
931
                    <a href="{{>user_url}}"><h3>{{>user_name}}</h3>
932
                    <span><img src="<?php echo $this->basePath('images/clock.png') ?>" alt="">{{>time_elapsed}}
933
                {{if link_delete}}
934
                    <a href="#" class="btn-comment-trash" data-link="{{:link_delete}}" data-comment-unique="{{>unique}}"><i class="fa fa-trash"></i></a>
935
                {{/if}}
936
                    </span>
937
 
938
                    <p>{{>comment}}</p>
939
                </div>
940
        </div>
941
    </li>
16822 efrain 942
</script>
943
 
944
<script id="feedTemplate" type="text/x-jsrender">
16851 stevensc 945
    <div class="feed-container feed-{{>feed_unique}} mb-2">
16849 stevensc 946
        <div class="feed-header">
16851 stevensc 947
            <a href="{{>owner_url}}">
948
                <img src="{{>owner_image}}" alt="" style="width:50px; height: auto">
949
            </a>
950
 
951
            <div class="feed-info">
16822 efrain 952
                <a href="{{>owner_url}}">
16852 stevensc 953
                    <h2>{{>owner_name}}</h2>
16822 efrain 954
                </a>
16853 stevensc 955
 
16851 stevensc 956
                <span>
957
                    <img src="<?php echo $this->basePath('images/clock.png') ?>" alt="">
958
                    {{>owner_time_elapse}}
959
                    {{if feed_delete_url}}
960
                        <a href="#" class="btn-feed-trash" data-link="{{:feed_delete_url}}" data-feed-unique="{{>feed_unique}}"><i class="fa fa-trash"></i></a>
961
                    {{/if}}
962
                </span>
16822 efrain 963
            </div>
964
        </div>
16849 stevensc 965
 
16853 stevensc 966
        <div class="feed-body px-0">
967
            <p class="show-read-more">
968
                {{:owner_description}}
16822 efrain 969
            </p>
970
            {{if owner_file_image}}
971
             <img src="{{>owner_file_image}}" class="Entradas">
972
            {{/if}}
973
            {{if owner_file_video}}
974
             <video src="{{>owner_file_video}}" controls  poster="{{>owner_file_image_preview}}">
975
            {{/if}}
976
            {{if owner_file_document}}
977
                <a href="{{>owner_file_document}}" target="_blank">Descargar</a>
978
            {{/if}}
979
 
980
    {{if shared_name}}
16849 stevensc 981
    <div class="feed-container">
982
        <div class="feed-header">
16853 stevensc 983
            <img src="{{>shared_image}}" alt="" style="width:50px; height: auto">
984
 
985
            <div class="feed-info">
986
                <h3>{{>shared_name}}</h3>
987
                <span>
988
                    <img style="width: 12px; height: auto" src="<?php echo $this->basePath('images/clock.png') ?>" alt="">
989
                    {{>shared_time_elapse}}
990
                </span>
16822 efrain 991
            </div>
992
        </div>
16853 stevensc 993
 
16849 stevensc 994
        <div class="feed-body">
16853 stevensc 995
            <p class="show-read-more">{{:shared_description}}</p>
996
 
16822 efrain 997
            {{if shared_file_image}}
998
             <img src="{{>shared_file_image}}" class="Entradas">
999
            {{/if}}
1000
            {{if shared_file_video}}
1001
             <video src="{{>shared_file_video}}" controls  poster="{{>shared_file_image_preview}}">
1002
            {{/if}}
1003
            {{if shared_file_document}}
1004
                <a href="{{>shared_file_document}}" target="_blank">Descargar</a>
1005
            {{/if}}
1006
        </div>
1007
    </div>
1008
    {{/if}}
1009
 
1010
 
1011
        </div>
16850 stevensc 1012
 
16849 stevensc 1013
        <div class="feed-actions">
16850 stevensc 1014
            <span id="btn-comments-{{>feed_unique}}" class="btn-indicator"><i class="fa fa-comments"></i> {{>owner_comments}}</span>
1015
            <span id="btn-share-{{>feed_unique}}" class="btn-indicator"><i class="fa fa-share"></i> {{>owner_shared}}</span>
16822 efrain 1016
        </div>
16849 stevensc 1017
 
16822 efrain 1018
        {{if comments}}
1019
            <div class="comment-section">
1020
                <div class="comment-sec comment-sec-{{>feed_unique}}" data-feed-unique="{{>feed_unique}}">
1021
                    <ul>
1022
                        {{for comments}}
1023
                            <li>
1024
                                <div class="comment-list">
1025
                                    <div class="comment comment-{{:unique}}" >
1026
                                        <span><img src="<?php echo $this->basePath('images/clock.png') ?>" alt="">{{>time_elapsed}}
1027
                                        <a href="{{>user_url}}"><h3>{{>user_name}}</h3>
1028
                                        {{if link_delete}}
1029
                                            <a href="#" class="btn-comment-trash" data-link="{{:link_delete}}"
1030
                                                data-comment-unique="{{>unique}}"><i class="fa fa-trash"></i></a>
1031
                                        {{/if}}
1032
                                        </span>
1033
 
1034
                                        <p>{{>comment}}</p>
1035
                                    </div>
1036
                                </div>
1037
                            </li>
1038
                        {{/for}}
1039
                    </ul>
1040
                </div>
1041
            </div>
1042
        {{/if}}
1043
        <div class="comment_box">
1044
            <form  class="form-comment-feed" data-feed-unique="{{>feed_unique}}"  action="{{>comment_add_url}}">
1045
                <input type="text" name="comment" id="comment-{{>feed_unique}}" maxlength="256"  placeholder="LABEL_WRITE_A_COMMENT">
1046
                <button type="submit">LABEL_SEND</button>
1047
            </form>
1048
        </div>
1049
    </div>
1050
</script>