Roundup Tracker - Issues

Message4857

Author rouilj
Recipients rouilj
Date 2013-04-25.01:59:39
Message-id <1366855180.05.0.201190938241.issue2550808@psf.upfronthosting.co.za>
In-reply-to
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.
History
Date User Action Args
2013-04-25 01:59:40rouiljsetrecipients: + rouilj
2013-04-25 01:59:40rouiljsetmessageid: <1366855180.05.0.201190938241.issue2550808@psf.upfronthosting.co.za>
2013-04-25 01:59:40rouiljlinkissue2550808 messages
2013-04-25 01:59:39rouiljcreate