-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
406 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
wildlifelicensing/apps/applications/templates/wl/issue/extracted_field.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{% if field.type == 'text' %} | ||
<input class="form-control" type="{{ field.type }}" name="{{ field.name }}" value="{{ field.data }}"></input> | ||
{% elif field.type == 'text_area' %} | ||
<textarea rows="3" class="form-control" type="{{ field.type }}" name="{{ field.name }}" value="{{ field.data }}"></textarea> | ||
{% elif field.type == 'number' %} | ||
<input class="form-control" type="{{ field.type }}" name="{{ field.name }}" value="{{ field.data }}"></input> | ||
{% elif field.type == 'date' %} | ||
<input id="{{ field.name }}{{ group_index }}_date" class="form-control" name="{{ field.name }}" value="{{ field.data }}"></input> | ||
{% elif field.type == 'species' %} | ||
<input name="{{ field.name }}" class="form-control species" autocomplete="off" data-species-type="{{ field.speciesType }}" value="{{ field.data }}"/> | ||
{% elif field.type == 'label' %} | ||
{% for option in field.options %} | ||
<div> | ||
{% if group_index %} | ||
<input id="{{ option.name }}{{ group_index }}Hidden" name="{{ option.name }}" type="hidden" value="off"> | ||
{% endif %} | ||
<input name="{{ option.name }}" {% if group_index %} id="{{ option.name }}{{ group_index }}" class="extracted-checkbox"{% endif %} | ||
type="checkbox" {% if option.data == 'on' %}checked{% endif %}> | ||
{{ option.label }} | ||
</div> | ||
{% endfor %} | ||
{% elif field.type == 'radiobuttons' %} | ||
{% for option in field.options %} | ||
<div class="radio"> | ||
<label> | ||
<input name="{{ field.name }}" type="radio" value="{{ option.value}}" {% if option.value == field.data %}checked{% endif %}> | ||
{{ option.label }} | ||
</label> | ||
</div> | ||
{% endfor %} | ||
{% elif field.type == 'select' %} | ||
<select name="{{ field.name}}" class="form-control"> | ||
{% if field.defaultBlank %} | ||
<option disabled {% if not field.data %}selected{% endif %}>Please Choose</option> | ||
{% endif %} | ||
{% for option in field.options %} | ||
<option class="form-control" value="{{ option.value}}" {% if option.value == field.data %}selected{% endif %}>{{ option.label }}</option> | ||
{% endfor %} | ||
</select> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
13 changes: 13 additions & 0 deletions
13
wildlifelicensing/apps/applications/templatetags/application_filters.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from django.template.defaulttags import register | ||
|
||
MAX_COLS = 12 | ||
|
||
|
||
@register.filter | ||
def derive_col_width(num_cols): | ||
if num_cols == 0: | ||
return 0 | ||
elif num_cols > MAX_COLS: | ||
return 1 | ||
else: | ||
return int(MAX_COLS / num_cols) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.