add search button

This commit is contained in:
Ludovic Stephan 2016-12-09 00:43:23 -02:00
parent f5ebe3f166
commit 3a68c6c9f1

View file

@ -249,9 +249,12 @@ $(document).ready(function() {
} }
if (account_data['id'] == 0) { if (account_data['id'] == 0) {
var trigramme = triInput.val().toUpperCase(); var trigramme = triInput.val().toUpperCase();
var url_base = '{% url 'kfet.account.create' %}'
if (isValidTrigramme(trigramme)) { if (isValidTrigramme(trigramme)) {
var url_base = '{% url 'kfet.account.create' %}'
buttons += '<a href="'+url_base+'?trigramme='+trigramme+'" class="btn btn-primary" target="_blank" title="Créer"><span class="glyphicon glyphicon-plus"></span></a>'; buttons += '<a href="'+url_base+'?trigramme='+trigramme+'" class="btn btn-primary" target="_blank" title="Créer"><span class="glyphicon glyphicon-plus"></span></a>';
} else {
var url_base = '{% url 'kfet.account' %}'
buttons += '<a href="'+url_base+'" class="btn btn-primary" target="_blank" title="Rechercher"><span class="glyphicon glyphicon-search"></span></a>';
} }
} }
account_container.find('.buttons').html(buttons); account_container.find('.buttons').html(buttons);