Issue 2550808
Created on 2013-04-25 01:59 by rouilj, last changed 2013-10-08 13:43 by rouilj.
msg4857 |
Author: [hidden] (rouilj) |
Date: 2013-04-25 01:59 |
|
The current code generates dual valued radio buttons:
o Yes o No
but clicking on the "Yes" or "No" labels doesn't select the
corresponding button. Also there is no way to call the field to
generate a trivalue "Yes", "No", "Unspecified" set of radio buttons,
nor can I produce:
Yes o No o
(labels before the button)
I would like to see four things:
1) a way to override the "Yes" and "No" labels that are created by
default from the templating code. So I can have True/False,
Enabled/Disabled, Spring/Fall, Red/Green etc.
2) The label should be associated with each radiobutton and when
the label is clicked on the radiobutton should be selected.
3) An alternate display mode with the labels before the radiobuttons
4) A way to have the field code generate a trivalue selection
(e.g. for use in search)
I propose the following:
1) new arguments to the field method:
t_label, f_label, u_label (true, false, unknown)
set to None by default. When these are set they will be used as the
labels for the corresponding radio button. These definitions can
include html such as:
y_label='<label for=private_yes class=sublabel>Enabled</label>'
n_label='<label for=private_no class=sublabel>Disabled</label>'
that with other the changes below will make the labels active
targets to select a radiobutton.
If the u_label is not None, a trivalued radio button will be
created. There is no default value for the u_label unlike for
y_label or n_label, the user will have to specify something like:
u_label="<label for=private_unk class=sublabel>Don't care</label>"
2) new argument to the field function labelfirst=False by default. If
set to true, the labels are put before the radiobutton.
3) the generated radiobuttons will get an html id property of:
<propertyname>_no, <propertyname>_yes, <propertyname>_unk
so that labels can be attached to them. Also the generated labels
(if not overridden in the call to field) will have the class
"rblabel" (radio button label) to allow css styling.
|
msg4858 |
Author: [hidden] (rouilj) |
Date: 2013-04-25 03:37 |
|
Committed to head for people to look at.
|
msg4860 |
Author: [hidden] (schlatterbeck) |
Date: 2013-04-25 15:31 |
|
On Thu, Apr 25, 2013 at 01:59:40AM +0000, John Rouillard wrote:
>
> I propose the following:
Nice.
Seems you've already implemented this?
Thanks
Ralf
|
msg4863 |
Author: [hidden] (rouilj) |
Date: 2013-04-25 20:09 |
|
> Seems you've already implemented this?
Yes. I was opening tickets for work I have done so that I can
commit the work.
This work was done to the roundup core as part of the
(re)development of my sysadmin tracker.
The tri-value support is a little incomplete (e.g. should there
be an option to move unknown after yes/no it currently is before),
but until I have a more complete use case(s) for it, it can stay as
implemented.
-- rouilj
|
|
Date |
User |
Action |
Args |
2013-10-08 13:43:58 | rouilj | set | status: pending -> closed |
2013-05-11 15:48:46 | pcaulagi | set | nosy:
+ pcaulagi |
2013-04-25 20:09:54 | rouilj | set | messages:
+ msg4863 |
2013-04-25 15:31:06 | schlatterbeck | set | nosy:
+ schlatterbeck messages:
+ msg4860 title: BooleanHTMLProperty::field method html needs to be more accessible. -> BooleanHTMLProperty::field method html needs to be more accessible. |
2013-04-25 07:02:22 | ber | set | nosy:
+ ber |
2013-04-25 03:37:53 | rouilj | set | status: new -> pending messages:
+ msg4858 |
2013-04-25 01:59:40 | rouilj | create | |
|