Exemple #1
0
    def create_entry(self, item):

        entry = Element()
        entry.add_class("entry")

        entry.check = CheckBox()
        entry.check.name = self.name
        entry.check.value = self.is_selected(item)
        entry.check["value"] = self.get_item_value(item)
        entry.append(entry.check)

        entry.label = Element("label")
        entry.label["for"] = entry.check.require_id()
        entry.label.append(self.get_item_label(item))
        entry.append(entry.label)

        return entry
Exemple #2
0
    def create_member_entry(self, member):

        value = member.schema.full_name + "." + member.name

        entry = Element()

        entry.check = CheckBox()
        entry.check["name"] = self.name
        entry.check.require_id()
        entry.check.value = value in self.value
        entry.check["value"] = value
        entry.append(entry.check)

        entry.label = Element("label")
        entry.label["for"] = entry.check["id"]
        entry.label.append(translations(member.schema.name + "." +
                                        member.name))
        entry.append(entry.label)

        return entry