예제 #1
0
파일: home.py 프로젝트: ctoscano/pluma
    def __init__(self, context, contributions):
        self.contributions = contributions
        super(Home, self).__init__(context, _('title_home'))

        if self.c.user.is_authenticated():
            self.body.add('hello %s ' % self.c.user.username)
            self.body.add(new.a(href=self.c.get_url('inbox')
                                ).add('Inbox'))
            self.body.add(new.a(href=self.c.get_url('compose')
                            ).add('compose'))
            self.body.add(new.a(href=self.c.get_url('drafts')
                            ).add('drafts'))
            self.body.add(new.a(href=self.c.get_url('signout')
                            ).add('Sign Out'))
        else:
            self.body.add(new.a(href=self.c.get_url('signup')
                            ).add('Sign Up'))
            self.body.add(new.a(href=self.c.get_url('signin')
                            ).add('Sign In'))
        
        table = VerticalTable()
        self.body.add(table)
        
        for doc in self.contributions:
            p = new.p
            table.add(p)
            a = new.a(href=self.c.get_url('doc', id=doc.contribution)).add(doc.title)
            p.add(a)
            p.add(' (')
            a = new.a(href=self.c.get_url('edit', id=doc.contribution)).add('edit')
            p.add(a)
            p.add(') ')
예제 #2
0
    def __init__(self, context, contributions):
        self.contributions = contributions
        super(Home, self).__init__(context, _('title_home'))

        if self.c.user.is_authenticated():
            self.body.add('hello %s ' % self.c.user.username)
            self.body.add(new.a(href=self.c.get_url('inbox')).add('Inbox'))
            self.body.add(new.a(href=self.c.get_url('compose')).add('compose'))
            self.body.add(new.a(href=self.c.get_url('drafts')).add('drafts'))
            self.body.add(
                new.a(href=self.c.get_url('signout')).add('Sign Out'))
        else:
            self.body.add(new.a(href=self.c.get_url('signup')).add('Sign Up'))
            self.body.add(new.a(href=self.c.get_url('signin')).add('Sign In'))

        table = VerticalTable()
        self.body.add(table)

        for doc in self.contributions:
            p = new.p
            table.add(p)
            a = new.a(href=self.c.get_url('doc', id=doc.contribution)).add(
                doc.title)
            p.add(a)
            p.add(' (')
            a = new.a(
                href=self.c.get_url('edit', id=doc.contribution)).add('edit')
            p.add(a)
            p.add(') ')
예제 #3
0
    def __init__(self, context):
        super(SignUp, self).__init__(context, _('title_home'))

        form = new.form(method='POST')
        table = VerticalTable()
        form.add(table)
        self.body.add(form)

        table.add(csrf_token(self.c.request))
        table.add(new.input(name='username', value='username', type='text'))
        table.add(new.input(name='password', value='password',
                            type='password'))
        table.add(new.button(type='submit').add(_('Sign Up')))
예제 #4
0
파일: signup.py 프로젝트: ctoscano/pluma
    def __init__(self, context):
        super(SignUp, self).__init__(context, _('title_home'))

        form = new.form(method='POST')
        table = VerticalTable()
        form.add(table)
        self.body.add(form)
        
        table.add(csrf_token(self.c.request))
        table.add(new.input(name='username', value='username', type='text'))
        table.add(new.input(name='password', value='password', type='password'))
        table.add(new.button(type='submit').add(_('Sign Up')))
예제 #5
0
    def __init__(self, context, contributions):
        self.contributions = contributions
        super(Drafts, self).__init__(context, _('title_drafts'))

        table = VerticalTable()
        self.center.add(table)

        for doc in self.contributions:
            p = new.p
            table.add(p)
            if hasattr(doc, 'contribution') and doc.contribution:
                url = self.c.get_url('edit', id=doc.contribution)
            else:
                url = self.c.get_url('draft', id=doc._id)
            a = new.a(href=url).add(doc.title)
            p.add(a)
예제 #6
0
파일: drafts.py 프로젝트: ctoscano/pluma
    def __init__(self, context, contributions):
        self.contributions = contributions
        super(Drafts, self).__init__(context, _('title_drafts'))

        table = VerticalTable()
        self.center.add(table)
        
        for doc in self.contributions:
            p = new.p
            table.add(p)
            if hasattr(doc, 'contribution') and doc.contribution:
                url = self.c.get_url('edit', id=doc.contribution)
            else:
                url = self.c.get_url('draft', id=doc._id)
            a = new.a(href=url).add(doc.title)
            p.add(a)
예제 #7
0
파일: inbox.py 프로젝트: ctoscano/pluma
 def center(self):
     if self._center is None:
         super(Inbox, self).center
         table = VerticalTable()
         self._center.add(table)
         
         for doc in self.contributions:
             p = new.p
             table.add(p)
             a = new.a(href=self.c.get_url('inbox_doc', id=doc.contribution)).add(doc.title)
             p.add(a)
             p.add(' (')
             a = new.a(href=self.c.get_url('edit', id=doc.contribution)).add('edit')
             p.add(a)
             p.add(') ')
     return self._center
예제 #8
0
    def left(self):
        if self._left is None:
            super(WorkPage, self).left

            table = VerticalTable()
            self._left.add(table)
            table.add(new.a(href=self.c.get_url('inbox')).add('Inbox'))
            table.add(new.a(href=self.c.get_url('compose')).add('compose'))
            table.add(new.a(href=self.c.get_url('drafts')).add('drafts'))
        return self._left
예제 #9
0
    def center(self):
        if self._center is None:
            super(Inbox, self).center
            table = VerticalTable()
            self._center.add(table)

            for doc in self.contributions:
                p = new.p
                table.add(p)
                a = new.a(
                    href=self.c.get_url('inbox_doc', id=doc.contribution)).add(
                        doc.title)
                p.add(a)
                p.add(' (')
                a = new.a(href=self.c.get_url('edit',
                                              id=doc.contribution)).add('edit')
                p.add(a)
                p.add(') ')
        return self._center
예제 #10
0
파일: app.py 프로젝트: ntoscano/pluma
def info(request):
    from slique.html.table import VerticalTable
    table = VerticalTable()
    table.add(request.environ)
    table.nextRow()
    table.add(request.path_info)
    table.nextRow()
    table.add(request.path)
    
    return HttpResponse(table)
예제 #11
0
def info(request):
    from slique.html.table import VerticalTable
    table = VerticalTable()
    table.add(request.environ)
    table.nextRow()
    table.add(request.path_info)
    table.nextRow()
    table.add(request.path)

    return HttpResponse(table)