diff --git a/app/resources/locales/en_US/information.po b/app/resources/locales/en_US/information.po index 9fdfece85..ea07bfbe4 100644 --- a/app/resources/locales/en_US/information.po +++ b/app/resources/locales/en_US/information.po @@ -36,9 +36,18 @@ msgstr "Change Log" msgid "changelog.archived" msgstr "This is an archive record" +msgid "changelog.aria.collapsed" +msgstr "Change Log, collapsed, button, click to expand" + +msgid "changelog.aria.expanded" +msgstr "Change Log, expanded, button, click to collapse" + msgid "changelog.deleted" msgstr "This record has been deleted" +msgid "changelog.return" +msgstr "Return to parent record" + msgid "cos.none" msgstr "You are not an active member in any collaboration. If your request for enrollment is still being processed, you will not be able to login until it is approved. Please contact an administrator for assistance." @@ -51,9 +60,15 @@ msgstr "Platform-wide configurations are available in the configurations." +msgid "entity.created" +msgstr "Created: {0}" + msgid "entity.id" msgstr "ID: {0}" +msgid "entity.modified" +msgstr "Modified: {0}" + msgid "noattrs" msgstr "No attributes" diff --git a/app/src/Lib/Enum/ApplicationStateEnum.php b/app/src/Lib/Enum/ApplicationStateEnum.php index 767389b97..c17244b65 100644 --- a/app/src/Lib/Enum/ApplicationStateEnum.php +++ b/app/src/Lib/Enum/ApplicationStateEnum.php @@ -30,10 +30,11 @@ namespace App\Lib\Enum; class ApplicationStateEnum extends StandardEnum { - const UiDrawerState = 'UD'; - const SearchBlockOptions = 'SO'; + const ChangeLogState = 'CL'; const PaginationLimit = 'PL'; const ProfileDarkMode = 'PM'; const ProfileDensity = 'PD'; + const SearchBlockOptions = 'SO'; const VerifyEmailBlocked = 'VE'; + const UiDrawerState = 'UD'; } \ No newline at end of file diff --git a/app/templates/Standard/add-edit-view.php b/app/templates/Standard/add-edit-view.php index 1e2a8dbad..ed494d240 100644 --- a/app/templates/Standard/add-edit-view.php +++ b/app/templates/Standard/add-edit-view.php @@ -91,16 +91,6 @@

- changelogAttributeName(); - - if($vv_obj->deleted) { - print __d('information', 'changelog.deleted'); - } elseif(!empty($vv_obj->$clfield)) { - print __d('information', 'changelog.archived'); - } - ?> element('flash') ?> +changelogAttributeName(); + + if($vv_obj->deleted) { + print $this->element('notify/alert', + ['type' => 'information', + 'message' => __d('information', 'changelog.deleted'), + 'dismissible ' => false] + ); + } elseif(!empty($vv_obj->$clfield)) { + print $this->element('notify/alert', + ['type' => 'information', + 'message' => __d('information', 'changelog.archived'), + 'dismissible ' => false] + ); + } +?> + element('entityMetadata'); print $this->element('changelog'); } \ No newline at end of file diff --git a/app/templates/element/changelog.php b/app/templates/element/changelog.php index 63987cede..134ddf094 100644 --- a/app/templates/element/changelog.php +++ b/app/templates/element/changelog.php @@ -1,108 +1,141 @@ changelogAttributeName(); + $parentUrl = null; -// If this is an archived record, include a link to the parent (active) record -$clAttr = $vv_obj->changelogAttributeName(); -$parentLink = null; + if(!empty($vv_obj->$clAttr)) { + $parentUrl = $this->Url->build( + ['action' => 'edit', $vv_obj->$clAttr] + ); + } -if(!empty($vv_obj->$clAttr)) { - $parentLink = $this->Html->link( - $vv_obj->$clAttr, - ['action' => 'edit', $vv_obj->$clAttr] - ); -} + // Get the change log open/closed state + $changeLogState = $this->ApplicationState->getValue(ApplicationStateEnum::ChangeLogState, ''); + $changeLogStateId = $this->ApplicationState->getId(ApplicationStateEnum::ChangeLogState); -// We'll render an index of all archived records if we are the current active record, -// or just the current metadata if we are an archived record + // We'll render an index of all archived records if we are the current active record, + // or just the current metadata if we are an archived record ?> - - - -
- - - - - - - - - - - - - - - - - - - - - - -
id - ?>revision ?>modified ?>actor_identifier ?>
Html->link( - $archive->id, - ['action' => 'view', $archive->id] - ) - ?>revision ?>modified ?>actor_identifier ?>
-
- -
- - - - - - - - - - - - - - - - - - - - - -
deleted ? '1' : '0')) ?>
revision; ?>
modified ?>
actor_identifier ?>
+
+
+

+ +

+
+
+ $clAttr && !empty($vv_archives))): // $vv_obj is an active record ?> + + + + + + + + + + + + + + + + + + + + + + +
id + ?>revision ?>modified ?>actor_identifier ?>
Html->link( + $archive->id, + ['action' => 'view', $archive->id] + ) + ?>revision ?>modified ?>actor_identifier ?>
+ +
    +
  • +
    +
    deleted ? '1' : '0')) ?>
    +
  • +
  • +
    +
    revision; ?>
    +
  • +
  • +
    +
    actor_identifier ?>
    +
  • +
  • +
    +
    + $clAttr)): ?> + +
    $clAttr ?>
    + +
    + +
    +
  • +
