Esempio n. 1
0
    def Render (self):
        # Build buttons
        if self.buttons:
            self.js_props['buttons'] = self._render_buttons_property()

        # Render
        render       = Container.Render (self)
        dialog_props = py2js_dic (self.js_props)
        div_props    = props_to_str (self.props)

        props = {'id':           self.id,
                 'title':        self.title,
                 'content':      render.html,
                 'dialog_props': dialog_props,
                 'div_props':    div_props,
                 'cancel_str':   _("Cancel"),
                 'close_str':    _("Close")}

        html = DIALOG_HTML %(props)
        js   = DIALOG_JS   %(props)

        render.html     = html
        render.js      += js
        render.headers += HEADERS

        return render
Esempio n. 2
0
    def Render (self):
        id      = self.id
        props   = props_to_str (self.props)
        on_id   = self.widget_on.id
        off_id  = self.widget_off.id
        value   = "01"[int(self.active)]

        # Render embedded images
        render_on  = self.widget_on.Render()
        render_off = self.widget_off.Render()
        on_html  = render_on.html
        off_html = render_off.html

        # Render
        render = Widget.Render (self)
        render.html += HTML %(locals())
        render.js   += JS   %(locals())

        # Merge the image renders, just in case
        render_on.html  = ''
        render_off.html = ''
        render += render_on
        render += render_off

        return render
Esempio n. 3
0
    def Render (self):
        render = Container.Render (self)

        render.html = HTML %({'id':      self.id,
                              'content': render.html,
                              'props':   props_to_str(self.props)})
        return render
Esempio n. 4
0
    def Render (self):
        render = Container.Render (self)

        render.html = HTML %({'id':      self.id,
                              'content': render.html,
                              'props':   props_to_str(self.props)})
        return render
Esempio n. 5
0
    def Render(self):
        id = self.id
        props = props_to_str(self.props)
        on_id = self.widget_on.id
        off_id = self.widget_off.id
        value = "01"[int(self.active)]

        # Render embedded widgets
        render_on = self.widget_on.Render()
        render_off = self.widget_off.Render()
        on_html = render_on.html
        off_html = render_off.html

        # Render
        render = Widget.Render(self)
        render.html += HTML % (locals())
        render.js += JS % (locals())

        # Merge the image renders, just in case
        render_on.html = ''
        render_off.html = ''
        render += render_on
        render += render_off

        return render
Esempio n. 6
0
    def Render (self):
        # Render the text field
        html = '<input type="hidden" id="%s" %s/>' %(self.id, props_to_str(self.props))

        render = Widget.Render(self)
        render.html += html

        return render
Esempio n. 7
0
    def Render (self):
        render = Widget.Render (self)

        props = props_to_str (self.props)
        render.html += HTML %({'id':      self.id,
                               'content': self.content,
                               'props':   props})

        return render
Esempio n. 8
0
    def Render(self):
        # Render the text field
        html = '<input type="hidden" id="%s" %s/>' % (self.id,
                                                      props_to_str(self.props))

        render = Widget.Render(self)
        render.html += html

        return render
Esempio n. 9
0
    def Render (self):
        render = self.build_func (**self.params)

        props = {'id':      self.id,
                 'props':   props_to_str(self.props),
                 'content': render.html}

        render.html = HTML %(props)
        return render
Esempio n. 10
0
    def Render (self):
        render = Container.Render (self)

        props = {'id':      self.id,
                 'tag':     self.tag,
                 'props':   props_to_str(self.props),
                 'content': render.html}

        render.html = ENTRY_HTML %(props)
        return render
Esempio n. 11
0
    def Render (self):
        render = Container.Render (self)

        props = {'id':      self.id,
                 'href':    self.href,
                 'props':   props_to_str(self.props),
                 'content': render.html}

        render.html = formater (LINK_HTML, props)
        return render
Esempio n. 12
0
    def Render (self):
       render = Widget.Render(self)

       props = {'id_widget':   self.id,
                'proxy_url':   self._url_local,
                'extra_props': util.props_to_str(self.props)}

       render.html += HTML       %(props)
       render.js   += JAVASCRIPT %(props)
       return render
Esempio n. 13
0
    def Render(self):
        render = self.build_func(**self.params)

        props = {
            'id': self.id,
            'props': props_to_str(self.props),
            'content': render.html
        }

        render.html = HTML % (props)
        return render
Esempio n. 14
0
    def Render (self):
        props = {'id':      self.id,
                 'url':     self.url,
                 'props':   props_to_str(self.props),
                 'content': ''}

        render = Widget.Render (self)
        render.html += HTML %(props)
        render.js   += JS_URL_LOAD %(props)
        render.js   += JS_URL_INIT %(props)
        return render
Esempio n. 15
0
    def Render(self):
        render = Widget.Render(self)

        props = props_to_str(self.props)
        render.html += HTML % ({
            'id': self.id,
            'content': self.content,
            'props': props
        })

        return render
Esempio n. 16
0
    def Render(self):
        id = self.id
        caption = self.caption
        props = props_to_str(self.props)

        html = '<button id="%(id)s" %(props)s>%(caption)s</button>' % (locals())

        render = Widget.Render(self)
        render.html += html

        return render
