gremmie@1: """ gremmie@1: Various useful widgets for the GPP application. gremmie@1: """ gremmie@1: gremmie@1: from django import forms gremmie@1: from django.utils.safestring import mark_safe gremmie@1: from django.core.urlresolvers import reverse bgneal@6: from django.conf import settings gremmie@1: gremmie@1: gremmie@1: class AutoCompleteUserInput(forms.TextInput): gremmie@1: class Media: gremmie@1: css = { bgneal@6: 'all': settings.GPP_THIRD_PARTY_CSS['jquery-autocomplete'], gremmie@1: } bgneal@12: js = settings.GPP_THIRD_PARTY_JS['jquery-autocomplete'] gremmie@1: gremmie@1: def render(self, name, value, attrs=None): gremmie@1: url = reverse('messages-ajax_users') gremmie@1: output = super(AutoCompleteUserInput, self).render(name, value, attrs) gremmie@1: return output + mark_safe(u'''\ gremmie@1: ''' % (name, url)) gremmie@1: