Autoría | Ultima modificación | Ver Log |
<?php
$this->inlineScript()->appendFile($this->basePath('vendors/bootbox/bootbox.min.js'));
$months = [
'LABEL_MONTH_JANUARY',
'LABEL_MONTH_FEBRUARY',
'LABEL_MONTH_MARCH',
'LABEL_MONTH_APRIL',
'LABEL_MONTH_MAY',
'LABEL_MONTH_JUNE',
'LABEL_MONTH_JULY',
'LABEL_MONTH_AUGUST',
'LABEL_MONTH_SEPTEMBER',
'LABEL_MONTH_OCTOBER',
'LABEL_MONTH_NOVEMBER',
'LABEL_MONTH_DECEMBER',
];
$this->inlineScript()->captureStart();
echo <<<JS
jQuery( document ).ready(function( $ ) {
var months = [
'LABEL_MONTH_JANUARY',
'LABEL_MONTH_FEBRUARY',
'LABEL_MONTH_MARCH',
'LABEL_MONTH_APRIL',
'LABEL_MONTH_MAY',
'LABEL_MONTH_JUNE',
'LABEL_MONTH_JULY',
'LABEL_MONTH_AUGUST',
'LABEL_MONTH_SEPTEMBER',
'LABEL_MONTH_OCTOBER',
'LABEL_MONTH_NOVEMBER',
'LABEL_MONTH_DECEMBER',
];
$('.btn-send-message').click(function(e) {
e.preventDefault();
window.location.href = $(this).data('link');
})
$.fn.actionConnection = function() {
var action = $('.btn-action-connection').data('action');
if(action == 'request') {
url = $('.btn-action-connection').data('link-request');
} else {
url = $('.btn-action-connection').data('link-cancel');
}
NProgress.start();
$.ajax({
'dataType' : 'json',
'accept' : 'application/json',
'method' : 'post',
'url' : url,
}).done(function(response) {
if(response['success']) {
if(action == 'request') {
$('.btn-action-connection').removeClass('btn-request-connection');
$('.btn-action-connection').addClass('btn-cancel-connection');
$('.btn-action-connection').html('<i class="fa fa-user-times"></i> Cancelar ');
$('.btn-action-connection').data('action','cancel');
} else {
$('.btn-action-connection').removeClass('btn-cancel-connection');
$('.btn-action-connection').addClass('btn-request-connection');
$('.btn-action-connection').html('<i class="fa fa-user-plus"></i> Agregar ');
$('.btn-action-connection').data('action','request');
}
$.fn.showSuccess(response['data']);
} else {
$.fn.showError(response['data']);
}
}).fail(function( jqXHR, textStatus, errorThrown) {
$.fn.showError(textStatus);
}).always(function() {
NProgress.done();
});
}
$('body').on('click', 'a.btn-request-connection', function(e) {
e.preventDefault();
$.fn.actionConnection();
});
$('body').on('click', 'a.btn-cancel-connection', function(e) {
e.preventDefault();
bootbox.confirm({
message: 'Esta seguro de cancelar esta conexión',
buttons: {
confirm: {
label: 'Si',
className: 'btn-danger'
},
cancel: {
label: 'No',
className: 'btn-default'
}
},
callback: function (result) {
if(result) {
$.fn.actionConnection();
}
}
});
});
});
JS;
$this->inlineScript()->captureEnd();
?>
<input type="text" name="test" id="test" style="display: none">
<section class="cover-sec">
<img
id="user-cover-img"
src="<?php echo $this->url('storage', ['type' => 'user-cover', 'code' => $user_uuid, 'filename' => $cover]) ?>"
alt="">
</section>
<main>
<div class="main-section">
<div class="container">
<div class="main-section-data">
<div class="row">
<div class="col-lg-3">
<div class="main-left-sidebar">
<div class="user_profile">
<div class="user-pro-img">
<img id="user-profile-img"
src="<?php echo $this->url('storage', ['type' => 'user-profile', 'code' => $user_uuid, 'filename' => $image]) ?>"
alt="">
</div>
<!--user-pro-img end-->
<div class="user_pro_status">
<ul class="flw-status">
<li><span>LABEL_FOLLOWING</span> <b><?php echo $following ?></b>
</li>
<li><span>LABEL_CONNECTIONS</span> <b><?php echo $total_connections?></b>
</li>
</ul>
</div>
<!--user_pro_status end-->
<ul id="social-networks" class="social_links">
<?php
if($facebook) :
$l = strlen($facebook);
if ($l > 32) {
$s = substr($facebook, 0, 32) . '...';
} else {
$s = $facebook;
}
?>
<li>
<a href="<?php echo $facebook ?>" target="_blank" title="">
<i class="fa fa-facebook-square"></i>
<?php echo $s?>
</a>
</li>
<?php endif; ?>
<?php
if($twitter) :
$l = strlen($twitter);
if ($l > 32) {
$s = substr($twitter, 0, 32) . '...';
} else {
$s = $twitter;
}
?>
<li>
<a href="<?php echo $twitter ?>" title="" target="_blank">
<i class="fa fa-twitter"></i>
<?php echo $s?>
</a>
</li>
<?php endif;?>
<?php if($instagram) : ?>
<?php
$l = strlen($instagram);
if ($l > 32) {
$s = substr($instagram, 0, 32) . '...';
} else {
$s = $instagram;
}
?>
<li>
<a href="<?php echo $instagram ?>" target="_blank" title="">
<i class="fa fa-instagram"></i> <?php echo $s?>
</a>
</li>
<?php endif;?>
</ul>
</div>
<!--user_profile end-->
</div>
<!--main-left-sidebar end-->
</div>
<div class="col-lg-6">
<div class="main-ws-sec">
<div class="user-tab-sec rewivew">
<h3><?php echo $full_name ?></h3>
</div>
<!--user-tab-sec end-->
<div class="user-profile-extended-ov">
<h3>
LABEL_OVERVIEW
</h3>
<span id="overview-description"><?php echo $overview ?></span>
</div>
<?php $max = count($user_experiences);
if($max) :
?>
<div class="user-profile-extended-ov st2">
<h3>
LABEL_EXPERIENCE
</h3>
<span id="experience-records">
<?php
for($i = 0; $i < $max; $i++) :
$user_experience = $user_experiences[$i];
?>
<p>
<?php echo $user_experience['company'] ?>
</p>
<p>
<?php echo $user_experience['title'] ?>
</p>
<?php if($user_experience['to_year']) : ?>
<p><?php echo $months[$user_experience['from_month']] . ' ' .$user_experience['from_year'] ?> - <?php echo $months[$user_experience['to_month']] . ' ' . $user_experience['to_year'] ?></p>
<?php else : ?>
<p> <?php echo $months[$user_experience['from_month']] . ' ' . $user_experience['from_year'] ?> - LABEL_CURRENT</p>
<?php endif; ?>
<p><?php echo $user_experience['industry'] ?> / <?php echo $user_experience['size'] ?></p>
<p><?php echo $user_experience['formatted_address'] ?></p>
<?php if($user_experience['description']) : ?>
<p><?php echo $user_experience['description'] ?></p>
<?php endif; ?>
<?php if($i < ($max - 1)) : ?>
<hr/>
<?php endif; ?>
<?php endfor; ?>
</span>
</div>
<?php endif; ?>
<?php
$max = count($user_educations);
if($max) :
?>
<!--user-profile-ov end-->
<div class="user-profile-extended-ov">
<h3>
LABEL_EDUCATION
</h3>
<span id="education-records">
<?php
for($i = 0; $i < $max; $i++) :
$user_education = $user_educations[$i];
?>
<p>
<?php echo $user_education['degree'] ?>
</p>
<p>
<?php echo $user_education['university'] ?>
</p>
<?php if($user_education['to_year']) : ?>
<p><?php echo $user_education['from_year'] ?> - <?php echo $user_education['to_year'] ?></p>
<?php else : ?>
<p><?php echo $user_education['from_year'] ?> - LABEL_CURRENT</p>
<?php endif; ?>
<?php if($user_education['field_of_study']) : ?>
<p><?php echo $user_education['field_of_study'] ?></p>
<?php endif;?>
<p><?php echo $user_education['formatted_address'] ?></p>
<?php if($user_education['description']) : ?>
<p><?php echo $user_education['description'] ?></p>
<?php endif; ?>
<?php if($i < ($max - 1)) : ?>
<hr/>
<?php endif; ?>
<?php endfor; ?>
</span>
</div>
<?php endif; ?>
<?php if($formatted_address ) : ?>
<!--user-profile-ov end-->
<div class="user-profile-ov">
<h3>
LABEL_LOCATION
</h3>
<p id="location-formatted_address"><?php echo $formatted_address ?> </p>
</div>
<?php endif;?>
<!--user-profile-ov end-->
<?php if($user_languages) : ?>
<div class="user-profile-ov">
<h3>
LABEL_LANGUAGES
</h3>
<ul id="list-languages">
<?php foreach($user_languages as $key => $value) : ?>
<li><a href="#" title=""><?php echo $value ?></a></li>
<?php endforeach;?>
</ul>
</div>
<?php endif; ?>
<!--user-profile-ov end-->
<?php if($user_skills) : ?>
<div class="user-profile-ov">
<h3>
LABEL_SKILLS
</h3>
<ul id="list-skills">
<?php foreach($user_skills as $key => $value) : ?>
<li><a href="#" title=""><?php echo $value ?></a></li>
<?php endforeach;?>
</ul>
</div>
<?php endif; ?>
<!--user-profile-ov end-->
</div>
<!--main-ws-sec end-->
</div>
<div class="col-lg-3">
<div class="right-sidebar">
<?php if($show_contact) : ?>
<div class="message-btn" id="div-user-buttons">
<?php if(!$request_connection) :?>
<a href="#" data-action="cancel" data-link-request="<?php echo $link_request ?>" data-link-cancel="<?php echo $link_cancel ?>" class="btn-action-connection btn-cancel-connection"><i class="fa fa-user-times"></i> Cancelar </a>
<?php else : ?>
<a href="#" data-action="request" data-link-request="<?php echo $link_request ?>" data-link-cancel="<?php echo $link_cancel ?>" class="btn-action-connection btn-request-connection"><i class="fa fa-user-plus"></i> Agregar </a>
<?php endif;?>
<a href="#" data-link="<?php echo $link_inmail ?>" title="" class="btn-send-message"><i class="fa fa-envelope "></i> Mensaje </a>
</div>
<?php endif; ?>
<div class="right-sidebar">
<?php echo $this->peopleViewedProfileHelper($user_profile_id) ?>
</div>
<!--right-sidebar end-->
</div>
</div>
</div>
</div>
<!-- main-section-data end-->
</div>
</div>
</main>
<script id="userButtonsTemplate" type="text/x-jsrender">
{{if is_follower}}
<a href="#" class="btn-action-connection btn-remove-follower"><i class="fa fa-user-times"></i> LABEL_UNFOLLOW </a>
{{else}}
<a href="#" class="btn-action-connection btn-add-follower"><i class="fa fa-user-plus"></i> LABEL_FOLLOW </a>
{{/if}}
{{if show_contact}}
<a href="#" data-link="<?php echo $link_inmail ?>" title="" class="btn-send-message"><i class="fa fa-envelope " ></i> Mensaje </a>
{{/if}}
</script>