app/soc/views/helper/widgets.py
changeset 812 36280f137731
parent 499 d22e4fe8e64b
child 841 9dac40accd06
equal deleted inserted replaced
811:9e56019eb218 812:36280f137731
    40   def render(self, name, value, attrs=None):
    40   def render(self, name, value, attrs=None):
    41     """Render ReadOnlyInput widget as HTML.
    41     """Render ReadOnlyInput widget as HTML.
    42     """
    42     """
    43     attrs['readonly'] = 'readonly'
    43     attrs['readonly'] = 'readonly'
    44     return super(ReadOnlyInput, self).render(name, value, attrs)
    44     return super(ReadOnlyInput, self).render(name, value, attrs)
       
    45 
       
    46 
       
    47 class ReadOnlyBool(forms.widgets.Input):
       
    48   """Read only checkbox widget.
       
    49   """
       
    50   input_type = 'checkbox'
       
    51 
       
    52   def render(self, name, value, attrs=None):
       
    53     """Render ReadOnlyBool widget as HTML.
       
    54     """
       
    55     # TODO(tlarsen): this really should display "Yes" or "No" (wrapped with
       
    56     #   ugettext_lazy(), of course), instead of displaying a greyed-out but
       
    57     #   toggleable checkbox (that has no effect on the field, though).
       
    58     attrs['readonly'] = 'readonly'
       
    59     return super(ReadOnlyBool, self).render(name, value, attrs)
    45 
    60 
    46 
    61 
    47 class TinyMCE(forms.widgets.Textarea):
    62 class TinyMCE(forms.widgets.Textarea):
    48   """TinyMCE widget. 
    63   """TinyMCE widget. 
    49   
    64