webmcp

changeset 35:81dfcfd960ed

fix cases where container html attrs could not be set
author Daniel Poelzleithner <poelzi@poelzi.org>
date Thu Oct 07 00:28:47 2010 +0200 (2010-10-07)
parents e19b0b5c46ba
children 5380305a3d51
files framework/env/ui/multiselect.lua framework/env/ui/paginate.lua
line diff
     1.1 --- a/framework/env/ui/multiselect.lua	Wed Oct 06 16:14:33 2010 +0200
     1.2 +++ b/framework/env/ui/multiselect.lua	Thu Oct 07 00:28:47 2010 +0200
     1.3 @@ -2,6 +2,7 @@
     1.4  ui.multiselect{
     1.5    name               = name,                -- HTML name ('html_name' is NOT a valid argument for this function)
     1.6    container_attr     = container_attr,      -- extra HTML attributes for the container (div) enclosing field and label
     1.7 +  container2_attr    = container2_attr,     -- extra HTML attributes for the container (div) of the real element (in checkbox case only)
     1.8    attr               = attr,                -- extra HTML attributes for the field
     1.9    label              = label,               -- text to be used as label for the input field
    1.10    label_attr         = label_attr,          -- extra HTML attributes for the label
    1.11 @@ -122,9 +123,9 @@
    1.12              record[args.foreign_name],
    1.13              args.format_options
    1.14            ),
    1.15 -          attr          = { class = "ui_checkbox_div" },
    1.16 +          attr          = args.container2_attr or { class = "ui_checkbox_div" },
    1.17            label_for     = attr.id,
    1.18 -          label_attr    = { class = "ui_checkbox_label" },
    1.19 +          label_attr    = args.label_attr or { class = "ui_checkbox_label" },
    1.20            content_first = true,
    1.21            content       = function()
    1.22              ui.tag{ tag  = "input", attr = attr }
     2.1 --- a/framework/env/ui/paginate.lua	Wed Oct 06 16:14:33 2010 +0200
     2.2 +++ b/framework/env/ui/paginate.lua	Thu Oct 07 00:28:47 2010 +0200
     2.3 @@ -1,10 +1,11 @@
     2.4  --[[--
     2.5  ui.paginate{
     2.6 -  selector = selector,  -- a selector for items from the database
     2.7 -  per_page = per_page,  -- items per page, defaults to 10
     2.8 -  name     = name,      -- name of the CGI get variable, defaults to "page"
     2.9 -  page     = page,      -- directly specify a page, and ignore 'name' parameter
    2.10 -  content = function()
    2.11 +  selector            = selector,        -- a selector for items from the database
    2.12 +  per_page            = per_page,        -- items per page, defaults to 10
    2.13 +  container_attr      = container_attr   -- html attr for the container element
    2.14 +  name                = name,            -- name of the CGI get variable, defaults to "page"
    2.15 +  page                = page,            -- directly specify a page, and ignore 'name' parameter
    2.16 +  content             = function()
    2.17      ...                 -- code block which should be encapsulated with page selection links
    2.18    end
    2.19  }
    2.20 @@ -67,7 +68,7 @@
    2.21      end
    2.22    end
    2.23    ui.container{
    2.24 -    attr = { class = 'ui_paginate' },
    2.25 +    attr = args.container_attr or { class = 'ui_paginate' },
    2.26      content = function()
    2.27        ui.container{
    2.28          attr = { class = 'ui_paginate_head ui_paginate_select' },

Impressum / About Us