Skip to content

Instantly share code, notes, and snippets.

@MattCheely
Created July 31, 2012 21:15
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save MattCheely/3220634 to your computer and use it in GitHub Desktop.
Template inheritance for form handling
<div id="{{$fieldId}}{{/fieldId}}" class="{{#required}}required{{/required}} lulu-datepicker field {{$fieldClass}}{{/fieldClass}}">
<label for="{{$id}}{{/id}}">
{{$label}}{{/label}}
</label>
<input type="text" id="{{$id}}{{/id}}" name="{{name}}" value="{{$value}}{{value}}{{/value}}" disabled />
<a href="#">
<img src="{{application.shared.imgRoot}}/cal01.png" alt="{{$clickText}}{{#i18n}}global.datepicker.clickToSelect{{/i18n}}{{/clickText}}" />
</a>
<div class="description">{{dateFormat}}</div>
<ul class="errors">
{{#errors}}
<li class="error">{{.}}</li>
{{/errors}}
</ul>
</div>
{{#remitForm}}
<form action="{{application.root}}/portal/remittance-custom-report" method="post">
{{#hasErrors}}
<ul class="errors">
{{#globalErrors}}
<li class="error">{{.}}</li>
{{/globalErrors}}
</ul>
{{/hasErrors}}
<div id="dateRange" class="section">
<h2>
{{#i18n}}remittanceCustomReport.dateRange.header{{/i18n}}
</h2>
<fieldset class="radio-list" id="dateRangeFieldset">
<legend class="screenreader">
{{#i18n}}remittanceCustomReport.dateRange.fieldset.header{{/i18n}}
</legend>
{{#dateRange}}
{{< shared/prototypes/form/radioField.html}}
{{$id}}dateRange{{/id}}
{{/ shared/prototypes/form/radioField.html}}
{{/dateRange}}
{{#dateRangeCustomStart}}
{{< shared/prototypes/form/datepicker.html}}
{{$id}}dateRangeCustomStart{{/id}}
{{$label}}
{{#i18n}}remittanceCustomReport.dateRange.custom.startDate{{/i18n}}
{{/label}}
{{$clickText}}
{{#i18n}}remittanceCustomReport.clickStartDate{{/i18n}}
{{/clickText}}
{{/ shared/prototypes/form/datepicker.html}}
{{/dateRangeCustomStart}}
{{#dateRangeCustomEnd}}
{{< shared/prototypes/form/datepicker.html}}
{{$id}}dateRangeCustomEnd{{/id}}
{{$label}}
{{#i18n}}remittanceCustomReport.dateRange.custom.endDate{{/i18n}}
{{/label}}
{{$clickText}}
{{#i18n}}remittanceCustomReport.clickEndDate{{/i18n}}
{{/clickText}}
{{/ shared/prototypes/form/datepicker.html}}
{{/dateRangeCustomEnd}}
</fieldset>
</div>
{{! ...Redundant content removed... }}
</form>
{{/remitForm}}
<div id="{{$fieldId}}{{/fieldId}}" class="{{#required}}required{{/required}} control field {{$fieldClass}}{{/fieldClass}}">
{{#options}}
<div class="option {{#selected}}checked{{/selected}}">
<span class="control">
<input id="{{$id}}{{/id}}_{{value}}" name="{{name}}" value="{{value}}" {{#selected}}checked{{/selected}} type="radio" />
</span>
<label for="{{$id}}{{/id}}_{{value}}">
{{label}}
</label>
</div>
{{/options}}
<ul class="errors">
{{#errors}}
<li class="error">{{.}}</li>
{{/errors}}
</ul>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment