Mercurial > p > roundup > code
comparison doc/reference.txt @ 8300:b99e76e76496
Make native date and number elements configurable
Now for Number() and Integer() properties the browser-native number
format can be configured with the use_browser_number_input config item
in seciont [web]. The default is 'yes'. For Date() properties the config
item is use_browser_date_input (also in section [web]) but the default
is 'no'.
In addition when defining Date() properties, these now have a parameter
'display_time' which defaults to 'yes' and a 'format' parameter which
defaults to None. These set defaults for the field() method of the
DateHTMLProperty which have the same parameters (but the display_time
parameter of field() takes a boolean, not 'yes'/'no').
| author | Ralf Schlatterbeck <rsc@runtux.com> |
|---|---|
| date | Wed, 19 Feb 2025 12:38:06 +0100 |
| parents | 2bf0c4e7795e |
| children | 3ba8078843db |
comparison
equal
deleted
inserted
replaced
| 8299:43899d99fc4d | 8300:b99e76e76496 |
|---|---|
| 3068 most types this is a text entry box, but for | 3068 most types this is a text entry box, but for |
| 3069 Booleans it is a | 3069 Booleans it is a |
| 3070 tri-state yes/no/neither selection. This method may take some | 3070 tri-state yes/no/neither selection. This method may take some |
| 3071 arguments: | 3071 arguments: |
| 3072 | 3072 |
| 3073 size (default 30) | 3073 display_time (Date properties only) |
| 3074 Sets the width in characters of the edit field | 3074 By default this uses the display_time paramter of the |
| 3075 Date property (which by default is True) and displays | |
| 3076 date and time for Date properties. You can set this to | |
| 3077 False for displaying only the date. | |
| 3075 | 3078 |
| 3076 format (Date properties only) | 3079 format (Date properties only) |
| 3077 Sets the format of the date in the field - uses the | 3080 Sets the format of the date in the field - uses the |
| 3078 same format string argument as supplied to the | 3081 same format string argument as supplied to the |
| 3079 ``pretty`` method below. If you use this, it will | 3082 ``pretty`` method below. If you use this, it will |
| 3081 useful if you want partial dates. For example using | 3084 useful if you want partial dates. For example using |
| 3082 ``format="%Y-%m"`` with ``type="text"`` will display a | 3085 ``format="%Y-%m"`` with ``type="text"`` will display a |
| 3083 text edit box with the year and month part of your | 3086 text edit box with the year and month part of your |
| 3084 date. | 3087 date. |
| 3085 | 3088 |
| 3089 labelfirst (Boolean properties only) | |
| 3090 place the labels before the radio buttons | |
| 3091 | |
| 3092 popcal (Date properties only) | |
| 3093 Include a link to the JavaScript-based popup calendar | |
| 3094 for date selection. Defaults to off/False when browser | |
| 3095 native dates are in use and on/True otherwise because | |
| 3096 browser native dates support a date popup on most | |
| 3097 browsers. | |
| 3098 | |
| 3099 size (default 30) | |
| 3100 Sets the width in characters of the edit field | |
| 3101 | |
| 3086 type (depends on property type) | 3102 type (depends on property type) |
| 3087 Sets the type property of the input. To change a date | 3103 Sets the type property of the input. To change a date |
| 3088 property field from a native date input to a text | 3104 property field from a native date input to a text |
| 3089 input you would use ``type="text"``. | 3105 input you would use ``type="text"``. For Date properties |
| 3090 | 3106 the type cannot be set by the user and is enforced via |
| 3091 popcal (Date properties only) | 3107 the configuration (if browser native date input should |
| 3092 Include a link to the JavaScript-based popup calendar | 3108 be used). |
| 3093 for date selection. Defaults to off/False since native | |
| 3094 date inputs supply popup calendars. | |
| 3095 | 3109 |
| 3096 y_label, n_label, u_label (Boolean properties only) | 3110 y_label, n_label, u_label (Boolean properties only) |
| 3097 Set the labels for the true/false/undefined | 3111 Set the labels for the true/false/undefined |
| 3098 states. If u_label is defined, it produces a | 3112 states. If u_label is defined, it produces a |
| 3099 tri-state radio button selector. Otherwise, it | 3113 tri-state radio button selector. Otherwise, it |
| 3100 allows selection of true/yes or false/no only. | 3114 allows selection of true/yes or false/no only. |
| 3101 | 3115 |
| 3102 labelfirst (Boolean properties only) | |
| 3103 place the labels before the radio buttons | |
| 3104 | |
| 3105 Other arguments are added as properties directly on the | 3116 Other arguments are added as properties directly on the |
| 3106 input tag. For example:: | 3117 input tag. For example:: |
| 3107 | 3118 |
| 3108 field(size=30, id='myid', required=None) | 3119 field(size=30, id='myid', required=None) |
| 3109 | 3120 |
| 3112 <input id="myid" size="30" required> | 3123 <input id="myid" size="30" required> |
| 3113 | 3124 |
| 3114 Note that using ``None`` as the value results in an | 3125 Note that using ``None`` as the value results in an |
| 3115 attribute without a value. This is useful for boolean | 3126 attribute without a value. This is useful for boolean |
| 3116 properties like ``required``. | 3127 properties like ``required``. |
| 3117 | |
| 3118 field_time (Date properties only) | |
| 3119 Create a browser native input for editing date and time. | |
| 3120 The field method creates an input for editing | |
| 3121 month/day/year (without time). | |
| 3122 | 3128 |
| 3123 rst only on String properties - render the value of the property | 3129 rst only on String properties - render the value of the property |
| 3124 as ReStructuredText (requires the :ref:`Docutils | 3130 as ReStructuredText (requires the :ref:`Docutils |
| 3125 module to be installed separately<install/docutils>`). | 3131 module to be installed separately<install/docutils>`). |
| 3126 | 3132 |
| 3177 argument (default: '%0.3f') and formats the number | 3183 argument (default: '%0.3f') and formats the number |
| 3178 accordingly. If the value can't be converted, '' | 3184 accordingly. If the value can't be converted, '' |
| 3179 is returned if the value is ``None`` otherwise it | 3185 is returned if the value is ``None`` otherwise it |
| 3180 is converted to a string. | 3186 is converted to a string. |
| 3181 | 3187 |
| 3182 popcal This is deprecated with Roundup 2.5 which uses the | 3188 popcal This is deprecated with Roundup 2.5 which either uses the |
| 3183 native HTML5 date input. The native date input | 3189 native HTML5 date input or can generate a date popup with |
| 3184 includes a calendar popup on modern broswers. | 3190 the popcal option of the ``field`` method. The native date |
| 3191 input includes a calendar popup on modern broswers. | |
| 3185 | 3192 |
| 3186 Generate a link to a popup calendar which may be used to | 3193 Generate a link to a popup calendar which may be used to |
| 3187 edit the date field, for example:: | 3194 edit the date field, for example:: |
| 3188 | 3195 |
| 3189 <span tal:replace="structure context/due/popcal" /> | 3196 <span tal:replace="structure context/due/popcal" /> |
| 3191 you still need to include the ``field`` for the property, so | 3198 you still need to include the ``field`` for the property, so |
| 3192 typically you'd have:: | 3199 typically you'd have:: |
| 3193 | 3200 |
| 3194 <span tal:replace="structure context/due/field" /> | 3201 <span tal:replace="structure context/due/field" /> |
| 3195 <span tal:replace="structure context/due/popcal" /> | 3202 <span tal:replace="structure context/due/popcal" /> |
| 3203 | |
| 3204 Since the ``field`` by default already produces a popup | |
| 3205 calendar this use is deprecated. | |
| 3196 | 3206 |
| 3197 menu only on Link and Multilink properties - render a form select | 3207 menu only on Link and Multilink properties - render a form select |
| 3198 list for this property. Takes a number of optional arguments | 3208 list for this property. Takes a number of optional arguments |
| 3199 | 3209 |
| 3200 size | 3210 size |
