Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (38 sloc) 1.37 KB
[%#
Renders a simple "<input <input type="file" />"
with a localized label, error message and help boxes.
Params:
arg - string - the name for the field
params - hash - attributes for the widged
%]
[% MACRO file_field(arg,params) BLOCK;
name_and_id = arg||params.name;
field_error = validator_errors.${name_and_id};
label = name_and_id.replace('[^\.]+\.','');
name_and_id_help = params.help|| label _ '_help';
+%]
<!-- start [%+ name_and_id %]_unit -->
<div class="unit on-2 columns" id="[% name_and_id %]_unit">
<div class="column span-2" style="[% field_error?'':'display:none;'%]"
id="[% name_and_id %]_error">
<div class="container ui-state-error ui-corner-all ">[% field_error %]</div>
</div>
<div class="fixed column label" id="[% name_and_id _ '_label_column' %]">
<label for="[% params.id || name_and_id %]">
[% params.label || c.l(label).ucfirst %]
[% params.required ? ':&#160;*' : ':' %]
</label>
</div>
<div class="elastic column ">
<div class="container field">
<input type="file" id="[% name_and_id %]"
name="[% name_and_id %]" />
</div>
</div>
<div class="column span-2">
<div class="ui-state-default container help">
[% c.textile(c.l(name_and_id_help)) %]
</div>
</div>
</div><!-- end [%+ name_and_id %]_unit -->
[%+ END %]
Jump to Line
Something went wrong with that request. Please try again.