1 |
www |
1 |
<?php
|
|
|
2 |
$acl = $this->viewModel()->getRoot()->getVariable('acl');
|
|
|
3 |
$currentUser = $this->currentUserHelper();
|
|
|
4 |
$roleName = $currentUser->getUserTypeId();
|
|
|
5 |
|
|
|
6 |
|
|
|
7 |
$routePeopleViewedProfile = $this->url('profile/people-viewed-profile');
|
|
|
8 |
|
|
|
9 |
$this->headLink()->appendStylesheet($this->basePath('vendors/select2/dist/css/select2.min.css'));
|
|
|
10 |
$this->headLink()->appendStylesheet($this->basePath('vendors/select2-bootstrap4/dist/select2-bootstrap4.min.css'));
|
|
|
11 |
$this->inlineScript()->appendFile($this->basePath('vendors/select2/dist/js/select2.min.js'));
|
|
|
12 |
|
|
|
13 |
$this->inlineScript()->appendFile($this->basePath('vendors/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
|
|
|
14 |
$this->inlineScript()->appendFile($this->basePath('vendors/jsrender/jsrender.min.js'));
|
|
|
15 |
|
|
|
16 |
$this->inlineScript()->captureStart();
|
|
|
17 |
echo <<<JS
|
|
|
18 |
|
|
|
19 |
|
|
|
20 |
jQuery( document ).ready(function( $ ) {
|
|
|
21 |
|
|
|
22 |
$('body').on('click', 'a.btn-send-message', function(e) {
|
|
|
23 |
e.preventDefault();
|
|
|
24 |
|
|
|
25 |
window.location.href = $(this).data('link');
|
|
|
26 |
})
|
|
|
27 |
|
|
|
28 |
$.fn.reload = function(search, page) {
|
|
|
29 |
NProgress.start();
|
|
|
30 |
$.ajax({
|
|
|
31 |
'dataType' : 'json',
|
|
|
32 |
'accept' : 'application/json',
|
|
|
33 |
'method' : 'get',
|
|
|
34 |
'url' : '$routePeopleViewedProfile',
|
|
|
35 |
'data' : {
|
|
|
36 |
'search' : search,
|
|
|
37 |
'page' : page
|
|
|
38 |
}
|
|
|
39 |
}).done(function(response) {
|
|
|
40 |
if(response['success']) {
|
|
|
41 |
|
|
|
42 |
console.log(response);
|
|
|
43 |
|
|
|
44 |
if(response['data']['current']['page'] < response['data']['total']['pages'] ) {
|
|
|
45 |
$('#paginator-process-comm').data('next-page', response['data']['current']['page'] + 1);
|
|
|
46 |
$('#paginator-process-comm').show();
|
|
|
47 |
} else {
|
|
|
48 |
$('#paginator-process-comm').hide();
|
|
|
49 |
}
|
|
|
50 |
|
|
|
51 |
|
|
|
52 |
if(response['data']['current']['count'] > 0 ) {
|
|
|
53 |
$( "#profiles-container" ).html(
|
|
|
54 |
$( "#profileTemplate" ).render( response['data']['current']['items'] )
|
|
|
55 |
);
|
|
|
56 |
} else {
|
|
|
57 |
var html = '<div class="company-title"><div class="widget widget-jobs"><div class="sd-title">ERROR_NO_RECORD_MATCHED_YOUR_QUERY</div></div></div>';
|
|
|
58 |
$( "#profiles-container" ).html(html);
|
|
|
59 |
}
|
|
|
60 |
} else {
|
|
|
61 |
$.fn.showError(response['data']);
|
|
|
62 |
}
|
|
|
63 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
64 |
$.fn.showError(textStatus);
|
|
|
65 |
}).always(function() {
|
|
|
66 |
NProgress.done();
|
|
|
67 |
});
|
|
|
68 |
|
|
|
69 |
}
|
|
|
70 |
|
|
|
71 |
$('#paginator-process-comm').click(function(e) {
|
|
|
72 |
e.preventDefault();
|
|
|
73 |
|
|
|
74 |
var search = $('#form-profile-search #search').val().trim()
|
|
|
75 |
|
|
|
76 |
var next_page = $(this).data('next-page');
|
|
|
77 |
$.fn.reload(search, false, next_page);
|
|
|
78 |
|
|
|
79 |
});
|
|
|
80 |
|
|
|
81 |
|
|
|
82 |
|
|
|
83 |
|
|
|
84 |
$('#form-profile-search #search').keyup(function(e) {
|
|
|
85 |
e.preventDefault();
|
|
|
86 |
|
|
|
87 |
$('#profiles-container').empty();
|
|
|
88 |
var search = $('#form-profile-search #search').val()
|
|
|
89 |
if(search.length > 0) {
|
|
|
90 |
var search = $('#form-profile-search #search').val().trim()
|
|
|
91 |
if(search.length > 0) {
|
|
|
92 |
$.fn.reload(search, true, 1);
|
|
|
93 |
} else {
|
|
|
94 |
$('#form-profile-search #search').val('');
|
|
|
95 |
}
|
|
|
96 |
} else {
|
|
|
97 |
$.fn.reload('', true, 1);
|
|
|
98 |
}
|
|
|
99 |
|
|
|
100 |
});
|
|
|
101 |
|
|
|
102 |
$('body').on('click', 'a.btn-profile-view', function(e) {
|
|
|
103 |
e.preventDefault();
|
|
|
104 |
|
|
|
105 |
window.location.href = $(this).data('link');
|
|
|
106 |
});
|
|
|
107 |
|
|
|
108 |
|
|
|
109 |
$.fn.reload('', true, 1);
|
|
|
110 |
});
|
|
|
111 |
JS;
|
|
|
112 |
$this->inlineScript()->captureEnd();
|
|
|
113 |
?>
|
|
|
114 |
|
|
|
115 |
<section class="companies-info">
|
|
|
116 |
<div class="container">
|
|
|
117 |
<div class="company-title">
|
|
|
118 |
<div class="section_admin_title_buttons">
|
|
|
119 |
<div style="float:left;">
|
|
|
120 |
<h1 class="title">LABEL_WHO_HAS_SEEN_MY_PROFILE</h1>
|
|
|
121 |
</div>
|
|
|
122 |
</div>
|
|
|
123 |
</div>
|
|
|
124 |
|
|
|
125 |
<div class="company-title">
|
|
|
126 |
<div class="section_admin_title_buttons">
|
|
|
127 |
<form name="form-profile-search" id="form-profile-search">
|
|
|
128 |
<div class="form-group">
|
|
|
129 |
<input type="text" name="search" id="search" class="form-control" value="" placeholder="Buscar" />
|
|
|
130 |
</div>
|
|
|
131 |
</form>
|
|
|
132 |
</div>
|
|
|
133 |
</div>
|
|
|
134 |
|
|
|
135 |
<div class="companies-list">
|
|
|
136 |
<div class="row" id="profiles-container">
|
|
|
137 |
</div><!--product-feed-tab end-->
|
|
|
138 |
<!--posts-section star-->
|
|
|
139 |
<div class="posts-section" >
|
|
|
140 |
<div class="process-comm" id="paginator-process-comm">
|
|
|
141 |
<div class="spinner">
|
|
|
142 |
<div class="bounce1"></div>
|
|
|
143 |
<div class="bounce2"></div>
|
|
|
144 |
<div class="bounce3"></div>
|
|
|
145 |
</div>
|
|
|
146 |
</div>
|
|
|
147 |
</div>
|
|
|
148 |
<!--posts-section end-->
|
|
|
149 |
</div>
|
|
|
150 |
</div>
|
|
|
151 |
</section>
|
|
|
152 |
|
|
|
153 |
|
|
|
154 |
|
|
|
155 |
|
|
|
156 |
<script id="profileTemplate" type="text/x-jsrender">
|
|
|
157 |
<div class="col-lg-3 col-md-3 col-sm-6">
|
|
|
158 |
<div class="company_profile_info">
|
|
|
159 |
<div class="company-up-info">
|
|
|
160 |
<img src="{{>image}}" alt="">
|
|
|
161 |
<h3>{{>name}}</h3>
|
|
|
162 |
<ul>
|
|
|
163 |
<li><a href="#" data-link="{{>link_view}}" title="" class="follow btn-profile-view">LABEL_VIEW_PROFILE</a></li>
|
|
|
164 |
<li><a href="#" data-link="{{>link_inmail}}" title="" class="message-us btn-send-message">LABEL_MESSAGE</a></li>
|
|
|
165 |
</ul>
|
|
|
166 |
</div>
|
|
|
167 |
</div>
|
|
|
168 |
</div>
|
|
|
169 |
</script>
|