aboutsummaryrefslogtreecommitdiffstats
path: root/servo/forms
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2015-10-18 23:21:07 +0300
committerFilipp Lepalaan <filipp@mac.com>2015-10-18 23:21:07 +0300
commitc498e23d48548e8048d656677a6b7ee2a9c3fe36 (patch)
treea78e08c21a7ead38b8f95ec9ff0e21946715e0f4 /servo/forms
parentcef2dc31b06c7070c5a4e7e3e608402230e1e4b2 (diff)
downloadServo-c498e23d48548e8048d656677a6b7ee2a9c3fe36.tar.gz
Servo-c498e23d48548e8048d656677a6b7ee2a9c3fe36.tar.bz2
Servo-c498e23d48548e8048d656677a6b7ee2a9c3fe36.zip
Fix issue with editing notes and multiple tabs
Diffstat (limited to 'servo/forms')
-rw-r--r--servo/forms/notes.py6
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'))