Zine

open source content publishing system


Changeset 1018:140059539038


Ignore:
Timestamp:
05/04/09 16:28:50 (3 years ago)
Author:
Kiran Jonnalagadda <jace@…>
Branch:
default
Message:

Preliminary support for attachments to posts.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • AUTHORS

    r907 r1018  
    1111- Christopher Grebs 
    1212- Christopher Denter 
     13- Kiran Jonnalagadda 
    1314 
    1415Contributors: 
  • zine/application.py

    r991 r1018  
    797797        self.add_shared_exports('core', SHARED_DATA) 
    798798        self.add_middleware(SharedDataMiddleware, self._shared_exports) 
     799        self.add_middleware(SharedDataMiddleware, { 
     800            self.cfg['upload_url_prefix']: path.join(self.instance_folder, 'uploads') 
     801            }) 
    799802 
    800803        # set up the urls 
  • zine/config.py

    r1015 r1018  
    3838    'timezone':                 ChoiceField(choices=sorted(list_timezones()), 
    3939                                            default=u'UTC'), 
     40    'primary_author':           TextField(default=u'', 
     41                                    help_text=lazy_gettext(u'If this blog is '\ 
     42                                                           u'written primarily '\ 
     43                                                           u'by one author, '\ 
     44                                                           u'some themes can '\ 
     45                                                           u'skip the author\'s '\ 
     46                                                           u'name on posts '\ 
     47                                                           u'unless written '\ 
     48                                                           u'by a guest.')), 
    4049    'maintenance_mode':         BooleanField(default=False), 
    4150    'session_cookie_name':      TextField(default=u'zine_session'), 
     
    7483    'profiles_url_prefix':      TextField(default=u'/authors', 
    7584                                          validators=[is_valid_url_prefix()]), 
     85    'upload_url_prefix':        TextField(default=u'/files', 
     86                                          validators=[is_valid_url_prefix()]), 
     87    'upload_path_format':       TextField(default=u'%year%/%month%/%day%/', 
     88                                          validators=[is_valid_url_format()]), 
    7689    'post_url_format':          TextField(default=u'%year%/%month%/%day%/', 
    7790                                          validators=[is_valid_url_format()]), 
  • zine/forms.py

    r1017 r1018  
    964964    profiles_url_prefix = config_field('profiles_url_prefix', 
    965965        lazy_gettext(u'Author Profiles URL prefix')) 
     966    upload_url_prefix = config_field('upload_url_prefix', 
     967        lazy_gettext(u'Uploaded files URL prefix'), 
     968        help_text=lazy_gettext(u'If you change this, links to uploaded files '\ 
     969                               u'from existing posts will not be automatically '\ 
     970                               u'corrected. You must edit those posts manually. '\ 
     971                               u'This setting will take effect when Zine is '\ 
     972                               u'restarted.')) 
     973    upload_path_format = config_field('upload_path_format', 
     974        lazy_gettext(u'Uploaded files path format'), 
     975        help_text=lazy_gettext(u'Path to which post attachments are saved.')) 
    966976    post_url_format = config_field('post_url_format', 
    967977        lazy_gettext(u'Post permalink URL format'), 
     
    985995                old = t[key] 
    986996                if old != value: 
    987                     if key in ['blog_url_prefix', 'admin_url_prefix', 
    988                                'category_url_prefix', 'tags_url_prefix', 
    989                                'profiles_url_prefix']: 
     997                    if key == 'blog_url_prefix': 
    990998                        change_url_prefix(old, value) 
    991999                    t[key] = value 
Note: See TracChangeset for help on using the changeset viewer.