Skip to content

Simplify end-user Petition views (CFM-31) #175

Merged
merged 1 commit into from Mar 13, 2024
Merged
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
3 changes: 3 additions & 0 deletions app/resources/locales/en_US/menu.po
Expand Up @@ -192,6 +192,9 @@ msgstr "medium"
msgid "menu.density.large"
msgstr "large"

msgid "menu.home"
msgstr "Home"

msgid "menu.introduction"
msgstr "Please select an action from the menu."

Expand Down
31 changes: 31 additions & 0 deletions app/templates/EnrollmentFlowSteps/fields-nav.inc
@@ -0,0 +1,31 @@
<?php
/**
* COmanage Registry Enrollment Flow Steps Nav
*
* 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)
*/

$subnav = [
'name' => 'enrollment_flow',
'active' => 'steps'
];
33 changes: 33 additions & 0 deletions app/templates/Petitions/resume.php
Expand Up @@ -29,12 +29,45 @@

// Track when we've rendered the current/next step so we know when to stop rendering links
$seenNextStep = false;

$action_args = [];
if(!empty($vv_cur_co) && $vv_user_roles['authuser']) {
if($vv_user_roles['co'] || $vv_user_roles['platform']) {
$action_args['vv_actions'][] = [
'order' => $this->Menu->getMenuOrder('Default'),
'icon' => 'pending_actions',
'url' => [
'plugin' => null,
'controller' => 'Petitions',
'action' => 'index',
'?' => ['co_id' => $vv_cur_co->id]
],
'label' => __d('controller', 'Petitions', 99)
];
}
$action_args['vv_actions'][] = [
'order' => $this->Menu->getMenuOrder('Default'),
'icon' => 'home',
'url' => [
'plugin' => null,
'controller' => 'Dashboards',
'action' => 'dashboard',
'?' => ['co_id' => $vv_cur_co->id]
],
'label' => __d('menu', 'menu.home')
];
}
?>

<div class="page-title-container">
<div class="page-title">
<h1><?= $vv_primary_link_obj->name; // this is the Enrollment Flow name ?></h1>
</div>
<?php if(!empty($action_args)): ?>
<div class="field-actions top-links">
<?= $this->element('menuAction', $action_args) ?>
</div>
<?php endif; ?>
</div>

<!-- Flash Messages and defined Info Banners -->
Expand Down
4 changes: 0 additions & 4 deletions app/templates/Standard/add-edit-view.php
Expand Up @@ -49,10 +49,6 @@
}
}

if(file_exists($templatePath . DS . "fields-links.inc")) {
include($templatePath . DS . "fields-links.inc");
}

// $linkFilter is used for models that belong to a specific parent model (eg: co_id)
$linkFilter = [];

Expand Down
16 changes: 15 additions & 1 deletion app/templates/Standard/dispatch.php
Expand Up @@ -35,12 +35,26 @@
// $vv_template_path will be set for plugins
$templatePath = $vv_template_path ?? ROOT . DS . "templates" . DS . $modelsName;

$action_args['vv_actions'][] = [
'order' => $this->Menu->getMenuOrder('Default'),
'icon' => 'list',
'url' => [
'plugin' => null,
'controller' => 'petitions',
'action' => 'resume',
$vv_petition->id
],
'label' => __d('controller', 'EnrollmentFlowSteps', 99)
];
?>

<div class="page-title-container">
<div class="page-title">
<h1><?= $vv_title; ?></h1>
</div>
<div class="field-actions top-links">
<?= $this->element('menuAction', $action_args) ?>
</div>
</div>

<!-- Flash Messages and defined Info Banners -->
Expand Down Expand Up @@ -87,7 +101,7 @@
include($templatePath . DS . "dispatch.inc");
}

print $this->Field->submit(__d('operation', 'save'));
print $this->Field->submit(__d('operation', 'continue'));

print $this->Form->end();

Expand Down
31 changes: 18 additions & 13 deletions app/templates/layout/default.php
Expand Up @@ -82,6 +82,7 @@
$bodyClasses = $controller_stripped . ' ' .$action_stripped;
$isCoSelectView = $controller_stripped == 'cos' && $action_stripped == 'select';
$isDashboard = $controller_stripped == 'dashboards' && $action_stripped == 'dashboard';
$isActivePetition = $vv_action == 'dispatch' || $vv_action == 'resume';
$generateHomeLink = (!$isCoSelectView && !empty($vv_cur_co));

// add further body classes as needed
Expand Down Expand Up @@ -158,17 +159,19 @@
<?php endif ?>
</header>

<div id="top-bar">
<?php if(!empty($vv_user) && !empty($vv_cur_co) && !$isCoSelectView): ?>
<div id="top-controls">
<div id="co-hamburger"><em class="material-icons">menu</em></div>
<?= $this->element('searchGlobal') ?>
<?php if(!$isActivePetition): ?>
<div id="top-bar">
<?php if(!empty($vv_user) && !empty($vv_cur_co) && !$isCoSelectView): ?>
<div id="top-controls">
<div id="co-hamburger"><em class="material-icons">menu</em></div>
<?= $this->element('searchGlobal') ?>
</div>
<?php endif; // vv_user ?>
<div id="top-menu">
<?= $this->element('menuTop') ?>
</div>
<?php endif; // vv_user ?>
<div id="top-menu">
<?= $this->element('menuTop') ?>
</div>
</div>
<?php endif; ?>

<?php if($isPlatformCO): ?>
<?php
Expand All @@ -186,16 +189,18 @@
<?php endif; ?>

<div id="main-wrapper">
<?php if(!empty($vv_user) && !empty($vv_cur_co) && !$isCoSelectView): ?>
<?php if(!empty($vv_user) && !empty($vv_cur_co) && !$isCoSelectView &&!$isActivePetition): ?>
<?= $this->element('menuMain') ?>
<?php endif ?>

<main id="main">
<div id="content">
<div id="content-inner">
<div id="breadcrumbs">
<?= $this->element('breadcrumbs') ?>
</div>
<?php if(!$isActivePetition): ?>
<div id="breadcrumbs">
<?= $this->element('breadcrumbs') ?>
</div>
<?php endif; ?>

<!-- insert the anchor that is the target of accessible "skip to content" link -->
<a id="content-start"></a>
Expand Down