comparison default/input/xmlui.html @ 107:eabfb53f7777

input(xmlui): follow changes for OnClick data object in backend
author Goffi <goffi@goffi.org>
date Wed, 24 Jan 2018 09:14:12 +0100
parents cc36a5b990ab
children
comparison
equal deleted inserted replaced
106:65d41e16d1e0 107:eabfb53f7777
78 {% endfor %} 78 {% endfor %}
79 </tr> 79 </tr>
80 </thead> 80 </thead>
81 <tbody> 81 <tbody>
82 {% for xmlui in xmlui_items %} 82 {% for xmlui in xmlui_items %}
83 {% set link=on_click.formatUrl(xmlui.widget_value) if on_click.url else none %} 83 {% set link=on_click.formatUrl(item=xmlui.widget_value) if on_click.url else none %}
84 <tr {{ {'class': xmlui|xmlui_class(tr_class_fields)}|xmlattr }}> 84 <tr {{ {'class': xmlui|xmlui_class(tr_class_fields)}|xmlattr }}>
85 85
86 {% for name,label in fields %} 86 {% for name,label in fields %}
87 <td {{ {'class': 'td_'+name}|xmlattr }}> 87 <td {{ {'class': 'td_'+name}|xmlattr }}>
88 {% for value in xmlui.widgets[name].values %} 88 {% for value in xmlui.widgets[name].values %}
105 @param xmlui_items(iterable[unicode]): list of xmlui to show 105 @param xmlui_items(iterable[unicode]): list of xmlui to show
106 @param fields(tuple[unicode,unicode]): fields to show (name, label) 106 @param fields(tuple[unicode,unicode]): fields to show (name, label)
107 @param formatters(dict): dictionary of templates to format values: 107 @param formatters(dict): dictionary of templates to format values:
108 field_name => template 108 field_name => template
109 if no formatter is set (or None is used) for a field, it will be used unmodified. 109 if no formatter is set (or None is used) for a field, it will be used unmodified.
110 current xmlui items will be set as "item" key 110 current xmlui items will be set as "item" key for the template
111 @param item_class_fields(iterable[unicode]): name of fields to use as class 111 @param item_class_fields(iterable[unicode]): name of fields to use as class
112 class will be "{name}_{value}" where name is field name, and value field value 112 class will be "{name}_{value}" where name is field name, and value field value
113 all lowercase/stripped 113 all lowercase/stripped
114 @param on_click(data_objects.OnClick): thing to do when clicking on a row 114 @param on_click(data_objects.OnClick): thing to do when clicking on a row
115 #} 115 #}
120 {% set on_click = {} %} 120 {% set on_click = {} %}
121 {% endif %} 121 {% endif %}
122 <ul class="xmlui_list"> 122 <ul class="xmlui_list">
123 {% for xmlui in xmlui_items %} 123 {% for xmlui in xmlui_items %}
124 <li> 124 <li>
125 {% set link=on_click.formatUrl(xmlui.widget_value) if on_click.url else none %} 125 {% set link=on_click.formatUrl(item=xmlui.widget_value) if on_click.url else none %}
126 <a {{ {'class': xmlui|xmlui_class(item_class_fields), 126 <a {{ {'class': xmlui|xmlui_class(item_class_fields),
127 'href':link}|xmlattr }}> 127 'href':link}|xmlattr }}>
128 {% for name,label in fields %} 128 {% for name,label in fields %}
129 <span {{ {'class': 'xmlui_field__'+name}|xmlattr }}> 129 <span {{ {'class': 'xmlui_field__'+name}|xmlattr }}>
130 {% for label in xmlui.widgets.get(name, {}).labels %} 130 {% for label in xmlui.widgets.get(name, {}).labels %}