示例#1
0
    def get(self, article_id):
        try:
            article = controller.get_article(self, int(article_id))
            revisions = controller.get_revisions(self, int(article_id))
        except (TypeError, ValueError, simpleeditions.NotFoundError):
            self.not_found()
            return

        self.render('article_revisions.html',
            article=article,
            revisions=revisions)
示例#2
0
    def get(self, article_id):
        try:
            article = controller.get_article(self, int(article_id))
            revisions = controller.get_revisions(self, int(article_id))
        except (TypeError, ValueError, simpleeditions.NotFoundError):
            self.not_found()
            return

        self.render('article_manage_revisions.html',
                    article=article,
                    revisions=revisions)
示例#3
0
    def get(self, article_id):
        try:
            article = controller.get_article(self, int(article_id), True)
        except (TypeError, ValueError, simpleeditions.NotFoundError):
            self.not_found()
            return

        user = self.user_obj
        self.render('article_edit.html',
            article=article,
            user_can_edit=user and (user.key().id() == article['user_id'] or
                                    user.can('edit-any-article')))
示例#4
0
    def get(self, article_id):
        try:
            article = controller.get_article(self, int(article_id), True)
        except (TypeError, ValueError, simpleeditions.NotFoundError):
            self.not_found()
            return

        user = self.user_obj
        self.render('article_manage_edit.html',
                    article=article,
                    user_can_edit=user
                    and (user.key().id() == article['user_id']
                         or user.can('edit-any-article')))
示例#5
0
    def get(self, article_id):
        try:
            article = controller.get_article(self, int(article_id))
        except (TypeError, ValueError, simpleeditions.NotFoundError):
            self.not_found()
            return

        files = controller.get_files(self, int(article_id))

        user = self.user_obj
        self.render('article_manage_files.html',
            article=article,
            files=files,
            user_can_upload=user and user.can('upload-files') and (
                user.key().id() == article['user_id'] or
                user.can('edit-any-article')))
示例#6
0
    def get(self, article_id):
        try:
            article = controller.get_article(self, int(article_id))
        except (TypeError, ValueError, simpleeditions.NotFoundError):
            self.not_found()
            return

        files = controller.get_files(self, int(article_id))

        user = self.user_obj
        self.render('article_manage_files.html',
                    article=article,
                    files=files,
                    user_can_upload=user and user.can('upload-files')
                    and (user.key().id() == article['user_id']
                         or user.can('edit-any-article')))