Skip to content

CFM-206_Implement_Person_Overview #52

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions app/templates/Standard/index.php
Expand Up @@ -527,6 +527,18 @@ function _column_key($modelsName, $c, $tz=null) {
$args = ['class' => $linkClass];
$isFirstLink = false;
}

// Output the overview Link
print '<div class="overview-link-container">';
$overview_args = [
'class' => 'row-link-overview',
'escape' => false,
];

$overviewLabel = '<em class="material-icons-outlined overview-icon">preview</em>';
print $this->Html->link($overviewLabel, ['action' => $a, $entity->id], $overview_args);
print '</div>';

// Output the link
if(!empty($readOnlyIcon)) {
print '<div class="read-only-link-container">';
Expand Down
2 changes: 2 additions & 0 deletions app/templates/element/javascript.php
Expand Up @@ -170,8 +170,10 @@
$('#bulk-edit-switch').click(function() {
if($("#bulk-edit-switch").is(':checked')) {
$("table.index-table").removeClass('list-mode').addClass('bulk-edit-mode');
$(".overview-link-container").hide();
} else {
$("table.index-table").removeClass('bulk-edit-mode').addClass('list-mode');
$(".overview-link-container").show();
}
});

Expand Down
19 changes: 7 additions & 12 deletions app/templates/element/menuAction.php
Expand Up @@ -64,11 +64,7 @@ class="<?= $actionsMenuClass; ?>">
<?php if(empty($action['onclick'])): ?>
<a class="<?= $actionCssClass; ?>" href="<?= $action['url']; ?>">
<?php if(!empty($action['icon'])): ?>
<?php if(!empty($action['iconClass'])): ?>
<em class="<?= $action['iconClass']; ?>"><?= $action['icon']; ?></em>
<?php else: ?>
<em class="material-icons"><?= $action['icon']; ?></em>
<?php endif; ?>
<em class="<?= $action['iconClass'] ?? "material-icons" ?>"><?= $action['icon']; ?></em>
<?php endif; ?>
<?= $action['label']; ?>
</a>
Expand All @@ -86,14 +82,13 @@ class="<?= $actionsMenuClass; ?>">
. $action['onclick']['dg_bd_txt_repl_str'] // dialog body text replacement strings
. '\']);';
?>
<a class="<?= $actionCssClass; ?>" href="#" onclick="<?= $dg_onclick; ?>"
data-bs-toggle="modal" data-bs-target="#dialog">
<a class="<?= $actionCssClass; ?>"
href="#"
onclick="<?= $dg_onclick; ?>"
data-bs-toggle="modal"
data-bs-target="#dialog">
<?php if(!empty($action['icon'])): ?>
<?php if(!empty($action['icon_class'])): ?>
<em class="<?= $action['icon_class']; ?>"><?= $action['icon']; ?></em>
<?php else: ?>
<em class="material-icons"><?= $action['icon']; ?></em>
<?php endif; ?>
<em class="<?= $action['icon_class'] ?? "material-icons" ?>"><?= $action['icon']; ?></em>
<?php endif; ?>
<?= $action['label']; ?>
</a>
Expand Down
113 changes: 113 additions & 0 deletions app/templates/layout/preview.php
@@ -0,0 +1,113 @@
<?php
/**
* COmanage Registry Generic View Template For Preview Actions
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* UCAID licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v5.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

declare(strict_types=1);

// As a general rule, all Registry pages are post-login and so shouldn't be cached
header("Expires: Thursday, 10-Jan-69 00:00:00 GMT");
header("Cache-Control: no-store, no-cache, max-age=0, must-revalidate");
header("Pragma: no-cache");
?>
<!DOCTYPE html>
<html lang="<?= __('registry.meta.lang'); ?>">
<head>
<title><?= (!empty($vv_title) ? $vv_title : __('registry.meta.registry')); ?></title>
<style>
@keyframes loading {
0% {
opacity: 0.3;
}
30% {
opacity: 1.0;
}
100% {
opacity: 0.3;
}
}

#co-loading {
position: fixed;
top: 50%;
left: 50%;
width: 160px;
height: 100px;
margin: -56px 0 0 -80px;
padding: 0;
line-height: 0;
color: #9FC6E2;
text-align: center;
}

#co-loading span {
animation: 1.2s linear infinite both loading;
background-color: #9FC6E2;
display: inline-block;
height: 28px;
width: 28px;
border-radius: 20px;
margin: 0 2.5px;
}

#co-loading span:nth-child(2) {
animation-delay: 0.2s;
}

#co-loading span:nth-child(3) {
animation-delay: 0.4s;
}
</style>
</head>

<?php
// cleanse the controller and action strings and insert them into the body classes
$controller_stripped = preg_replace('/[^a-zA-Z0-9\-_]/', '', $this->params->controller);
$action_stripped = preg_replace('/[^a-zA-Z0-9\-_]/', '', $this->params->action);
$bodyClasses = $controller_stripped . ' ' . $action_stripped;

$redirect_url = $_SERVER["REQUEST_SCHEME"] . '://' . $_SERVER["SERVER_NAME"] . $this->request->here . '/render:norm';

// Load Dependencies
print $this->Html->script([
'vue/vue-3.2.31.global.prod.js',
'comanage/comanage.js',
]) . PHP_EOL;
print $this->element('javascript');
?>

<!-- Body element will only be loaded if we load lightbox as a standalone layout. -->
<!-- Otherwise we will find ourselves using the existing body. So we choose to hide the body when not -->
<!-- in the context of another layout -->
<body class="<?= $bodyClasses ?>" onload="whereami('<?= $redirect_url; ?>')">

<div id="overViewContent" class="overview-box">
<?=
// insert the page internal content
$this->fetch('content')
?>
</div>
</body>
</html>