Skip to content

Commit

Permalink
Refatoring code
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonmoura committed Apr 26, 2019
1 parent ed3a7cc commit cf776c9
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 29 deletions.
25 changes: 21 additions & 4 deletions client/js/scripts.js
Expand Up @@ -120,7 +120,7 @@ $( document ).ready(
}
}
)

/*
$( this ).on( "click", ".fav-docs div.record a, .themes div.record a", function(e) {
// e.preventDefault();
Expand All @@ -139,7 +139,7 @@ $( document ).ready(
});
}
)

*/
/********** Interest Topics Scripts **********/
/*
$('a.add-collection').popover({
Expand Down Expand Up @@ -452,7 +452,7 @@ $( document ).ready(

combinePopover();

$('#datatable-search').DataTable( {
$('.datatable-search').DataTable( {
paging: false,
ordering: false,
info: false,
Expand All @@ -465,7 +465,24 @@ $( document ).ready(
$(this).hide();
$(this).next().show();
});

/*
$(this).on('click', '.btn-bell', function(e) {
var txt = $('.alerts-confirm-dialog').text();
var r = confirm(txt);
if ( r == false ) {
return false;
} else {
var total = $('.bs-alerts-modal-lg table.datatable-search tr:last td:first-child').text();
if ( total >= 5 ) {
var error = $('.alerts-error').text();
alert(error);
return false;
}
}
});
*/
/********** Layout Scripts **********/
var setContentHeight = function () {
// reset height
Expand Down
50 changes: 25 additions & 25 deletions client/templates/default/menu.tpl.php
Expand Up @@ -41,6 +41,7 @@

<!-- Services Platform Dashboard -->
<div class="row">
<!--
<div class="col-md-8 col-sm-8 col-xs-12 similars">
<div class="x_panel">
<div class="x_title">
Expand All @@ -63,59 +64,58 @@
</div>
</div>
</div>

<div id="step11" class="col-md-4 col-xs-12 themes">
-->
<!-- <div id="step10" class="col-md-8 col-sm-8 col-xs-12 fav-docs"> -->
<div id="step10" class="col-md-4 col-xs-12 fav-docs">
<div class="x_panel">
<div class="x_title">
<h2><?=$trans->getTrans('menu','PROFILE_WIDGET')?><small></small></h2>
<h2><?=$trans->getTrans('menu','SHELF_WIDGET')?><small></small></h2>
<ul class="nav navbar-right panel_toolbox">
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
</ul>
<div class="clearfix"></div>
</div>
<div class="x_content">
<?php if ( $profiles ) : ?>
<?php foreach ( $profiles as $profile ) : ?>
<?php if ( $collections ) : ?>
<?php foreach ( $collections as $col ) : ?>
<?php
if ( is_array($col["docURL"]) ) {
if ( 'portal' != $_SESSION['iahx'] && !empty($site) && array_key_exists($site, $col['docURL']) ) {
$docURL = $col['docURL'][$site];
} else {
$docURL = $col['docURL']['portal'];
}
} else {
$docURL = $col['docURL'];
}
?>
<article class="media event">
<div class="media-body">
<a class="title" href="<?php echo RELATIVE_PATH.'/controller/myprofiledocuments/control/business/profile/'.$profile["profileID"]; ?>" onclick="__gaTracker('send','event','Overview','Interest Topics','<?php echo htmlspecialchars($profile['profileName']); ?>');"><i class="fa fa-folder-open-o" aria-hidden="true"></i><?php echo $profile['profileName']; ?></a>
<p><span><?=$trans->getTrans('menu','KEYWORDS')?>: </span><?php echo $profile['profileText']; ?></p>
<a class="title" href="<?php echo $docURL; ?>" target="_blank" onclick="__gaTracker('send','event','Overview','Favorite Documents','<?php echo htmlspecialchars($col['title']); ?>');"><i class="fa fa-file-o" aria-hidden="true"></i><?php echo $col['title'] ?></a>
</div>
</article>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>

<div class="row">
<div id="step10" class="col-md-8 col-sm-8 col-xs-12 fav-docs">
<div id="step11" class="col-md-4 col-xs-12 themes">
<div class="x_panel">
<div class="x_title">
<h2><?=$trans->getTrans('menu','SHELF_WIDGET')?><small></small></h2>
<h2><?=$trans->getTrans('menu','PROFILE_WIDGET')?><small></small></h2>
<ul class="nav navbar-right panel_toolbox">
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
</ul>
<div class="clearfix"></div>
</div>
<div class="x_content">
<?php if ( $collections ) : ?>
<?php foreach ( $collections as $col ) : ?>
<?php
if ( is_array($col["docURL"]) ) {
if ( 'portal' != $_SESSION['iahx'] && !empty($site) && array_key_exists($site, $col['docURL']) ) {
$docURL = $col['docURL'][$site];
} else {
$docURL = $col['docURL']['portal'];
}
} else {
$docURL = $col['docURL'];
}
?>
<?php if ( $profiles ) : ?>
<?php foreach ( $profiles as $profile ) : ?>
<article class="media event">
<div class="media-body">
<a class="title" href="<?php echo $docURL; ?>" target="_blank" onclick="__gaTracker('send','event','Overview','Favorite Documents','<?php echo htmlspecialchars($col['title']); ?>');"><i class="fa fa-file-o" aria-hidden="true"></i><?php echo $col['title'] ?></a>
<a class="title" href="<?php echo RELATIVE_PATH.'/controller/myprofiledocuments/control/business/profile/'.$profile["profileID"]; ?>" onclick="__gaTracker('send','event','Overview','Interest Topics','<?php echo htmlspecialchars($profile['profileName']); ?>');"><i class="fa fa-folder-open-o" aria-hidden="true"></i><?php echo $profile['profileName']; ?></a>
<p><span><?=$trans->getTrans('menu','KEYWORDS')?>: </span><?php echo $profile['profileText']; ?></p>
</div>
</article>
<?php endforeach; ?>
Expand Down
2 changes: 2 additions & 0 deletions client/templates/default/orcidworks.tpl.php
Expand Up @@ -42,7 +42,9 @@
$google_scholar = GOOGLE_SCHOLAR_WS . urlencode($register["title"]);
$gs_links = SimilarDocs::getGoogleScholarLinks($_SESSION['userTK'], $put_code, $google_scholar);
?>
<?php if ( !$gs_links[0]['cited_url'] && !$gs_links[0]['related_url'] ) : ?>
<a class="label label-success google-scholar" href="<?php echo $google_scholar; ?>" target="_blank" onclick="__gaTracker('send','event','ORCID','Google Scholar','<?php echo htmlspecialchars($register["title"]); ?>');"><?=$trans->getTrans($_REQUEST["action"],'GOOGLE_SCHOLAR')?></a>
<?php endif; ?>
<?php if ( $gs_links[0]['cited_url'] ) : ?>
<a class="label label-primary gs-cited" href="<?php echo GOOGLE_SCHOLAR . $gs_links[0]['cited_url']; ?>" target="_blank" onclick="__gaTracker('send','event','ORCID','Google Scholar - Cited','<?php echo htmlspecialchars($register["title"]); ?>');"><?php echo $trans->getTrans($_REQUEST["action"],'GOOGLE_SCHOLAR_CITED'); ?></a>
<?php endif; ?>
Expand Down

0 comments on commit cf776c9

Please sign in to comment.