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(') ')
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(') ')
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')))
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)
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
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
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
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)