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

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