-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added equivalent Jinja2 widget templates
- Loading branch information
Showing
20 changed files
with
227 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<div> | ||
<input type="text" id="{{ w.compound_id }}" name="{{ w.name }}" class="{{ w.css_class or '' }}" value="{{ w.strdate or '' }}" /> | ||
<input type="button" id="{{ w.compound_id }}_trigger" class="date_field_button" value="{{ w.button_text }}" /> | ||
<script type="text/javascript">Calendar.setup({ | ||
"inputField": "{{ w.compound_id }}", "showsTime": {{ w.picker_shows_time | lower }}, | ||
"ifFormat": "{{ w.date_format }}", "button": "{{ w.compound_id }}_trigger" | ||
{% for k, v in w.setup_options.items %} | ||
, {{ k }}: {{ isinstance(v, twc.JSSymbol) and (v.src) or '"%s"' % v }} | ||
{% endfor %} | ||
})</script> | ||
</div> |
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,23 @@ | ||
<table {{ w.attrs|xmlattr }} cellpadding="0" cellspacing="1" border="0"> | ||
{% if w.columns %} | ||
<thead> | ||
<tr> | ||
{% for i, col in enumerate(w.columns) %} | ||
<th class="col_{{ i|string }}">{{ col.title }}</th> | ||
{% endfor %} | ||
</tr> | ||
</thead> | ||
{% endif %} | ||
|
||
<tbody> | ||
{% for i, row in enumerate(w.value) %} | ||
<tr class="{{ i%2 and 'odd' or 'even' }}"> | ||
{% for col in w.columns %} | ||
<td {{ | ||
{'align': col.get_option('align', None), | ||
'class': col.get_option('css_class', None)} | xmlattr }}>{{ col.get_field(row) }}</td> | ||
{% endfor %} | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table>\ |
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,4 @@ | ||
<fieldset {{ w.attrs|xmlattr }}> | ||
<legend>{{ w.legend or '' }}</legend> | ||
{{ w.child.display() }} | ||
</fieldset> |
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,14 @@ | ||
<form {{ w.attrs|xmlattr }}> | ||
<span class="error">{{ w.error_msg or '' }}</span> | ||
{% if w.help_msg %} | ||
<div class="help"> | ||
<p> | ||
{{ w.help_msg }} | ||
</p> | ||
</div> | ||
{% endif %} | ||
{{ w.child.display() }} | ||
{% for button in w.buttons %} | ||
{{ button.display() }} | ||
{% endfor %} | ||
</form> |
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 @@ | ||
<table {{ w.attrs|xmlattr }}> | ||
<tr> | ||
{% for col in w.children[0].children_non_hidden %} | ||
<th>{{ col.label | string }}</th> | ||
{% endfor %} | ||
</tr> | ||
{% for row in w.children %} | ||
{{ row.display }} | ||
{% endfor %} | ||
<tr class="error"><td colspan="{{ w.children|length }}" id="{{ w.compound_id or '' }}:error"> | ||
{{ w.error_msg or '' }} | ||
</td></tr> | ||
</table> |
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 @@ | ||
<input {{ w.attrs|xmlattr }}/> |
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 @@ | ||
<span {{ w.attrs|xmlattr }}>{{ w.text }}</span> |
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 @@ | ||
<span>{{ w.value|string }}<input {{ w.attrs|xmlattr }}/></span> |
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 @@ | ||
<a {{ w.attrs|xmlattr }}>{{ w.text }}</a> |
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,18 @@ | ||
<ul {{ w.attrs|xmlattr }}> | ||
{% for c in w.children_hidden %} | ||
{{ c.display() }} | ||
{% endfor %} | ||
{% for c in w.children_non_hidden %} | ||
<li class="{{ loop.index0 % 2 and 'even' or 'odd' }}{{ c|attr(' required') and ' required' or '' }}{{ c.error_msg and ' error' or '' }}" {% if w.hover_help and c.help_text %}title="{{ c.help_text }}"{% endif %} {{ c.container_attrs|xmlattr }}> | ||
<label>{{ c.label or '' }}</label> | ||
{{ c.display() }} | ||
{% if not w.hover_help %}{{ c.help_text or '' }}{% endif %} | ||
<span id="{{ c.compound_id or '' }}:error" class="error">{{ c.error_msg or '' }}</span> | ||
</li> | ||
{% endfor %} | ||
<li class="error"><span id="{{ w.compound_id or '' }}:error" class="error"> | ||
{% for error in w.rollup_errors %} | ||
<p>{{ error }}</p> | ||
{% endfor %} | ||
</span></li> | ||
</ul> |
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 @@ | ||
<input {{ w.attrs|xmlattr }}/> <label for='{{ w.compound_id }}' {{ w.text_attrs|xmlattr }}>{{ w.text }}</label> |
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,18 @@ | ||
<tr {{ w.attrs|xmlattr }}> | ||
{% for c in w.children_non_hidden %} | ||
<td> | ||
{{ c.display() }} | ||
{% if c.error_msg %} | ||
<img src="{{ w.resources.error.link }}" title="{{ c.error_msg }}"/> | ||
{% endif %} | ||
</td> | ||
{% endfor %} | ||
<td> | ||
{% for c in w.children_hidden %} | ||
{{ c.display() }} | ||
{% endfor %} | ||
{% if w.error_msg %} | ||
<img src="{{ w.resources.error.link }}" title="{{ w.error_msg }}"/> | ||
{% endif %} | ||
</td> | ||
</tr> |
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 @@ | ||
<select {{ w.attrs|xmlattr }}> | ||
{% for group, options in w.grouped_options %} | ||
{% if group %} | ||
<optgroup {{ {'label': group}|xmlattr }}> | ||
{% endif %} | ||
{% for attrs, desc in options %} | ||
<option {% if attrs %}{{ attrs|xmlattr }}{% endif %}>{{ desc }}</option> | ||
{% endfor %} | ||
{% if group %} | ||
</optgroup> | ||
{% endif %} | ||
{% endfor %} | ||
</select> |
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,19 @@ | ||
<ul {{ w.attrs|xmlattr }}> | ||
{% for group, opts in w.grouped_options %} | ||
{% if group %} | ||
<li> | ||
<div class="group_header">{{ group }}</div> | ||
<ul> | ||
{% endif %} | ||
{% for attrs, desc in opts %} | ||
<li> | ||
<input {{ attrs|xmlattr }}/> | ||
<label for="{{ attrs['id'] }}">{{ desc }}</label> | ||
</li> | ||
{% endfor %} | ||
{% if group %} | ||
</li> | ||
</ul> | ||
{% endif %} | ||
{% endfor %} | ||
</ul> |
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,17 @@ | ||
<table {{ w.attrs|xmlattr }}> | ||
<tbody> | ||
{% for row in w.options_rows %} | ||
<tr> | ||
{% for attrs, desc in row %} | ||
<td> | ||
<input {{ attrs|xmlattr }} /> | ||
<label for="{{ attrs['id'] }}">{{ desc }}</label> | ||
</td> | ||
{% endfor %} | ||
{% for j in range(w.cols - row|length) %} | ||
<td/> | ||
{% endfor %} | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> |
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,8 @@ | ||
<table {{ w.attrs|xmlattr }}> | ||
{% for attrs, desc in w.options %} | ||
<tr> | ||
<td><input {{ attrs|xmlattr }}/></td> | ||
<td><label for="{{ attrs['id'] }}">{{ desc }}</label></td> | ||
</tr> | ||
{% endfor %} | ||
</table> |
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 @@ | ||
<div> </div> |
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,32 @@ | ||
<table {{ w.attrs|xmlattr }}> | ||
{% for c in w.children_non_hidden %} | ||
<tr class="{{ loop.index0 % 2 and 'even' or 'odd' }}{{ c|attr('required') and ' required' or '' }}{{ c.error_msg and ' error' or '' }}" | ||
{% if w.hover_help and c.help_text %}title="{{ c.help_text }}"{% endif %} | ||
{{ c.container_attrs|xmlattr }} | ||
id="{{ c.compound_id }}:container"> | ||
|
||
{% if c.label %} | ||
<th>{{ c.label }}</th> | ||
{% endif %} | ||
|
||
<td | ||
{% if not c.label %} | ||
colspan="2" | ||
{% endif %}> | ||
{{ c.display() }} | ||
|
||
{% if not w.hover_help %} | ||
{{ c.help_text or '' }} | ||
{% endif %} | ||
<span id="{{ c.compound_id or '' }}:error">{{ c.error_msg or ''}}</span> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
|
||
<tr class="error"><td colspan="2"> | ||
{% for c in w.children_hidden %} | ||
{{ c.display() }} | ||
{% endfor %} | ||
<span id="{{ w.compound_id or '' }}:error">{{ w.error_msg or '' }}</span> | ||
</td></tr> | ||
</table> |
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 @@ | ||
<textarea {{ w.attrs|xmlattr }}>{{ w.value or '' }}</textarea> |
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,30 @@ | ||
<table {{ w.attrs|xmlattr }}> | ||
{% if w.grouped_options[0][0] %} | ||
<thead> | ||
<tr> | ||
{% for group_name, options in w.grouped_options %} | ||
<th>{{ group_name }}</th> | ||
{% endfor %} | ||
</tr> | ||
</thead> | ||
{% endif %} | ||
<tbody> | ||
{% for row in w.options_rows %} | ||
<tr> | ||
{% for attrs, desc in row %} | ||
{% if attrs and desc %} | ||
<td> | ||
<input {{ attrs|xmlattr }} /> | ||
<label for="{{ attrs['id'] }}">{{ desc }}</label> | ||
</td> | ||
{% else %} | ||
<td/> | ||
{% endif %} | ||
{% endfor %} | ||
{% for j in range(w.cols - len(row)) %} | ||
<td/> | ||
{% endfor %} | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> |