mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 04:57:07 -04:00
Add resultCard component for standard display of a card search result
This commit is contained in:
parent
391c0606d1
commit
f00395a6b6
4 changed files with 56 additions and 22 deletions
23
client/components/cards/resultCard.jade
Normal file
23
client/components/cards/resultCard.jade
Normal 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
|
11
client/components/cards/resultCard.js
Normal file
11
client/components/cards/resultCard.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
Template.resultCard.helpers({
|
||||
userId() {
|
||||
return Meteor.userId();
|
||||
},
|
||||
});
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
events() {
|
||||
return [{}];
|
||||
},
|
||||
}).register('resultCard');
|
21
client/components/cards/resultCard.styl
Normal file
21
client/components/cards/resultCard.styl
Normal 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
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue