def group_popup_submit(self,id=''): g = None if 'group_id' in self.form_result and self.form_result['group_id'] != '0': g = Group.get(c.user.site_id,int(self.form_result['group_id'])) else: g = Group(c.user.site_id) g.name = self.form_result['name'] newtogroup, newtosite = g.add_memberlist(self.form_result['members']) g.save() #return 'newtogroup= %s, \n newtosite=%s' % (newtogroup, newtosite) return redirect_wsave('/groupadmin/popup_view/%s' % g.id)
def viewlist(self,id=0): c.item = None filter = 'all' if 'filter' in request.params: filter = request.params['filter'] c.groups = Group.by_site(c.user.site_id) temp = """ page = 1 if 'page' in request.params: page = int(request.params['page']) c.groups = webhelpers.paginate.Page( Group.by_site(c.user.site_id), page=page,items_per_page=5) ${h.dspager(c.groups)} """ c.groups = h.dspager(c.groups) return render('/group/group_admin.html')
def popup_view(self,id=0): c.item = Group.get(c.user.site_id,id) if not c.item.site_id == c.user.site_id: c.item = None return render('/group/group_popupview.html')
def edit(self,id=0): c.item = Group.get(c.user.site_id,id) if not c.item or not c.item.site_id == c.user.site_id: c.item = None return render('/group/group_edit.html')