Exemple #1
0
 def get_template(self, resource, context):
     hostname = context.uri.authority
     if hostname[:6] == 'admin.' :
         # Backoffice login template
         template =  '/ui/backoffice/login.xml'
         return resource.get_resource(template)
     return get_skin_template(context, 'shop_login.xml')
Exemple #2
0
 def get_template(self, resource, context):
     hostname = context.uri.authority
     if hostname[:6] == 'admin.':
         # Backoffice login template
         template = '/ui/backoffice/login.xml'
         return resource.get_resource(template)
     return get_skin_template(context, 'shop_login.xml')
Exemple #3
0
 def internal_server_error(self, context):
     # We send an email to administrators
     for email in self.get_property('administrators'):
         subject = MSG(u'Internal server error').gettext()
         headers = u'\n'.join([u'%s => %s' % (x, y)
                                 for x, y in context.get_headers()])
         text = internal_error_body.gettext(uri=context.uri,
             error=traceback.format_exc(), headers=headers)
         self.send_email(email, subject, text=text)
     # We show a prerry error page
     database = context.database
     namespace = {'traceback': '',
                  'read_only': type(database) is ReadOnlyDatabase}
     handler = get_skin_template(context, 'internal_server_error.xml')
     return stl(handler, namespace, mode='html')
Exemple #4
0
 def internal_server_error(self, context):
     # We send an email to administrators
     for email in self.get_property('administrators'):
         subject = MSG(u'Internal server error').gettext()
         headers = u'\n'.join(
             [u'%s => %s' % (x, y) for x, y in context.get_headers()])
         text = internal_error_body.gettext(uri=context.uri,
                                            error=traceback.format_exc(),
                                            headers=headers)
         self.send_email(email, subject, text=text)
     # We show a prerry error page
     database = context.database
     namespace = {
         'traceback': '',
         'read_only': type(database) is ReadOnlyDatabase
     }
     handler = get_skin_template(context, 'internal_server_error.xml')
     return stl(handler, namespace, mode='html')
Exemple #5
0
 def get_template(self):
     context = get_context()
     return get_skin_template(context, '/common/languages.xml', is_on_skin=True)
Exemple #6
0
 def get_template(self, resource, context):
     return get_skin_template(context, '/user/profile.xml')
Exemple #7
0
 def get_template(self, resource, context):
     return get_skin_template(context, 'manufacturer_view.xml')
 def get_template(self, resource, context):
     return get_skin_template(context, 'cart_viewbox.xml')
Exemple #9
0
 def get_template(self):
     context = get_context()
     return get_skin_template(context,
                              '/common/languages.xml',
                              is_on_skin=True)
Exemple #10
0
 def get_template(self, resource, context):
     return get_skin_template(context, 'manufacturer_view.xml')
Exemple #11
0
 def get_template(self, resource, context):
     return get_skin_template(context, 'virtualcategory_view.xml') # XXX category_view
Exemple #12
0
 def get_template(self, resource, context):
     return get_skin_template(context, 'cart_viewbox.xml')
Exemple #13
0
 def get_template(self, resource, context):
     return get_skin_template(context, '/news/sidebar.xml')