Ignore:
Timestamp:
21 Jul 2012, 08:59:33 (12 years ago)
Author:
Henrik Bettermann
Message:

Show required fields bold and extra fields italic.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/browser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py

    r9032 r9033  
    883883            available_fields = []
    884884            for key in iface_fields.keys():
    885                 iface_fields[key] = iface_fields[key].__class__.__name__
     885                iface_fields[key] = (iface_fields[key].__class__.__name__,
     886                    iface_fields[key].required)
    886887            for value in x.available_fields:
    887888                available_fields.append(
    888889                    dict(f_name=value,
    889                          f_type=iface_fields.get(value, 'None')))
     890                         f_type=iface_fields.get(value, (None, False))[0],
     891                         f_required=iface_fields.get(value, (None, False))[1]
     892                         )
     893                    )
    890894            available_fields = sorted(available_fields, key=lambda k: k['f_name'])
    891895            importer_props.append(
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/datacenteruploadpage.pt

    r9032 r9033  
    2626    <td>
    2727        <span tal:repeat="field importer/fields">
    28             <span tal:replace="field/f_name"></span>
    29             (<span tal:replace="field/f_type"></span>),
     28            <tal:schemafield condition="field/f_type">
     29              <tal:notrequired condition="not:field/f_required">
     30                <span tal:replace="field/f_name"></span>
     31                (<span tal:replace="field/f_type"></span>)
     32              </tal:notrequired>
     33              <tal:required condition="field/f_required">
     34                <strong>
     35                  <span tal:replace="field/f_name"></span>
     36                  (<span tal:replace="field/f_type"></span>)
     37                </strong>
     38              </tal:required>
     39            </tal:schemafield>
     40            <tal:extrafield condition="not:field/f_type">
     41              <i tal:content="field/f_name"></i>
     42            </tal:extrafield>,
    3043        </span>
    3144    </td>
Note: See TracChangeset for help on using the changeset viewer.