Esempio n. 17
0
    def Render (self):
        render = Widget.Render (self)

        props = {'id':    self.id,
                 'props': props_to_str (self.props)}

        render.html    += HTML %(props)
        render.js      += PERCENT_INIT_JS %(props)
        render.headers += HEADERS

        return render
Esempio n. 18
0
    def Render (self):
        id      = self.id
        caption = self.caption
        props   = props_to_str (self.props)

        html = '<a id="%(id)s" %(props)s><span>%(caption)s</span></a>' %(locals())

        render = Widget.Render (self)
        render.html += html

        return render
Esempio n. 19
0
        def render_str (o):
            if len(o) == 2:
                name, label = o
                props       = {}
            elif len(o) == 3:
                name, label, props = o

            props_str = props_to_str(props)
            if selected and str(selected) == str(name):
                return '<option value="%s" selected="true" %s>%s</option>' % (name, props_str, label)
            else:
                return '<option value="%s" %s>%s</option>' % (name, props_str, label)
Esempio n. 20
0
    def Render(self):
        render = Container.Render(self)

        props = {
            'id': self.id,
            'tag': self.tag,
            'props': props_to_str(self.props),
            'content': render.html
        }

        render.html = ENTRY_HTML % (props)
        return render
Esempio n. 21
0
    def Render(self):
        id = self.id
        caption = self.caption
        props = props_to_str(self.props)

        html = '<a id="%(id)s" %(props)s><span>%(caption)s</span></a>' % (
            locals())

        render = Widget.Render(self)
        render.html += html

        return render
Esempio n. 22
0
    def Render (self):
        render = Widget.Render (self)

        props = {'id':    self.id,
                 'value': self.value,
                 'props': props_to_str (self.props)}

        render.html    += HTML %(props)
        render.js      += PERCENT_INIT_JS %(props)
        render.headers += HEADERS

        return render
Esempio n. 23
0
    def Render(self):
        render = Widget.Render(self)

        props = {
            'id_widget': self.id,
            'proxy_url': self._url_local,
            'extra_props': util.props_to_str(self.props)
        }

        render.html += HTML % (props)
        render.js += JAVASCRIPT % (props)
        return render
Esempio n. 24
0
    def Render(self):
        id = self.id
        caption = self.caption
        props = props_to_str(self.props)

        html = '<button id="%(id)s" %(props)s>%(caption)s</button>' % (
            locals())

        render = Widget.Render(self)
        render.html += html

        return render
Esempio n. 25
0
    def Render(self):
        render = Container.Render(self)

        if self.href:
            href = 'href="%s"' % (self.href)
        else:
            href = ""

        props = {"id": self.id, "href": href, "props": props_to_str(self.props), "content": render.html}

        render.html = formatter(LINK_HTML, props)
        return render
Esempio n. 26
0
        def render_list(o):
            if len(o) == 2:
                name, options = o
                props = {}
            elif len(o) == 3:
                name, options, props = o

            props_str = props_to_str(props)
            txt = '<optgroup label="%s" %s>' % (name, props_str)
            for o in options:
                txt += render_str(o)
            txt += '</optgroup>'
            return txt
Esempio n. 27
0
    def Render(self):
        props = {
            'id': self.id,
            'url': self.url,
            'props': props_to_str(self.props),
            'content': ''
        }

        render = Widget.Render(self)
        render.html += HTML % (props)
        render.js += JS_URL_LOAD % (props)
        render.js += JS_URL_INIT % (props)
        return render
Esempio n. 28
0
        def render_list (o):
            if len(o) == 2:
                name, options = o
                props       = {}
            elif len(o) == 3:
                name, options, props = o

            props_str = props_to_str(props)
            txt = '<optgroup label="%s" %s>' %(name, props_str)
            for o in options:
                txt += render_str (o)
            txt += '</optgroup>'
            return txt
Esempio n. 29
0
        def render_str(o):
            if len(o) == 2:
                name, label = o
                props = {}
            elif len(o) == 3:
                name, label, props = o

            props_str = props_to_str(props)
            if selected and str(selected) == str(name):
                return '<option value="%s" selected="true" %s>%s</option>' % (
                    name, props_str, label)
            else:
                return '<option value="%s" %s>%s</option>' % (name, props_str,
                                                              label)
Esempio n. 30
0
    def Render (self):
        render = Container.Render (self)

        if self.href:
            href = 'href="%s"' %(self.href)
        else:
            href = ''

        props = {'id':      self.id,
                 'href':    href,
                 'props':   props_to_str(self.props),
                 'content': render.html}

        render.html = formatter (LINK_HTML, props)
        return render
Esempio n. 31
0
    def Render(self):
        render = Container.Render(self)

        if self.href:
            href = 'href="%s"' % (self.href)
        else:
            href = ''

        props = {
            'id': self.id,
            'href': href,
            'props': props_to_str(self.props),
            'content': render.html
        }

        render.html = formatter(LINK_HTML, props)
        return render
Esempio n. 32
0
    def Render(self):
        render = Container.Render(self)

        render.html = HTML % ({"id": self.id, "content": render.html, "props": props_to_str(self.props)})
        return render