Exemple #1
0
 def handle_view(self, request, name, ctx=None):
     handler = self.views[name]
     ctx = ctx or {}
     ctx.update({
         'current':     name,
         'prev':        self.prev[name],
         'next':        self.next[name],
         'values':      dict((k, v) for k, v in request.values.iteritems()
                             if not k.startswith('_')),
         'languages':   list_languages(self_translated=True)
     })
     return render_response(request, name + '.html', ctx)
Exemple #2
0
 def handle_view(self, request, name, ctx=None):
     #handler = self.views[name]
     ctx = ctx or {}
     ctx.update({
         'current':     name,
         'prev':        self.prev[name],
         'next':        self.next[name],
         'values':      dict((k, v) for k, v in request.values.iteritems()
                             if not k.startswith('_')),
         'languages':   list_languages(self_translated=True)
     })
     return render_response(request, name + '.html', ctx)
Exemple #3
0
        u'change the timezone after posts are created because the information '
        u'in the database is stored as UTC.')),
    'primary_author':           TextField(default=u'', help_text=l_(
        u'If this blog is written primarily by one author, some themes can ' \
        u'skip the author\'s name on posts unless written by a guest.')),
    'maintenance_mode':         BooleanField(default=False, help_text=l_(
        u'If set to true, the blog enables the maintainance mode.')),
    'session_cookie_name':      TextField(default=u'zine_session',
        help_text=l_(u'If there are multiple Zine installations on '
        u'the same host, the cookie name should be set to something different '
        u'for each blog.')),
    'theme':                    TextField(default=u'default'),
    'secret_key':               TextField(default=u'', help_text=l_(
        u'The secret key is used for various security related tasks in the '
        u'system.  For example, the cookie is signed with this value.')),
    'language':                 ChoiceField(choices=list_languages(False),
                                            default=u'en'),

    'iid':                      TextField(default=u'', help_text=l_(
        u'The iid uniquely identifies the Zine instance.  Currently this '
        u'value is unused, but once set you should not modify it.')),

    # log and development settings
    'log_file':                 TextField(default=u'zine.log'),
    'log_level':                ChoiceField(choices=[(k, l_(k)) for k, v
                                                in sorted(log.LEVELS.items(),
                                                          key=lambda x: x[1])],
                                            default=u'warning'),
    'log_email_only':           BooleanField(default=_dev_mode,
        help_text=l_(u'During development activating this is helpful to '
        u'log emails into a mail.log file in your instance folder instead '
Exemple #4
0
 def __init__(self, initial=None):
     _ConfigForm.__init__(self, initial)
     self.language.choices = list_languages()
     self.default_parser.choices = self.comment_parser.choices = \
         self.app.list_parsers()