From 3785c31167b4341a76e8d1df91646011c60c7c0e Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Thu, 31 Oct 2024 12:43:51 -0400 Subject: [PATCH] First pass at cleaning up Petition view (CFM-31) --- app/resources/locales/en_US/information.po | 6 ++ app/resources/locales/en_US/operation.po | 3 + app/src/Lib/Util/StringUtilities.php | 5 +- app/templates/Petitions/fields.inc | 87 ++++++++++++++-------- app/webroot/css/co-base.css | 24 ++++++ 5 files changed, 95 insertions(+), 30 deletions(-) diff --git a/app/resources/locales/en_US/information.po b/app/resources/locales/en_US/information.po index b13dfec6d..8a163fe96 100644 --- a/app/resources/locales/en_US/information.po +++ b/app/resources/locales/en_US/information.po @@ -54,6 +54,9 @@ msgstr "not set" msgid "pagination.format" msgstr "Page {{page}} of {{pages}}, Viewing {{start}}-{{end}} of {{count}}" +msgid "enrollment.steps" +msgstr "Enrollment Steps" + msgid "ExternalIdentities.source" msgstr "This External Identity was created from {0}." @@ -105,6 +108,9 @@ msgstr "Additional History Records may be available via Petitions and Provisioni msgid "pagination.format" msgstr "Page {{page}} of {{pages}}, Viewing {{start}}-{{end}} of {{count}}" +msgid "petition.information" +msgstr "Petition Information" + msgid "Petitions.pending" msgstr "This Petition has now been assigned to someone else. There is no further action for you at this time." diff --git a/app/resources/locales/en_US/operation.po b/app/resources/locales/en_US/operation.po index 7475df4ca..f28b3fd72 100644 --- a/app/resources/locales/en_US/operation.po +++ b/app/resources/locales/en_US/operation.po @@ -288,6 +288,9 @@ msgstr "View {0}" msgid "view.PersonRoles.a" msgstr "View Role {0}" +msgid "view.Petitions.a" +msgstr "View Petition {0}" + msgid "view.ExternalIdentityRoles.a" msgstr "View Role {0}" diff --git a/app/src/Lib/Util/StringUtilities.php b/app/src/Lib/Util/StringUtilities.php index d1d5e644c..d25ba6336 100644 --- a/app/src/Lib/Util/StringUtilities.php +++ b/app/src/Lib/Util/StringUtilities.php @@ -201,7 +201,10 @@ public static function entityAndActionToTitle($entity, $field = $linkTable->getDisplayField(); if(!empty($entity->$field)) { - $title = __d($domain, $msgId, $entity->$field); + $title = __d($domain, $msgIdOverride, $entity->$field); + if($msgIdOverride === $title) { + $title = __d($domain, $msgId, $entity->$field); + } } else { $title = __d($domain, $msgId, __d('controller', $modelsName, [1])); } diff --git a/app/templates/Petitions/fields.inc b/app/templates/Petitions/fields.inc index ca8e86b35..b596f77b0 100644 --- a/app/templates/Petitions/fields.inc +++ b/app/templates/Petitions/fields.inc @@ -28,6 +28,7 @@ declare(strict_types = 1); use \Cake\Utility\Hash; +use Cake\Utility\Inflector; // Petitions are read-only, though they can link to other actions if ($vv_action !== 'view') { @@ -35,19 +36,29 @@ if ($vv_action !== 'view') { } // Start with the petition metadata -print $this->element('form/listItem', [ - 'arguments' => [ - 'fieldName' => 'status', - ] -]); +$statusTitle = __d('enumeration','PetitionStatusEnum.' . $vv_obj->status); +$statusCssClass = 'petition-status-title petition-status-title-' . Inflector::dasherize($statusTitle); +?> + +
  • +

    + +

    +
  • +
  • +

    + +

    +
  • +element('form/listItem', [ 'arguments' => [ 'fieldName' => 'enrollee_email', ] -]); - +]); + // Enrollee if (!empty($vv_obj?->enrollee_person?->id)) { $enrolleeStatus = $vv_obj->enrollee_person->primary_name->full_name ?? __d('field', 'Petitions.enrollee.new'); @@ -86,30 +97,48 @@ if (!empty($vv_obj?->petitioner_person?->id)) { ]); } +// XXX Keep status available (even though it's presented above) +print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'status', + ] +]); ?> +
  • +

    + +

    +
  • + + -
      - enrollment_flow->enrollment_flow_steps as $step): ?> - petition_step_results, "{n}[enrollment_flow_step_id=$step->id]"); +enrollment_flow->enrollment_flow_steps as $step): ?> + petition_step_results, "{n}[enrollment_flow_step_id=$step->id]"); - if(!empty($result)) { - $resultLink = [ - 'controller' => 'petitions', - 'action' => 'result', - $vv_obj->id, - '?' => [ - 'enrollment_flow_step_id' => $step->id - ] - ]; - } - ?> + if(!empty($result)) { + $resultLink = [ + 'controller' => 'petitions', + 'action' => 'result', + $vv_obj->id, + '?' => [ + 'enrollment_flow_step_id' => $step->id + ] + ]; + } + ?> -
    1. description ?>
    2. - - - -
    +
  • +
    +
    +
    + description ?> +
    +
    +
    + Html->link($result[0]->comment, $resultLink) : "" ?> +
    +
    +
  • + diff --git a/app/webroot/css/co-base.css b/app/webroot/css/co-base.css index 3521f9c2d..af8e34f9b 100644 --- a/app/webroot/css/co-base.css +++ b/app/webroot/css/co-base.css @@ -1369,6 +1369,15 @@ ul.form-list li { padding: 0; list-style: none; } +ul.fields li.form-list-header { + overflow-x: unset; +} +ul.fields li.form-list-header h2 { + color: var(--cmg-color-txt-inverse); + background-color: var(--cmg-color-btn-bg-001); + font-size: 1.4em; + padding: 1rem; +} ul.form-list li:focus-within { background-color: var(--cmg-color-bg-001); } @@ -1884,6 +1893,21 @@ body.attributecollectors .submit { padding-right: 1em; white-space: nowrap; } +ul.form-list li.petition-status-title { + margin-bottom: 1rem; + border: none; +} +ul.form-list li.petition-status-title h2 { + /* default colors for most status titles */ + background-color: var(--cmg-color-highlight-009); + color: var(--cmg-color-highlight-010); + border: 1px solid var(--cmg-color-highlight-011); +} +ul.form-list li.petition-status-title-finalized h2 { + background-color: var(--cmg-color-highlight-006); + color: var(--cmg-color-highlight-007); + border: 1px solid var(--cmg-color-highlight-008); +} /* GENERAL */ .hidden, .invisible,