gestioCOF/gestioncof/templates/registration.html

42 lines
1.7 KiB
HTML
Raw Normal View History

2012-07-11 17:39:20 +02:00
{% extends "base_title.html" %}
2022-06-28 22:01:04 +02:00
{% load static %}
2012-07-11 17:39:20 +02:00
2016-07-27 00:10:20 +02:00
{% block page_size %}col-sm-8{% endblock %}
{% block extra_head %}
<script src="{% static 'vendor/jquery/jquery.autocomplete-light.min.js' %}" type="text/javascript"></script>
{% endblock %}
2012-07-11 17:39:20 +02:00
{% block realcontent %}
2016-07-26 11:56:54 +02:00
<h2>Inscription d'un nouveau membre</h2>
2017-03-20 23:05:48 +01:00
<p class="help-block">Les mots contenant des caractères non alphanumériques seront ignorés</p>
<input type="text" name="q" id="search_autocomplete" spellcheck="false"
placeholder="Chercher un utilisateur par nom, prénom ou identifiant clipper" />
2016-07-26 11:56:54 +02:00
<div id="form-placeholder"></div>
2016-07-27 00:10:20 +02:00
<div class="yourlabs-autocomplete"></div>
2016-07-26 11:56:54 +02:00
<script type="text/javascript">
2016-07-26 20:19:34 +02:00
// On attend que la page soit prête pour executer le code
2016-07-26 11:56:54 +02:00
$(document).ready(function() {
$('input#search_autocomplete').yourlabsAutocomplete({
2018-04-16 16:34:34 +02:00
url: '{% url 'cof.registration.autocomplete' %}',
minimumCharacters: 3,
2016-07-26 11:56:54 +02:00
id: 'search_autocomplete',
choiceSelector: 'li:has(a)',
box: $(".yourlabs-autocomplete"),
});
$('input#search_autocomplete').bind(
'selectChoice',
function(e, choice, autocomplete) {
autocomplete.hide();
link = choice.find('a:first');
if (link.length && link.attr('href') != undefined) {
$('#form-placeholder').html("").load(link.attr('href'), function() {
$('#form-placeholder').toggle().toggle();
});
}
}
);
});
</script>
2012-07-11 17:39:20 +02:00
{% endblock %}