-
= __d('controller', $pm, 2); ?>
-
-
- $matches): ?>
- \Cake\Utility\Inflector::dasherize($pm),
- 'action' => 'edit',
- $pkey
- ];
- // The same entity can match on more than one searchable model
- ?>
-
- $entity): ?>
- $displayField;
-
- // If we match on a related model (for example PersonRoles for People)
- // indicate what actually matched
- $matchInfo = __d('result', 'search.result.id', $pkey);
-
- // Do we have a more informative string to render?
- if(!empty($entity->person->primary_name->full_name)) {
- $displayString = $entity->person->primary_name->full_name;
-
- $matchInfo = __d('result', 'search.result.related', $displayLabel, $entity->$displayField, $pkey);
- } elseif(!empty($entity->group->name)) {
- $displayString = $entity->group->name;
-
- $matchInfo = __d('result', 'search.result.related', $displayLabel, $displayString, $pkey);
- }
- ?>
- -
-
-
- = $displayString ?>
-
-
- = filter_var($matchInfo, FILTER_SANITIZE_SPECIAL_CHARS) ?>
-
-
-
-
-
-
+
+
+
+
+
+ $matches): ?>
+ \Cake\Utility\Inflector::dasherize($pm),
+ 'action' => 'edit',
+ $pkey
+ ];
+ // The same entity can match on more than one searchable model
+ ?>
+
+ $entity): ?>
+ $displayField;
+
+ // If we match on a related model (for example PersonRoles for People)
+ // indicate what actually matched
+ $matchInfo = __d('result', 'search.result.id', $pkey);
+
+ // Do we have a more informative string to render?
+ if(!empty($entity->person->primary_name->full_name)) {
+ $displayString = $entity->person->primary_name->full_name;
+
+ $matchInfo = __d('result', 'search.result.related', $displayLabel, $entity->$displayField, $pkey);
+ } elseif(!empty($entity->group->name)) {
+ $displayString = $entity->group->name;
+
+ $matchInfo = __d('result', 'search.result.related', $displayLabel, $displayString, $pkey);
+ }
+ ?>
+ -
+
+
+ = $displayString ?>
+
+
+ = filter_var($matchInfo, FILTER_SANITIZE_SPECIAL_CHARS) ?>
+
+
+
+
+
+
+
+
diff --git a/app/templates/element/javascript.php b/app/templates/element/javascript.php
index 3d7d50d9b..3482c912d 100644
--- a/app/templates/element/javascript.php
+++ b/app/templates/element/javascript.php
@@ -53,30 +53,29 @@
// SEARCH
// Persistent search bar form:
- $('#global-search form').submit(function () {
- // Disallow submit on blank
- if($.trim($('#global-search-q').val()) == '') {
- return false;
- }
- });
- // Select search text on focus
- $('#global-search-q').focus(function() {
- $('#global-search-q').select();
- });
-
- // Search page form:
- $('#search').submit(function () {
+ $('#global-search form').submit(function() {
// Disallow submit on blank
if($.trim($('#q').val()) == '') {
return false;
}
});
- $('#search-clear').click(function () {
+ $('#global-search-clear').click(function(e) {
+ e.stopPropagation();
$('#q').val('');
+ $('#q').removeClass('hasValue');
$('#q').focus();
});
+ // Select search text on focus
$('#q').focus(function() {
- $('#q').select();
+ $(this).select();
+ });
+ // Hide and reveal clear button
+ $('#q').on('input', function(e) {
+ if($(this).val() != '') {
+ $(this).addClass('hasValue');
+ } else {
+ $(this).removeClass('hasValue');
+ }
});
// TOP FILTER FORM
diff --git a/app/templates/element/searchGlobal.php b/app/templates/element/searchGlobal.php
index c44626838..cfbfff0e1 100644
--- a/app/templates/element/searchGlobal.php
+++ b/app/templates/element/searchGlobal.php
@@ -46,11 +46,42 @@
Form->create(null, $options);
print $this->Form->hidden('co_id', ['default' => $vv_cur_co->id]);
- print $this->Form->label('global-search-q', __d('field','search.placeholder'), ['class' => 'visually-hidden']);
- print $this->Form->input('global-search-q',['id' => 'global-search-q', 'placeholder' => __d('field','search.placeholder')]);
+ print $this->Form->label(
+ 'q',
+ __d('field','search.global'),
+ ['class' => 'visually-hidden']
+ );
+ $globalSearchInputClass = '';
+ if(!empty($this->request->getData('q'))) {
+ $globalSearchInputClass = 'hasValue';
+ }
+ print $this->Form->input(
+ 'q',
+ [
+ 'id' => 'q',
+ 'class' => $globalSearchInputClass,
+ 'placeholder' => __d('field','search.placeholder')
+ ]
+ );
+ print $this->Form->button(
+ '
close',
+ [
+ 'type' => 'button',
+ 'escapeTitle' => false,
+ 'id' => 'global-search-clear',
+ 'class' => 'btn btn-link',
+ 'aria-label' => __d('field','search.global.clear')
+ ]
+ );
print $this->Form->button(
'
search',
- ['type' => 'submit', 'escapeTitle' => false, 'id' => 'global-search-button', 'class' => 'btn btn-link btn-sm']
+ [
+ 'type' => 'submit',
+ 'escapeTitle' => false,
+ 'id' => 'global-search-button',
+ 'class' => 'btn btn-link btn-sm',
+ 'aria-label' => __d('field','search.global.submit')
+ ]
);
print $this->Form->end();
?>
diff --git a/app/webroot/css/co-base.css b/app/webroot/css/co-base.css
index 2e9a40519..4a40bdb29 100644
--- a/app/webroot/css/co-base.css
+++ b/app/webroot/css/co-base.css
@@ -185,7 +185,7 @@ body.cos.select #top-bar {
justify-content: space-between;
padding: 1em;
}
-#global-search #global-search-q { /* search input */
+#global-search #q { /* search input */
padding-left: 0.5em;
width: 100%;
border-radius: 0;
@@ -196,6 +196,16 @@ body.cos.select #top-bar {
color: white;
border-radius: 0 3px 3px 0;
}
+#global-search-clear {
+ display: none; /* will only appear if input holds a value */
+ background-color: var(--cmg-color-blue-002);
+ border-radius: 0;
+ color: var(--cmg-color-white);
+ border-right: 1px dotted var(--cmg-color-gray-004);
+}
+#q.hasValue + #global-search-clear {
+ display: inline-block;
+}
#top-bar #global-search-toggle {
display: flex;
align-items: center;
@@ -595,23 +605,6 @@ ul.form-list li.alert-banner .co-alert {
margin-top: 1em;
}
/* SEARCH RESULTS */
-#search-container {
- padding: 1em;
- margin-bottom: 1em;
- background-color: var(--cmg-color-lightgray-004);
- border: 1px solid var(--cmg-color-lightgray-006);
-}
-#search-clear {
- color: var(--cmg-color-gray-001);
- text-decoration: none;
- position: absolute;
- right: 4.5em;
-}
-#search-results {
- display: flex;
- flex-wrap: wrap;
- gap: 1em;
-}
#search-results-meta {
padding: 0;
}
@@ -626,22 +619,16 @@ ul.form-list li.alert-banner .co-alert {
#search-results-meta li:last-child:after {
content: "";
}
-#search-results h3 {
- margin-bottom: 0.5em;
-}
#search-results ul.search-results-group {
padding: 0;
list-style: none;
- display: flex;
- flex-wrap: wrap;
+ display: grid;
gap: 1em;
+ margin-bottom: 0;
}
#search-results li.search-result {
- display: block;
padding: 0;
border: 1px dashed var(--cmg-color-lightgray-008);
- flex: 1 1 10%;
- min-width: 220px;
}
#search-results li.search-result a {
display: block;
@@ -660,6 +647,9 @@ ul.form-list li.alert-banner .co-alert {
#search-results .search-result-match-info {
font-size: 0.8em;
}
+#search-results .accordion-body {
+ padding: 1em;
+}
/* TOP FILTER */
.top-filters {
margin-top: 0.5em;
@@ -1521,7 +1511,7 @@ table.list-mode .read-only-link-container {
background-color: var(--cmg-color-red-004);
color: var(--cmg-color-white);
}
-.btn.link {
+.btn-link {
font-size: 1em;
text-decoration: underline;
color: var(--cmg-color-blue-002);
@@ -1583,6 +1573,10 @@ table.list-mode .read-only-link-container {
color: var(--cmg-color-gray-002);
border: 1px solid var(--cmg-color-gray-002);
}
+/* Bootstrap Accordion */
+.accordion-button:not(.collapsed) {
+ background-color: var(--cmg-color-lightgray-001);
+}
/* FOOTER */
footer {
text-align: center;
diff --git a/app/webroot/css/co-responsive.css b/app/webroot/css/co-responsive.css
index c9f02a59c..108d9b3cc 100644
--- a/app/webroot/css/co-responsive.css
+++ b/app/webroot/css/co-responsive.css
@@ -119,11 +119,6 @@
display: none;
}
/* CONTENT LAYOUT */
- #comanage-wrapper {
- display: flex;
- flex-direction: column;
- height: 100vh;
- }
#main-wrapper {
display: flex;
flex-direction: row;
@@ -155,16 +150,16 @@
padding: 0.5em 0.2em;
}
#global-search form {
- padding: 0 0.5em;
+ padding: 0 0 0 0.5em;
min-height: 30px;
}
- #global-search #global-search-q {
+ #global-search #q {
flex: 1;
width: auto;
border: none;
background-color: transparent;
}
- #global-search #global-search-q:focus-visible {
+ #global-search #q:focus-visible {
outline: none;
}
#global-search button {
@@ -184,15 +179,13 @@
#global-search button.visible {
display: inline-block;
}
- /* SEARCH RESULTS */
- #search {
- display: flex;
- justify-content: space-between;
- align-items: center;
+ #global-search #global-search-clear {
+ padding: 0 0.75em;
+ border-right: 1px dashed var(--cmg-color-lightgray-006);
}
- #search-results {
- flex-wrap: nowrap;
- gap: 2em;
+ /* SEARCH RESULTS */
+ #search-results ul.search-results-group {
+ grid-template-columns: repeat(2,1fr);
}
#top-menu {
z-index: 30;
@@ -388,6 +381,10 @@
grid-template-columns: repeat(2,40px);
grid-template-rows: repeat(2,40px);
}
+ /* SEARCH RESULTS */
+ #search-results ul.search-results-group {
+ grid-template-columns: repeat(4,1fr);
+ }
}
/* EXTRA LARGE */