Ejemplo n.º 1
0
 def render_firstTopic(self, ctx, data):
     d = self.data
     def sendReplyForm(client):
         current = d.get('pid')
         client.append('reply_%s' % current, QuickForm(d))
         
     if d:
         ctx.tag.fillSlots('quote', liveevil.handler(sendReplyForm))
         ctx.tag.fillSlots('permalink', url.root.clear().child('topic').child(d.get('pid')))
         ##
         fillReply(ctx, d)
         ##
         return ctx.tag
     return ctx.tag.clear()["Sorry, this page is not available yet"]
Ejemplo n.º 2
0
    def render_reply(self, ctx, data):
        def sendReplyForm(client):
            current = data.get('pid')
            client.append('reply_%s' % current, QuickForm(data))

        ctx.tag.fillSlots('progression', self.start)
        ctx.tag.fillSlots('ptitle', data.get('ptitle'))
        ctx.tag.fillSlots('quote', liveevil.handler(sendReplyForm))
        ctx.tag.fillSlots('permalink', url.root.clear().child('post').child(data.get('pid')))
        ##
        fillReply(ctx, data)
        ##
        self.start = self.start + 1
        #  margin-left:10px  margin-left:20px  margin-left:30px con un
        #  max(x, 40)
        indent_level = data.get('indent_level')
        return t.div(style="margin-left: %spx" % min(indent_level*10, 40))[ctx.tag]