def viewforum(self, id): forum_q = model.Session.query(model.Forum).filter_by(id=id) if len(forum_q.all()) == 0: abort(404) c.forum = forum_q.first() thread_q = model.Session.query(model.Page).filter_by(forumid=id) #search c.search_text = request.params.get('search', '') if not c.search_text == '': thread_q = thread_q.filter( model.page_table.c.title.like(u'%' + c.search_text + u'%')) thread_q = thread_q.order_by(model.page_table.c.posted.desc()) c.paginator = paginate.Page( thread_q.all(), page=int(request.params.get('page', 1)), items_per_page=10, ) c.empty = False if len(thread_q.all()) == 0: c.empty = True c.active = request.params.get('viewtype', 'new') return render("forums/viewforum.html")
def view(self, id): page_q = model.Session.query(model.Page).filter_by(id=id) if len(page_q.all()) == 0: abort(404) c.page = page_q.first() comment_q = model.Session.query(model.Comment).filter_by(pageid=id) c.comments = comment_q.all() c.top_comments = comment_q.filter_by(ownerid=None).order_by( model.comment_table.c.created.desc()).all() c.paginator = paginate.Page( c.top_comments, page=int(request.params.get('page', 1)), items_per_page=10, ) c.active = request.params.get('viewtype', 'new') return render("forums/page.html")
def contact(self): return render('contact.html')
def merch(self): return render('merch/merch_home.html')
def events(self): return render('events/events_home.html')
def home(self): c.url = url(controller="index", action="kappa") return render('home.html')
def new(self): c.forumid = request.params.get('forumid', '') return render('/forums/new.html')
def index(self): category_q = model.Session.query(model.Category) c.categories = category_q.all() return render("forums/index.html")
def logout(self): h.login = False return render('/user/logout.html')
def notifs(self): return render('/user/notification.html')
def user_settings(self): return render('/user/settings.html')
def register(self): return render('/user/register.html')
def login(self): h.login = True return render('/user/login.html')