diff options
Diffstat (limited to 'servo/forms')
-rw-r--r-- | servo/forms/notes.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/servo/forms/notes.py b/servo/forms/notes.py index fb96ff6..d6ed693 100644 --- a/servo/forms/notes.py +++ b/servo/forms/notes.py @@ -3,6 +3,7 @@ import json from django import forms from gsxws import escalations +from django.core.urlresolvers import reverse from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ @@ -32,11 +33,16 @@ class NoteForm(BaseModelForm): choices=note.get_sender_choices(), widget=forms.Select(attrs={'class': 'span12'}) ) + self.fields['body'].widget = AutocompleteTextarea( rows=20, choices=Template.templates() ) + if note.order: + url = reverse('notes-render_template', args=[note.order.pk]) + self.fields['body'].widget.attrs['data-url'] = url + class NoteSearchForm(forms.Form): body = forms.CharField(required=False, label=_('Body contains')) |