def render(self):
        out = ''
        out += self.rendernote(self.note)

        for i in self.inputs:
            if i.is_hidden():
                out += '%s\n' % i.render()
            else:
                out += i.group_start() + "\n"
                out += i.group_title() + "\n"
                if i.pre:
                    out += '<p class="form-text text-muted">%s</p>' % utils.safeunicode(
                        i.pre)
                out += i.render() + "\n"
                if i.note:
                    out += '<div class="form-control-feedback">%s</div>' % net.websafe(
                        i.note)
                if i.post and len(i.post) > 60:
                    out += '<p class="form-text text-muted">%s</p>' % utils.safeunicode(
                        i.post)
                elif i.post:
                    out += '<small class="text-muted">%s</small>' % utils.safeunicode(
                        i.post)
                out += i.group_end() + "\n"

        return out
Beispiel #2
0
    def render(self):
        out = ''
        out += self.rendernote(self.note)
        out += '<table class="form">\n'
        
        for input_ in self.inputs:
            html = utils.safeunicode(input_.pre) + input_.render() + \
                    self.rendernote(input_.note) + \
                    utils.safeunicode(input_.post)

            if input_.is_hidden():
                out += '    <tr style="display: none;">'
                out += '<th></th><td>%s</td></tr>\n' % (html)
            else: 
                out += '<tr class="blank_row"><td colspan="2"></td></tr>'
                out += '    <tr>' #start row
                
                #header on the left
                out += '    <td class="question"><label for="%s">' % \
                        input_.id 
                out += '%s</td>' % net.websafe(input_.description)

                #content on the right
                out += '<td><div style="float:left;">%s</div></td></tr>' % html
                out += '<tr class="blank_row_ruler"><td colspan="2"></td></tr>'

        out += '</table>'
        return out
 def render(self):
     out= ''
     out+= '<fieldset>\n'
     for i in self.inputs:
         html = utils.safeunicode(i.pre) + i.render() + self.rendernote(i.note) + utils.safeunicode(i.post)
         out += '<div class="pure-control-group" id="%s_div">\n' % (i.id.rstrip(':'))
         out += '    <label for="%s">%s</label>\n' % (i.id, i.id)
         out += '    %s</div>\n' % (html)
     out+= '</fieldset>\n'
     return out
Beispiel #4
0
def render(self):
		out = ''
		out += self.rendernote(self.note)
		out += '<div>'
		for i in self.inputs:
				html = i.render() + self.rendernote(i.note)
				out += '%s<div>%s\t%s</div>%s' % (utils.safeunicode(i.pre),
								net.websafe(i.description) ,
								html,
								utils.safeunicode(i.post)
								)
		out += "</div>\n"
		return out
Beispiel #5
0
    def render(self):
        out = ""
        out += self.rendernote(self.note)

        for i in self.inputs:
            html = utils.safeunicode(i.pre) + i.render() + self.rendernote(i.note) + utils.safeunicode(i.post)
            if i.is_hidden():
                out += '    <tr style="display: none;"><th></th><td>%s</td></tr>\n' % (html)
            else:
                out += '    <div class="form-group"><label for="%s">%s</label>%s</div>\n' % (
                    i.id,
                    net.websafe(i.description),
                    html,
                )
        out += ""
        return out
Beispiel #6
0
    def render(self):
    #out = ''
    #out += self.rendernote(self.note)
    #out += '<table>\n'
	    out = '<div id="form">'
	    
	    for i in self.inputs:
	        html = (utils.safeunicode(i.pre) + i.render() 
	        	+ self.rendernote(i.note) + utils.safeunicode(i.post))
	        #if i.is_hidden():
	        #    out += '    <tr style="display: none;"><th></th><td>%s</td></tr>\n' % (html)
	        #else:
	            #out += '    <tr><th><label for="%s">%s</label></th><td>%s</td></tr>\n' % (i.id, net.websafe(i.description), html)

	        #to remove the label remove first %s and i.id !!
	        out += ('<div id="%s_div"> %s %s</div>' % 
	        	(i.id, net.websafe(i.description), html))
	    #out += "</table>"
	    out += "</div>"
	    return out	
Beispiel #7
0
    def render(self):
        #out = ''
        #out += self.rendernote(self.note)
        #out += '<table>\n'
        out = '<div id="form">'

        for i in self.inputs:
            html = (utils.safeunicode(i.pre) + i.render() +
                    self.rendernote(i.note) + utils.safeunicode(i.post))
            #if i.is_hidden():
            #    out += '    <tr style="display: none;"><th></th><td>%s</td></tr>\n' % (html)
            #else:
            #out += '    <tr><th><label for="%s">%s</label></th><td>%s</td></tr>\n' % (i.id, net.websafe(i.description), html)

            #to remove the label remove first %s and i.id !!
            out += ('<div id="%s_div"> %s %s</div>' %
                    (i.id, net.websafe(i.description), html))
        #out += "</table>"
        out += "</div>"
        return out
Beispiel #8
0
	def render(self):
		"""
		# with <div> 
		out = '<div id="form">'
		for i in self.inputs:
			html = (utils.safeunicode(i.pre) + i.render() 
			+ self.rendernote(i.note) + utils.safeunicode(i.post))
			out += ('<div id="%s_div"> %s %s</div>' % 
				(i.id, net.websafe(i.description), html))
		out += "</div>"
		return out
		"""
		#without <div>
		out = ''
		for i in self.inputs:
			html = (utils.safeunicode(i.pre) + i.render() 
			+ self.rendernote(i.note) + utils.safeunicode(i.post))
			out += ('%s %s' % (net.websafe(i.description), html))
		#out += "</div>"
		return out
		
Beispiel #9
0
 def __unicode__(self):
     return safeunicode(self._str())