DemocracyClub / dc_base_theme

🎨 Democracy Club Base Theme
0 stars 7 forks source link

dc_form template filter renders duplicate label tags #15

Closed chris48s closed 7 years ago

chris48s commented 7 years ago

Steps to reproduce:

  1. Create a form with a CharField, URLField, etc e.g:
class ElectionSourceForm(forms.Form):
    source = forms.CharField(required=True, max_length=1000,
        label="Where did you find out about this election?")
  1. render it with {{ form|dc_form }}

Expected output:

<div class="form-group">
    <label class="control-label  " for="id_source-source">Where did you find out about this election?</label>
    <div class=" ">
        <input class=" form-control" id="id_source-source" maxlength="1000" name="source-source" type="text" required />
    </div>
</div>

Observed output:

<div class="form-group">
    <label >
        Where did you find out about this election?            
    </label>
    <label class="control-label  " for="id_source-source">Where did you find out about this election?</label>
    <div class=" ">
        <input class=" form-control" id="id_source-source" maxlength="1000" name="source-source" type="text" required />
    </div>
</div>
chris48s commented 7 years ago

Closed by #16