Skip to content

Commit

Permalink
Require the bootstrap assets on each page via the header template.
Browse files Browse the repository at this point in the history
Refactor the layout to be like suggested by bootstrap.
  • Loading branch information
Michael Howitz authored and dwt committed Jun 12, 2018
1 parent 2358572 commit 229363e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
12 changes: 9 additions & 3 deletions src/App/Management.py
Expand Up @@ -23,6 +23,7 @@
from six.moves.urllib.parse import quote, unquote
from zExceptions import Redirect
from zope.interface import implementer
import js.bootstrap

try:
from html import escape
Expand Down Expand Up @@ -141,9 +142,6 @@ class Navigation(Base):
security.declareProtected(view_management_screens, 'manage_menu')
manage_menu = DTMLFile('dtml/menu', globals())

security.declareProtected(view_management_screens, 'manage_page_header')
manage_page_header = DTMLFile('dtml/manage_page_header', globals())

security.declareProtected(view_management_screens, 'manage_page_footer')
manage_page_footer = DTMLFile('dtml/manage_page_footer', globals())

Expand All @@ -155,6 +153,14 @@ class Navigation(Base):
manage_form_title._setFuncSignature(
varnames=('form_title', 'help_product', 'help_topic'))


_manage_page_header = DTMLFile('dtml/manage_page_header', globals())
security.declareProtected(view_management_screens, 'manage_page_header')
def manage_page_header(self, *args, **kw):
"""manage_page_header."""
js.bootstrap.bootstrap.need()
return self._manage_page_header(*args, **kw)

security.declarePublic('manage_zmi_logout')
def manage_zmi_logout(self, REQUEST, RESPONSE):
"""Logout current user"""
Expand Down
1 change: 1 addition & 0 deletions src/App/dtml/manage_page_footer.dtml
@@ -1,2 +1,3 @@
</div>
</body>
</html>
11 changes: 6 additions & 5 deletions src/App/dtml/manage_page_header.dtml
@@ -1,13 +1,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<!doctype html>
<html lang="en">
<head>
<dtml-unless management_page_charset>
<dtml-call "REQUEST.set('management_page_charset','utf-8')">
<dtml-call "REQUEST.set('management_page_charset','utf-8')">
</dtml-unless>
<meta http-equiv="content-type" content="text/html;charset=&dtml-management_page_charset;" />
<dtml-call "RESPONSE and RESPONSE.setHeader('content-type','text/html;charset='+management_page_charset)">
<title><dtml-if title_or_id><dtml-var title_or_id><dtml-else>Zope</dtml-if></title>
<link rel="stylesheet" type="text/css" href="&dtml-BASEPATH1;/manage_page_style.css" />
<!-- <link rel="stylesheet" type="text/css" href="&dtml-BASEPATH1;/manage_page_style.css" /> -->

</head>
<body bgcolor="#ffffff" link="#000099" alink="#000099" vlink="#000099">
<body>
<div class="container-fluid">

0 comments on commit 229363e

Please sign in to comment.