summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/templates/blocks/JQueryAutocomplete.js2
-rw-r--r--ishtar_common/templates/ishtar/wizard/default_wizard.html2
-rw-r--r--ishtar_common/widgets.py10
3 files changed, 10 insertions, 4 deletions
diff --git a/ishtar_common/templates/blocks/JQueryAutocomplete.js b/ishtar_common/templates/blocks/JQueryAutocomplete.js
index aaf493db9..54b0cb645 100644
--- a/ishtar_common/templates/blocks/JQueryAutocomplete.js
+++ b/ishtar_common/templates/blocks/JQueryAutocomplete.js
@@ -1,6 +1,7 @@
{% load replace_underscore %}
var base_source_{{field_id|replace_underscore}} = {{source}};
var source_{{field_id|replace_underscore}} = base_source_{{field_id|replace_underscore}};
+var current_label_{{field_id|replace_underscore}};
$(function() {
$("#id_select_{{field_id}}").autocomplete({
@@ -8,6 +9,7 @@ $(function() {
select: function( event, ui ) {
if(ui.item){
$('#id_{{field_id}}').val(ui.item.id);
+ current_label_{{field_id|replace_underscore}} = ui.item.label;
$('#id_{{field_id}}').change();
} else {
$('#id_{{field_id}}').val(null);
diff --git a/ishtar_common/templates/ishtar/wizard/default_wizard.html b/ishtar_common/templates/ishtar/wizard/default_wizard.html
index cfd17e58f..c279a37e0 100644
--- a/ishtar_common/templates/ishtar/wizard/default_wizard.html
+++ b/ishtar_common/templates/ishtar/wizard/default_wizard.html
@@ -52,6 +52,8 @@
{% endblock %}
<script language="javascript" type="text/javascript">
var form_changed = false;
+{% block "js_extra_generic" %}
+{% endblock %}
$(document).ready(function(){
$('form :input').change(function(){form_changed=true;});
$('.change_step').click(function(){
diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py
index 28bd9bdd9..df0d09764 100644
--- a/ishtar_common/widgets.py
+++ b/ishtar_common/widgets.py
@@ -729,8 +729,10 @@ class JQueryAutoComplete(forms.TextInput):
model_name = self.associated_model._meta.object_name.lower()
if self.tips:
new += """<span class="input-group-append">
- <span class="add-button input-group-text"><em>{}</em></span></span>
- """.format(self.tips)
+ <span class="add-button input-group-text">
+ <em id="{}-tips">{}</em>
+ </span></span>
+ """.format(attrs_hidden['id'], self.tips)
if self.modify:
new += """
<span class="input-group-append">
@@ -786,8 +788,8 @@ class JQueryAutoComplete(forms.TextInput):
_("Restore previous")
)
attrs_hidden_previous = attrs_hidden.copy()
- attrs_hidden_previous['name'] += u"_previous"
- attrs_hidden_previous['id'] += u"_previous"
+ attrs_hidden_previous['name'] += "_previous"
+ attrs_hidden_previous['id'] += "_previous"
old_value += u"<input type='hidden'{}>".format(
flatatt(attrs_hidden_previous))
pk = None