summaryrefslogtreecommitdiff
path: root/pgcommitfest/commitfest/widgets.py
blob: 4af8b2d8c654b213e51c5c99214445e1d397550c (plain)
1
2
3
4
5
6
7
8
9
10
from django.forms import TextInput
from django.utils.safestring import mark_safe


class ThreadPickWidget(TextInput):
    def render(self, name, value, attrs=None, renderer=None):
        attrs['class'] += ' threadpick-input'
        html = super(ThreadPickWidget, self).render(name, value, attrs)
        html = html + '&nbsp;<button class="btn btn-default attachThreadButton" id="btn_%s">Find thread</button>' % name
        return mark_safe(html)