Add resultCard component for standard display of a card search result

This commit is contained in:
John R. Supplee 2021-01-13 21:46:18 +02:00
parent 391c0606d1
commit f00395a6b6
4 changed files with 56 additions and 22 deletions

View file

@ -0,0 +1,23 @@
template(name="resultCard")
.result-card-wrapper
a.minicard-wrapper.card-title(href=card.absoluteUrl)
+minicard(this)
//= card.title
ul.result-card-context-list
li.result-card-context(title="{{_ 'board'}}")
+viewer
= getBoard.title
li.result-card-context.result-card-context-separator
= ' '
| {{_ 'context-separator'}}
= ' '
li.result-card-context(title="{{_ 'swimlane'}}")
+viewer
= getSwimlane.title
li.result-card-context.result-card-context-separator
= ' '
| {{_ 'context-separator'}}
= ' '
li.result-card-context(title="{{_ 'list'}}")
+viewer
= getList.title

View file

@ -0,0 +1,11 @@
Template.resultCard.helpers({
userId() {
return Meteor.userId();
},
});
BlazeComponent.extendComponent({
events() {
return [{}];
},
}).register('resultCard');

View file

@ -0,0 +1,21 @@
.result-card-list-wrapper
margin: 1rem
border-radius: 5px
padding: 1.5rem
padding-top: 0.75rem
display: inline-block
min-width: 250px
max-width: 350px
.result-card-wrapper
margin-top: 0
margin-bottom: 10px
.result-card-context
display: inline-block
.result-card-context-separator
font-weight: bold
.result-card-context-list
margin-bottom: 0.7rem

View file

@ -29,28 +29,7 @@ template(name="globalSearch")
span.global-search-error-messages
| {{_ msg.tag msg.value }}
each card in results
.global-search-card-wrapper
a.minicard-wrapper.card-title(href=card.absoluteUrl)
+minicard(card)
//= card.title
ul.global-search-context-list
li.global-search-context(title="{{_ 'board'}}")
+viewer
= card.getBoard.title
li.global-search-context.global-search-context-separator
= ' '
| {{_ 'context-separator'}}
= ' '
li.global-search-context(title="{{_ 'swimlane'}}")
+viewer
= card.getSwimlane.title
li.global-search-context
= ' '
| {{_ 'context-separator'}}
= ' '
li.global-search-context(title="{{_ 'list'}}")
+viewer
= card.getList.title
+resultCard(card)
else
.global-search-instructions
h1 Search Operators