+ +
+
+
- \ No newline at end of file + \ No newline at end of file diff --git a/app/templates/element/entityMetadata.php b/app/templates/element/entityMetadata.php new file mode 100644 index 000000000..b6f07ff62 --- /dev/null +++ b/app/templates/element/entityMetadata.php @@ -0,0 +1,45 @@ + + +id)): ?> +
+
+ id) ?> +
+
+ created) ?> +
+ created != $vv_obj->modified): ?> +
+ modified) ?> +
+ +
+ \ No newline at end of file diff --git a/app/templates/element/form/entityID.php b/app/templates/element/form/entityID.php deleted file mode 100644 index 9f24868e0..000000000 --- a/app/templates/element/form/entityID.php +++ /dev/null @@ -1,37 +0,0 @@ - - -id)): ?> -
  • - id) ?> -
  • - - diff --git a/app/templates/element/form/unorderedList.php b/app/templates/element/form/unorderedList.php index a5ee224a3..9179f3285 100644 --- a/app/templates/element/form/unorderedList.php +++ b/app/templates/element/form/unorderedList.php @@ -48,8 +48,6 @@ // in one of several paths if we are in a plugin context. // The include files will contain the listItem elements include($vv_template_path . DS . $fieldsFile); - // Element ID - print $this->element('form/entityID'); if(!isset($suppress_submit) || !$suppress_submit) { // The Submit element will be printed only if we are adding or updating, and if not diff --git a/app/templates/element/javascript.php b/app/templates/element/javascript.php index 472b1a64b..52a17e187 100644 --- a/app/templates/element/javascript.php +++ b/app/templates/element/javascript.php @@ -365,6 +365,28 @@ }); + // CHANGELOG ACCORDION BEHAVIOR + $('#changelog-container .accordion-button').click(function(){ + const changelogAriaLabelExpanded = ''; + const changelogAriaLabelCollapsed = ''; + if (!$(this).hasClass("collapsed")) { + $(this).attr('aria-label', changelogAriaLabelExpanded); + setApplicationState( + "show", + $("#changelog-container .accordion-button"), + false + ); + } else { + $(this).attr('aria-label', changelogAriaLabelCollapsed); + setApplicationState( + "hide", + $("#changelog-container .accordion-button"), + false + ); + } + $('#changelog accordion-button').toggle(); + }); + // SETTINGS (from User Menu) // Dark Mode toggles (auto is default) $("#setting-darkmode-dark").click(function(e) { diff --git a/app/webroot/css/co-base.css b/app/webroot/css/co-base.css index 3c92d465f..fb5b4721e 100644 --- a/app/webroot/css/co-base.css +++ b/app/webroot/css/co-base.css @@ -1966,14 +1966,11 @@ li[data-pc-section="emptymessage"] { clip: rect(0, 0, 0, 0); white-space: nowrap; /* Prevent text wrapping */ } -/* ENTITY ID under each Edit/View Form/List */ -#cm-entity-id { - position: absolute; - border: none; - right: 2.5em; - padding-top: 1em; +/* ENTITY METADATA under each Edit/View Form/List */ +#entity-metadata { + text-align: right; + margin: 0 0 0.5rem; color: var(--cmg-color-txt-soft); - background-color: unset; } /* ENROLLMENT FLOWS */ .upper-buttons { @@ -2806,6 +2803,34 @@ html.density-large ul.form-list li .field { html.density-large .field-data { padding: 0.75em 1em; } +/* CHANGELOG */ +#changelog-container .accordion-button { + padding: 0.5rem 1rem; +} +#changelog-container .accordion-item { + border-radius: 0; + border: 1px solid var(--cmg-color-bg-005) +} +#changelog .accordion-body, +#changelog .accordion-body ul { + margin: 0; + padding: 0; + list-style: none; +} +#changelog .accordion-body { + overflow-x: scroll; +} +#changelog .accordion-body li { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 1rem; + padding: 0.5rem 1rem; + border-top: 1px solid var(--cmg-color-bg-003); + align-items: center; +} +#changelog .accordion-body li:first-child { + border-top: none; +} /* FOOTER */ footer { text-align: center; diff --git a/app/webroot/css/co-responsive.css b/app/webroot/css/co-responsive.css index 833a57d5a..a398a7c15 100644 --- a/app/webroot/css/co-responsive.css +++ b/app/webroot/css/co-responsive.css @@ -363,6 +363,15 @@ right: 0.75em; z-index: 1; } + /* ENTITY METADATA under each Edit/View Form/List */ + #entity-metadata { + display: flex; + justify-content: flex-end; + gap: 2rem; + align-items: center; + text-align: left; + margin: 1rem 0 0.5rem; + } /* GENERAL */ .table-container { overflow: unset; @@ -572,6 +581,18 @@ .petition-attrs-subset-label { font-size: 0.8em; } + /* CHANGELOG */ + #changelog .accordion-body li { + grid-template-columns: 1fr 3fr; + } + #changelog .changelog-parent-link { + display: flex; + gap: 1rem; + align-items: center; + } + #changelog .accordion-body { + overflow-x: unset; + } /* FOOTER */ #co-footer { position: static;