search results css

This commit is contained in:
Ludovic Stephan 2017-01-19 22:53:58 -02:00
parent e7956f3b62
commit 016989c4de
3 changed files with 25 additions and 4 deletions

View file

@ -83,3 +83,24 @@
padding-right: 50px; padding-right: 50px;
padding-left: 50px; padding-left: 50px;
} }
/* Account autocomplete window */
#account_results ul {
list-style-type:none;
background:rgba(255,255,255,0.9);
padding:0;
}
#account_results li {
display:block;
padding:5px 20px;
height:100%;
width:100%;
}
#account_results .hilight {
background:rgba(200,16,46,0.9);
color:#fff;
text-decoration:none;
}

View file

@ -3,7 +3,7 @@
<ul> <ul>
{% if accounts %} {% if accounts %}
{% for trigramme, user in accounts %} {% for trigramme, user in accounts %}
<li><span class="choice">{{ user|highlight_text:q }} (<span class="trigramme">{{ trigramme }}</span>)</li> <li class='choice'>{{ user|highlight_text:q }} (<span class="trigramme">{{ trigramme }}</span>)</li>
{% endfor %} {% endfor %}
{% elif not q %} {% elif not q %}
<li class="user_category"><span class="text">Pas de recherche, pas de résultats !</span></li> <li class="user_category"><span class="text">Pas de recherche, pas de résultats !</span></li>

View file

@ -265,7 +265,7 @@ $(document).ready(function() {
// Search for an account // Search for an account
function searchAccount() { function searchAccount() {
var content = '<input type="text" name="q" id="search_autocomplete" spellcheck="false" autofocus><div class="yourlabs-autocomplete"></div>' ; var content = '<input type="text" name="q" id="search_autocomplete" spellcheck="false" autofocus><div id="account_results"></div>' ;
$.dialog({ $.dialog({
title: 'Recherche de compte', title: 'Recherche de compte',
content: content, content: content,
@ -276,12 +276,12 @@ $(document).ready(function() {
onOpen: function() { onOpen: function() {
var that=this ; var that=this ;
$('input#search_autocomplete').yourlabsAutocomplete({ $('input#search_autocomplete').yourlabsAutocomplete({
url: '{% url 'kfet.account.search.autocomplete' %}', url: '{% url "kfet.account.search.autocomplete" %}',
minimumCharacters: 2, minimumCharacters: 2,
id: 'search_autocomplete', id: 'search_autocomplete',
choiceSelector: '.choice', choiceSelector: '.choice',
placeholder: "Chercher un utilisateur K-Fêt", placeholder: "Chercher un utilisateur K-Fêt",
box: $(".yourlabs-autocomplete"), box: $("#account_results"),
}); });
$('input#search_autocomplete').bind( $('input#search_autocomplete').bind(
'selectChoice', 'selectChoice',