本文整理匯總了Python中packages.bin.bin.Page.body_class方法的典型用法代碼示例。如果您正苦於以下問題:Python Page.body_class方法的具體用法?Python Page.body_class怎麽用?Python Page.body_class使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類packages.bin.bin.Page
的用法示例。
在下文中一共展示了Page.body_class方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: auth_error
# 需要導入模塊: from packages.bin.bin import Page [as 別名]
# 或者: from packages.bin.bin.Page import body_class [as 別名]
def auth_error(request, error=None):
s = Auth().is_auth(request)
if not s:
return Auth.routeLogin
base_template = 'system/'
second_base = 'error/'
page = Page(request)
page.title = _('Page Error')
page.icon = 'glyphicons glyphicons-ban'
page.breadcrumbs = [_('System'), _('Page Error'), _(error)]
page.body_class = 'error-page sb-l-o sb-r-c'
try:
page.route_to = request.session['error-route']
except KeyError:
page.route_to = "/"
return render_to_response(
base_template+second_base+'%s.html' % error,
{'s': s, 'page': page},
context_instance=RequestContext(request)
)
示例2: email_view
# 需要導入模塊: from packages.bin.bin import Page [as 別名]
# 或者: from packages.bin.bin.Page import body_class [as 別名]
def email_view(request, method=None):
page = Page(request)
page.title = _('Page Email Preview')
page.icon = 'glyphicons glyphicons-ban'
page.body_class = 'error-page sb-l-o sb-r-c'
template = "email/en-gb/%s.html" % method
return render_to_response(
template,
{'data': page},
context_instance=RequestContext(request)
)
示例3: index
# 需要導入模塊: from packages.bin.bin import Page [as 別名]
# 或者: from packages.bin.bin.Page import body_class [as 別名]
def index(request):
page = Page(request)
page.title = _('View Privileges')
page.icon = 'fa fa-key'
page.body_class = 'error-page sb-l-o sb-r-c'
template = "system/privilege/privileges.html"
return render_to_response(
template,
{'data': page},
context_instance=RequestContext(request)
)