Skip to content

Commit

Permalink
Ensure flash messages are available on all pages. (CO-2229)
Browse files Browse the repository at this point in the history
  • Loading branch information
arlen committed Jan 12, 2023
1 parent a3aa601 commit 2413542
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 41 deletions.
66 changes: 39 additions & 27 deletions app/templates/Matchgrids/configure.php
Original file line number Diff line number Diff line change
@@ -1,38 +1,50 @@
<?php
/**
* COmanage Match Matchgrid Configure Template
*
* 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 http://www.internet2.edu/comanage COmanage Project
* @package match
* @since COmanage Match v1.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

declare(strict_types = 1);
/**
* COmanage Match Matchgrid Configure Template
*
* 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 http://www.internet2.edu/comanage COmanage Project
* @package match
* @since COmanage Match v1.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

declare(strict_types = 1);

// $flashArgs pass banner messages to the flash element container
$flashArgs = [];
if(!empty($indexBanners)) {
$flashArgs['vv_index_banners'] = $indexBanners;
}
if(!empty($banners)) {
$flashArgs['vv_banners'] = $banners;
}
?>

<div class="pageTitleContainer">
<div class="pageTitle">
<h1><?= $vv_title; ?></h1>
</div>
</div>

<?= $this->element('flash', $flashArgs); ?>

<?= __('match.meta.version', [chop(file_get_contents(CONFIG . DS . "VERSION"))]); ?>

<section class="inner-content">
Expand Down
2 changes: 1 addition & 1 deletion app/templates/Matchgrids/delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
declare(strict_types = 1);

?>
<div class="titleNavContainer">
<div class="pageTitleContainer">
<div class="pageTitle">
<h1><?= $vv_title; ?></h1>
</div>
Expand Down
11 changes: 11 additions & 0 deletions app/templates/Matchgrids/manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@
*/

declare(strict_types = 1);

// $flashArgs pass banner messages to the flash element container
$flashArgs = [];
if(!empty($indexBanners)) {
$flashArgs['vv_index_banners'] = $indexBanners;
}
if(!empty($banners)) {
$flashArgs['vv_banners'] = $banners;
}
?>
<div class="pageTitleContainer">
<div class="pageTitle">
Expand Down Expand Up @@ -63,6 +72,8 @@
</p>
<?php endif; ?>

<?= $this->element('flash', $flashArgs); ?>

<!-- Matchgrid Management -->
<div id="matchgrid-management" class="call-to-action-blocks">
<div class="call-to-action">
Expand Down
13 changes: 12 additions & 1 deletion app/templates/Matchgrids/pending.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,25 @@
*/

declare(strict_types = 1);

// $flashArgs pass banner messages to the flash element container
$flashArgs = [];
if(!empty($indexBanners)) {
$flashArgs['vv_index_banners'] = $indexBanners;
}
if(!empty($banners)) {
$flashArgs['vv_banners'] = $banners;
}
?>

<div class="titleNavContainer">
<div class="pageTitleContainer">
<div class="pageTitle">
<h1><?= $vv_title; ?></h1>
</div>
</div>

<?= $this->element('flash', $flashArgs); ?>

<h2><?= __('match.rs.pending', [count($vv_pending)]); ?></h2>

<table>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/Matchgrids/reconcile.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
$canAttr = array_merge($canAttr, $tempArr);
?>

<div class="titleNavContainer">
<div class="pageTitleContainer">
<div class="pageTitle">
<h1><?= __('match.op.reconcile.requests'); ?></h1>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/Matchgrids/select.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

use \App\Lib\Enum\PermissionEnum;
?>
<div class="titleNavContainer">
<div class="pageTitleContainer">
<div class="pageTitle">
<h1><?= $vv_title; ?></h1>
</div>
Expand Down
14 changes: 7 additions & 7 deletions app/templates/Standard/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ function _column_key($modelsName, $c, $tz=null) {
}

// $flashArgs pass banner messages to the flash element container
$flashArgs = [];
if(!empty($indexBanners)) {
$flashArgs['vv_index_banners'] = $indexBanners;
}
if(!empty($banners)) {
$flashArgs['vv_banners'] = $banners;
}
$flashArgs = [];
if(!empty($indexBanners)) {
$flashArgs['vv_index_banners'] = $indexBanners;
}
if(!empty($banners)) {
$flashArgs['vv_banners'] = $banners;
}
?>

<?php if(!empty($subnav)): ?>
Expand Down
4 changes: 2 additions & 2 deletions app/webroot/css/co-base.css
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ ul.form-list li.alert-banner .co-alert {
.co-info-topbox {
clear: both;
padding: 1em;
background-color: var(--cmg-color-yellow-002);
border: 1px solid var(--cmg-color-lightgray-005);
background-color: var(--cmg-color-yellow-001);
border: 1px solid var(--cmg-color-yellow-003);
margin-bottom: 1em;
}
#lastLogin p {
Expand Down
4 changes: 3 additions & 1 deletion app/webroot/css/co-color.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,13 @@
--cmg-color-yellow-003: #f6f5ae; /* alert: warning border color */
--cmg-color-yellow-004: #ffd; /* forms: focused input */

--cmg-color-red-001: #fcc; /* red warning */
--cmg-color-red-001: #ffd4d4; /* alert: danger */
--cmg-color-red-002: #c00; /* forms: error icons */
--cmg-color-red-003: #e33; /* title for deleted/archived */
--cmg-color-red-004: #c33; /* button */
--cmg-color-red-005: #dc3545; /* danger badge */
--cmg-color-red-006: #842029; /* alert: danger text color */
--cmg-color-red-007: #f8cece; /* alert: danger border color */

--cmg-color-white: #fff; /* white */
--cmg-color-black: #000; /* black */
Expand Down

0 comments on commit 2413542

Please sign in to comment.