Skip to content

Commit

Permalink
Added select, radio, checkbox fields, added style-able divs to field …
Browse files Browse the repository at this point in the history
…html
  • Loading branch information
jbroadway committed Nov 22, 2011
1 parent b68c4a2 commit 8009f10
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 7 deletions.
14 changes: 14 additions & 0 deletions views/field/checkbox.html
@@ -0,0 +1,14 @@
<div class="form-field form-field-checkbox">
<div class="form-field-label">
<label for="{{ id }}">{{ label }}:</label>
<span class="form-notice" id="form-{{ id }}-notice">{{ message }}</span>
</div>
<div class="form-field-input">
{% foreach values %}
<div>
<input type="checkbox" name="{{ id }}[]" value="{{ loop_value }}"{% if loop_value == $data->default %} checked="checked"{% end %} />
<span>{{ loop_value }}</span>
</div>
{% end %}
</div>
</div>
14 changes: 14 additions & 0 deletions views/field/radio.html
@@ -0,0 +1,14 @@
<div class="form-field form-field-radio">
<div class="form-field-label">
<label for="{{ id }}">{{ label }}:</label>
<span class="form-notice" id="form-{{ id }}-notice">{{ message }}</span>
</div>
<div class="form-field-input">
{% foreach values %}
<div>
<input type="radio" name="{{ id }}" value="{{ loop_value }}"{% if loop_value == $data->default %} checked="checked"{% end %} />
<span>{{ loop_value }}</span>
</div>
{% end %}
</div>
</div>
14 changes: 14 additions & 0 deletions views/field/select.html
@@ -0,0 +1,14 @@
<div class="form-field form-field-select">
<div class="form-field-label">
<label for="{{ id }}">{{ label }}:</label>
<span class="form-notice" id="form-{{ id }}-notice">{{ message }}</span>
</div>
<div class="form-field-input">
<select name="{{ id }}" value="{{ default }}" placeholder="{{ placeholder }}">
<option value="">- {" Choose "} -</option>
{% foreach values %}
<option value="{{ loop_value }}"{% if loop_value == $data->default %} selected="selected"{% end %}>{{ loop_value }}</option>
{% end %}
</select>
</div>
</div>
12 changes: 9 additions & 3 deletions views/field/text.html
@@ -1,3 +1,9 @@
<p>{{ label }}:<br />
<input type="text" name="{{ id }}" size="{{ size }}" value="{{ default }}" placeholder="{{ placeholder }}" />
<span class="form-notice" id="form-{{ id }}-notice">{{ message }}</span></p>
<div class="form-field form-field-text">
<div class="form-field-label">
<label for="{{ id }}">{{ label }}:</label>
<span class="form-notice" id="form-{{ id }}-notice">{{ message }}</span>
</div>
<div class="form-field-input">
<input type="text" name="{{ id }}" size="{{ size }}" value="{{ default }}" placeholder="{{ placeholder }}" />
</div>
</div>
12 changes: 9 additions & 3 deletions views/field/textarea.html
@@ -1,3 +1,9 @@
<p>{{ label }}: <span class="form-notice" id="form-{{ id }}-notice">{{ message }}</span><br />
<textarea name="{{ id }}" cols="{{ cols }}" rows="{{ rows }}" placeholder="{{ placeholder }}">{{ default }}</textarea>
</p>
<div class="form-field form-field-textarea">
<div class="form-field-label">
<label for="{{ id }}">{{ label }}:</label>
<span class="form-notice" id="form-{{ id }}-notice">{{ message }}</span>
</div>
<div class="form-field-input">
<textarea name="{{ id }}" cols="{{ cols }}" rows="{{ rows }}" placeholder="{{ placeholder }}">{{ default }}</textarea>
</div>
</div>
6 changes: 6 additions & 0 deletions views/head.html
Expand Up @@ -26,6 +26,12 @@
display: none;
color: red;
}
.form-field {
padding-bottom: 18px;
}
.form-field label {
font-weight: bold;
}
</style>

{% if message %}
Expand Down
6 changes: 5 additions & 1 deletion views/tail.html
@@ -1,2 +1,6 @@
<p><input type="submit" value="{" Submit "}" /></p>
<div class="form-field form-field-submit">
<div class="form-field-input">
<input type="submit" value="{" Submit "}" />
</div>
</div>
</form>

0 comments on commit 8009f10

Please sign in to comment.