portal agent: limit search results (#26642)
This commit is contained in:
parent
46c07dcd5d
commit
cb0088d6ca
|
@ -119,6 +119,9 @@ div.searchcell {
|
|||
text-align: center;
|
||||
}
|
||||
padding-left: 3rem;
|
||||
&.hidden {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
div.combo-search-results-users div.links-list li::before {
|
||||
content: "\f007"; // user
|
||||
|
@ -129,6 +132,19 @@ div.searchcell {
|
|||
div.combo-search-results-tracking-code div.links-list li::before {
|
||||
content: "\f02a"; // barcode
|
||||
}
|
||||
div div.links-list li.see-more::before {
|
||||
content: "\f067"; // plus
|
||||
}
|
||||
div.combo-search-results.expanded div.links-list {
|
||||
li.hidden {
|
||||
display: block;
|
||||
}
|
||||
li.see-more {
|
||||
&::before {
|
||||
content: "\f068"; // minus
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
div.links-list {
|
||||
|
|
|
@ -30,4 +30,8 @@ $(function() {
|
|||
/* mark our location in publik menu */
|
||||
$('#portal-agent-home').addClass('active');
|
||||
});
|
||||
$('div.searchcell').delegate('li.see-more a', 'click', function() {
|
||||
$(this).parents('.combo-search-results').toggleClass('expanded');
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
{% if results.data %}
|
||||
{% if cell.has_multiple_search_services %}<p class="search-service-label">{{ search_service.label }}</p>{% endif %}
|
||||
<div class="links-list">
|
||||
<ul>
|
||||
{% for item in results.data %}
|
||||
{% if forloop.counter == 6 %}<li class="see-more"><a href="#">voir tous les résultats</a></li>{% endif %}
|
||||
<li {% if forloop.counter > 5 %}class="hidden"{% endif %}><a href="{{ item.url }}">{{ item.text }}</a>
|
||||
{% if item.description %}<div>{{ item.description|safe }}</div>{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
Loading…
Reference in New Issue