def widget_contents(self): """ Main method to create the ajaxselect widget. Calls helper methods and returns the wrapper element containing all associated elements """ #session = current.session #request = current.request wrapper = CAT() # create and add content of SPAN widget = self.create_widget() refreshlink = self.make_refresher(self.wrappername, self.linktable, self.uargs, self.uvars) adder, modal = self.make_adder(self.wrappername, self.linktable) wrapper.components.extend([widget, refreshlink, adder]) # create and add tags/links if multiple select widget if self.multi and (self.lister == 'simple'): taglist = self.make_taglist() elif self.multi and (self.lister == 'editlinks'): taglist = self.make_linklist() else: taglist = '' wrapper.append(taglist) return wrapper, modal
def widget_contents(self): """ Main method to create the ajaxselect widget. Calls helper methods and returns the wrapper element containing all associated elements """ # session = current.session # request = current.request wrapper = CAT() # create and add content of SPAN widget = self.create_widget() refreshlink = self.make_refresher(self.wrappername, self.linktable, self.uargs, self.uvars) adder, modal = self.make_adder(self.wrappername, self.linktable) wrapper.components.extend([widget, refreshlink, adder]) # create and add tags/links if multiple select widget if self.multi and (self.lister == "simple"): taglist = self.make_taglist() elif self.multi and (self.lister == "editlinks"): taglist = self.make_linklist() else: taglist = "" wrapper.append(taglist) return wrapper, modal
def _history_link(row): co = CAT() db = query._db tablas = db._adapter.tables(query) if len(tablas) > 1: for tbl in tablas: #print row.keys() if row.has_key(tbl): if row[tbl].has_key('id'): enl = URL('escuela', 'historial', args=[tbl, row[tbl].id]) co.append(Accion(SPAN('', _class='glyphicon glyphicon-time'), enl, puede_historial, _class="btn btn-default btn-xs", _title=T("Historial {}".format(tbl)))) else: enl = URL('escuela', 'historial', args=[tablas[0], row.id]) co.append(Accion(SPAN('', _class='glyphicon glyphicon-time'), enl, puede_historial, _class="btn btn-default btn-xs", _title=T("Historial {}".format(tablas[0])))) return co
def __init__(self, *components, **attributes): if '_class' in attributes.keys(): attributes['_class'] += ' dropdown-menu' else: attributes['_class'] = 'dropdown-menu' co = CAT() for c in components: co.append(LI(c)) super(MenuDespegable, self).__init__(co, **attributes)
def __init__(self, vistas, *components, **attributes): request = current.request if '_class' in attributes.keys(): attributes['_class'] += ' list_group' else: attributes['_class'] = 'list_group' co = CAT() for c in components: a = 'active' if request.function in vistas else '' if '_class' in c.attributes.keys(): c.attributes['_class'] += ' list-group-item {0}'.format(a) else: c.attributes['_class'] = 'list-group-item {0}'.format(a) c.append(SPAN(SPAN(_class='glyphicon glyphicon-hand-up'), _class='badge')) co.append(c) super(MenuLateral, self).__init__(co, **attributes)
def widget(self): """ Place initial load container for controller to fill. """ wrapper = CAT() # create and add content of SPAN widget = self._create_widget() refreshlink = self._make_refresher(self.wrappername, self.linktable, self.uargs, self.uvars) adder, modal = self._make_adder(self.wrappername, self.linktable) wrapper.components.extend([widget, refreshlink, adder]) # create and add tags/links if multiple select widget if self.multi and (self.lister == "simple"): taglist = self._make_taglist() elif self.multi and (self.lister == "editlinks"): taglist = self._make_linklist() else: taglist = "" wrapper.append(taglist) return wrapper, modal
def widget(self): """ Place initial load container for controller to fill. """ wrapper = CAT() # create and add content of SPAN widget = self._create_widget() refreshlink = self._make_refresher(self.wrappername, self.linktable, self.uargs, self.uvars) adder, modal = self._make_adder(self.wrappername, self.linktable) wrapper.components.extend([widget, refreshlink, adder]) # create and add tags/links if multiple select widget if self.multi and (self.lister == 'simple'): taglist = self._make_taglist() elif self.multi and (self.lister == 'editlinks'): taglist = self._make_linklist() else: taglist = '' wrapper.append(taglist) return wrapper, modal
def __init__(self, accion, menu): c = CAT() if '_class' in accion.attributes.keys(): accion.attributes['_class'] += "btn btn-default" else: accion.attributes['_class'] = "btn btn-default" c.append(accion) c.append(A(SPAN(_class='caret'), **{'_class': 'btn btn-default dropdown-toggle', '_data-toggle':'dropdown', '_aria-haspopup':'true', '_aria-expanded':'false'})) c.append(menu) super(BotonConMenu, self).__init__(c, _class='btn-group')