示例#1
0
    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")
示例#2
0
    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")
示例#3
0
 def contact(self):
     return render('contact.html')
示例#4
0
 def merch(self):
     return render('merch/merch_home.html')
示例#5
0
 def events(self):
     return render('events/events_home.html')
示例#6
0
 def home(self):
     c.url = url(controller="index", action="kappa")
     return render('home.html')
示例#7
0
 def new(self):
     c.forumid = request.params.get('forumid', '')
     return render('/forums/new.html')
示例#8
0
    def index(self):
        category_q = model.Session.query(model.Category)
        c.categories = category_q.all()

        return render("forums/index.html")
示例#9
0
 def logout(self):
     h.login = False
     return render('/user/logout.html')
示例#10
0
 def notifs(self):
     return render('/user/notification.html')
示例#11
0
 def user_settings(self):
     return render('/user/settings.html')
示例#12
0
 def register(self):
     return render('/user/register.html')
示例#13
0
 def login(self):
     h.login = True
     return render('/user/login.html')