Exemple #1
0
 def archived(self):
     site=get_current_site()
     return dict(site=site,
                 archive_posts=Posts.find_archive_count(site=site),
                 archives_widget=widgets.archives_widget,
                 tags_widget=widgets.tags_widget,
                 posts_widget=widgets.posts_widget,
                 pages_widget=widgets.pages_widget,
                 pages=Pages.find_all(site=site),
                 tags=Tags.find_all(site=site),
                 admin_widget=widgets.admin_widget,
                 badge_widget=widgets.badge_widget,
                 recent_comments=Comments.find_recent(),
                 recent_comments_widget=widgets.recent_comments_widget)
Exemple #2
0
 def new_post(self):
     user = identity.current.user
     site=get_current_site()
     return dict(user=user,
                site=site,
                archive_posts= Posts.find_archive_count(site=site),
                archives_widget=widgets.archives_widget,
                tags_widget=widgets.tags_widget,
                pages_widget=widgets.pages_widget,
                pages=Pages.find_all(site=site),
                tags=Tags.find_all(site=site),
                admin_widget=widgets.admin_widget,
                badge_widget=widgets.badge_widget,
                recent_comments=Comments.find_recent(),
                recent_comments_widget=widgets.recent_comments_widget)
Exemple #3
0
 def new(self):
     """docstring for new"""
     site=get_current_site()
     return dict(site=site,
                 archive_posts=Posts.find_archive_count(site=site),
                 archives_widget=widgets.archives_widget,
                 tags_widget=widgets.tags_widget,
                 pages_widget=widgets.pages_widget,
                 pages=Pages.find_all(site=site),
                 tags=Tags.find_all(site=site),
                 groups=Group.find_all(site=site),
                 admin_widget=widgets.admin_widget,
                 badge_widget=widgets.badge_widget,
                 recent_comments=Comments.find_recent(),
                 recent_comments_widget=widgets.recent_comments_widget)
Exemple #4
0
 def index(self):
     """docstring for index"""
     site=get_current_site()
     users = User.find_all(site=site)
     return dict(site=site,
                 archive_posts=Posts.find_archive_count(site=site),
                 archives_widget=widgets.archives_widget,
                 tags_widget=widgets.tags_widget,
                 pages_widget=widgets.pages_widget,
                 pages=Pages.find_all(site=site),
                 tags=Tags.find_all(site=site),
                 users=users,
                 admin_widget=widgets.admin_widget,
                 badge_widget=widgets.badge_widget,
                 recent_comments=Comments.find_recent(),
                 recent_comments_widget=widgets.recent_comments_widget)
Exemple #5
0
 def archives(self, year, month):
     archives = '/'.join((year, month))
     site=get_current_site()
     posts = Posts.find_all_archived(archives=archives, site=site)
     return dict(posts=posts,
                 site=site,
                 archive_posts=Posts.find_archive_count(site=site),
                 archives_widget=widgets.archives_widget,
                 tags_widget=widgets.tags_widget,
                 posts_widget=widgets.posts_widget,
                 pages_widget=widgets.pages_widget,
                 pages=Pages.find_all(site=site),
                 tags=Tags.find_all(site=site),
                 admin_widget=widgets.admin_widget,
                 badge_widget=widgets.badge_widget,
                 recent_comments=Comments.find_recent(),
                 recent_comments_widget=widgets.recent_comments_widget)
Exemple #6
0
 def edit_post(self,year, month, day, title):
     permalink = '/'.join((year, month, day, title))
     site=get_current_site()
     post = Posts.find_by_permalink(permalink=permalink, site=site)
     return dict(post=post,
                site=site,
                comment_widget=widgets.comment_widget,
                archive_posts= Posts.find_archive_count(site=site),
                archives_widget=widgets.archives_widget,
                tags_widget=widgets.tags_widget,
                pages_widget=widgets.pages_widget,
                pages=Pages.find_all(site=site),
                tags=Tags.find_all(site=site),
                admin_widget=widgets.admin_widget,
                badge_widget=widgets.badge_widget,
                recent_comments=Comments.find_recent(),
                recent_comments_widget=widgets.recent_comments_widget)
Exemple #7
0
    def index(self):
        site=get_current_site()
        home_url=config.get('calabro.default_site')
        
        return dict(home_url=home_url,
                    site=site,
                    archive_posts= Posts.find_archive_count(site=site),
                    archives_widget=widgets.archives_widget,
                    tags_widget=widgets.tags_widget,
                    pages_widget=widgets.pages_widget,
                    pages=Pages.find_all(site=site),
                    tags=Tags.find_all(site=site),
                    admin_widget=widgets.admin_widget,
                    badge_widget=widgets.badge_widget,
                    recent_comments=Comments.find_recent(),
                    recent_comments_widget=widgets.recent_comments_widget)

        
Exemple #8
0
    def default(self, name, *args, **kwargs):
        site=get_current_site()
        page = Pages.find_by_name(name=name,
                                  site=site)
        if page == None:
            raise controllers.redirect('/new_page?name=' + name)

        return dict(page=page,
                    site=site,
                    archive_posts= Posts.find_archive_count(site=site),
                    archives_widget=widgets.archives_widget,
                    tags_widget=widgets.tags_widget,
                    pages_widget=widgets.pages_widget,
                    pages=Pages.find_all(site=site),
                    tags=Tags.find_all(site=site),
                    admin_widget=widgets.admin_widget,
                    badge_widget=widgets.badge_widget,
                    recent_comments=Comments.find_recent(),
                    recent_comments_widget=widgets.recent_comments_widget)
Exemple #9
0
 def tags(self, name):
     site=get_current_site()
     tag = Tags.find_by(name=name, site=site)
     if tag == None:
         redirect_to_home()
         
     posts = Posts.find_by_tag(tag=tag, site=site)
     return dict(posts=posts,
                 site=site,
                 archive_posts=Posts.find_archive_count(site=site),
                 archives_widget=widgets.archives_widget,
                 tags_widget=widgets.tags_widget,
                 posts_widget=widgets.posts_widget,
                 pages_widget=widgets.pages_widget,
                 pages=Pages.find_all(site=site),
                 tags=Tags.find_all(site=site),
                 admin_widget=widgets.admin_widget,
                 badge_widget=widgets.badge_widget,
                 recent_comments=Comments.find_recent(),
                 recent_comments_widget=widgets.recent_comments_widget)   
Exemple #10
0
 def post(self, year, month, day, title):
     permalink = '/'.join((year, month, day, title))
     site=get_current_site()
     try:
         post = Posts.find_by_permalink(permalink=permalink, site=site)
     except SQLObjectNotFound:
             flash("Sorry, post could not be found!")
             raise controllers.redirect('/')
             
     return dict(post=post,
                site=site,
                comment_widget=widgets.comment_widget,
                archive_posts= Posts.find_archive_count(site=site),
                archives_widget=widgets.archives_widget,
                tags_widget=widgets.tags_widget,
                pages_widget=widgets.pages_widget,
                pages=Pages.find_all(site=site),
                tags=Tags.find_all(site=site),
                admin_widget=widgets.admin_widget,
                badge_widget=widgets.badge_widget,
                recent_comments=Comments.find_recent(),
                recent_comments_widget=widgets.recent_comments_widget)