Ejemplo n.º 1
0
    def get(self, cid):
        if cid in STAFF_MAPPING.keys():
            return redirect(url_for('views.staff', cid=cid))
        channel = ChannelModel.query.get(cid)
        query = ChannelModel.get_channel_query(self.language)
        pager = Pagination(bs_version=3, page=self.page,
                           total=channel.articles.count())

        return render_template('www/channel.html',
                               channels=query.all(),
                               channel=channel,
                               language=channel.language,
                               pager=pager)
Ejemplo n.º 2
0
    def get(self, cid):
        channel = ChannelModel.query.get(cid)
        level_id = STAFF_MAPPING.get(cid, None)
        if not level_id:
            return redirect(url_for('views.channel', cid=cid))
        level = LevelModel.query.get(level_id)

        query = ChannelModel.get_channel_query(self.language)
        pager = Pagination(bs_version=3, page=self.page,
                           total=level.all_staff.count())

        return render_template('www/staff.html',
                               channels=query.all(),
                               channel=channel,
                               language=channel.language,
                               pager=pager)