コード例 #1
0
ファイル: shop_views.py プロジェクト: hforge/shop
 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')
コード例 #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')
コード例 #3
0
ファイル: root.py プロジェクト: hforge/shop
 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')
コード例 #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')
コード例 #5
0
ファイル: skin.py プロジェクト: hforge/shop
 def get_template(self):
     context = get_context()
     return get_skin_template(context, '/common/languages.xml', is_on_skin=True)
コード例 #6
0
 def get_template(self, resource, context):
     return get_skin_template(context, '/user/profile.xml')
コード例 #7
0
 def get_template(self, resource, context):
     return get_skin_template(context, 'manufacturer_view.xml')
コード例 #8
0
ファイル: shop_utils_views.py プロジェクト: nicolasderam/shop
 def get_template(self, resource, context):
     return get_skin_template(context, 'cart_viewbox.xml')
コード例 #9
0
ファイル: skin.py プロジェクト: nicolasderam/shop
 def get_template(self):
     context = get_context()
     return get_skin_template(context,
                              '/common/languages.xml',
                              is_on_skin=True)
コード例 #10
0
ファイル: manufacturers_views.py プロジェクト: hforge/shop
 def get_template(self, resource, context):
     return get_skin_template(context, 'manufacturer_view.xml')
コード例 #11
0
ファイル: categories_views.py プロジェクト: hforge/shop
 def get_template(self, resource, context):
     return get_skin_template(context, 'virtualcategory_view.xml') # XXX category_view
コード例 #12
0
ファイル: shop_utils_views.py プロジェクト: hforge/shop
 def get_template(self, resource, context):
     return get_skin_template(context, 'cart_viewbox.xml')
コード例 #13
0
ファイル: news.py プロジェクト: nicolasderam/shop
 def get_template(self, resource, context):
     return get_skin_template(context, '/news/sidebar.xml')