diff --git a/gen/__init__.py b/gen/__init__.py index 71b421b..aa79818 100644 --- a/gen/__init__.py +++ b/gen/__init__.py @@ -2605,6 +2605,8 @@ class Config: # frontPage = True will replace the Plone front page with a page # whose content will come fron i18n label "front_page_text". self.frontPage = False + # You can choose the Plone or Appy main template + self.frontPageTemplate = 'plone' # or "appy" # If you don't need the portlet that appy.gen has generated for your # application, set the following parameter to False. self.showPortlet = True diff --git a/gen/plone25/generator.py b/gen/plone25/generator.py index 19b80c8..18539ba 100644 --- a/gen/plone25/generator.py +++ b/gen/plone25/generator.py @@ -159,8 +159,7 @@ class Generator(AbstractGenerator): self.generateTool() self.generateInit() self.generateTests() - if self.config.frontPage: - self.generateFrontPage() + if self.config.frontPage: self.generateFrontPage() self.copyFile('Install.py', self.repls, destFolder='Extensions') self.generateConfigureZcml() self.copyFile('import_steps.xml', self.repls, @@ -566,6 +565,8 @@ class Generator(AbstractGenerator): def generateFrontPage(self): fp = self.config.frontPage repls = self.repls.copy() + template = 'frontPage.pt' + if self.config.frontPageTemplate== 'appy': template = 'frontPageAppy.pt' if fp == True: # We need a front page, but no specific one has been given. # So we will create a basic one that will simply display @@ -582,7 +583,7 @@ class Generator(AbstractGenerator): page, macro = fp.split('/') repls['pageContent'] = '' % (page, macro) - self.copyFile('frontPage.pt', repls, destFolder=self.skinsFolder, + self.copyFile(template, repls, destFolder=self.skinsFolder, destName='%sFrontPage.pt' % self.applicationName) def generateTool(self): diff --git a/gen/plone25/skin/appy.css b/gen/plone25/skin/appy.css new file mode 100644 index 0000000..c575df5 --- /dev/null +++ b/gen/plone25/skin/appy.css @@ -0,0 +1,21 @@ +body { + font: 75% Lucida,Helvetica,Arial,sans-serif; + background-color: #EAEAEA; +} + +a {text-decoration: none; color: #747171;} +a:visited {color: #840107;} +table { font-size: 100%; border-spacing: 0px; } + +.main { + width: 900px; + background-color: white; + border-style: solid; + border-width: 1px; + border-color: grey; + box-shadow: 3px 3px 3px #A9A9A9; +} + +.top { height: 80px; margin-left: 3em; vertical-align: top;} +.lang { margin-right: 3px; } +.auth { background-color: grey;} diff --git a/gen/plone25/skin/logo.jpg b/gen/plone25/skin/logo.jpg new file mode 100644 index 0000000..5cf038f Binary files /dev/null and b/gen/plone25/skin/logo.jpg differ diff --git a/gen/plone25/skin/template.pt b/gen/plone25/skin/template.pt new file mode 100644 index 0000000..c0b8c10 --- /dev/null +++ b/gen/plone25/skin/template.pt @@ -0,0 +1,78 @@ + + + + + + + + + + Top banner + + + + The login strip + + + + + + +
+ + + Logo + + Language selector (links or listbox) + + +
+ + + + +
+ +
+ +
+
+ + + + +
a
+
+ +
+

Appy

+

Sub appy

+

Sub sub appy

+

Hello

+ + diff --git a/gen/plone25/templates/frontPageAppy.pt b/gen/plone25/templates/frontPageAppy.pt new file mode 100644 index 0000000..b543829 --- /dev/null +++ b/gen/plone25/templates/frontPageAppy.pt @@ -0,0 +1,5 @@ + + +
+ +
diff --git a/gen/utils.py b/gen/utils.py index 1340091..62fd2ee 100644 --- a/gen/utils.py +++ b/gen/utils.py @@ -213,23 +213,6 @@ class Keywords: return op.join(self.keywords)+'*' return '' -# ------------------------------------------------------------------------------ -class FakeBrain: - '''This class behaves like a brain retrieved from a query to a ZCatalog. It - is used for representing a fake brain that was generated from a search in - a distant portal_catalog.''' - Creator = None - created = None - modified = None - review_state = None - def has_key(self, key): return hasattr(self, key) - def getPath(self): return self.path - def getURL(self, relative=0): return self.url - def _unrestrictedGetObject(self): return self - def pretty_title_or_id(self): return self.Title - def getObject(self, REQUEST=None): return self - def getRID(self): return self.url - # ------------------------------------------------------------------------------ CONVERSION_ERROR = 'An error occurred while executing command "%s". %s' class FileWrapper: diff --git a/pod/doc_importers.py b/pod/doc_importers.py index 50807ec..4e366ab 100644 --- a/pod/doc_importers.py +++ b/pod/doc_importers.py @@ -145,7 +145,7 @@ pxToCm = 44.173513561 def getSize(filePath, fileType): '''Gets the size of an image by reading first bytes.''' x, y = (None, None) - f = file(filePath) + f = file(filePath, 'rb') if fileType in jpgTypes: # Dummy read to skip header ID f.read(2) diff --git a/pod/xhtml2odt.py b/pod/xhtml2odt.py index 202ade7..aa636c6 100644 --- a/pod/xhtml2odt.py +++ b/pod/xhtml2odt.py @@ -454,6 +454,9 @@ class XhtmlParser(XmlParser): currentElem, elemsToReopen = e.onElementEnd(elem) # Determine the tag to dump startTag, endTag = currentElem.getOdfTags(e) + if currentElem.isConflictual: + # Compute the start tag, with potential styles applied + startTag = e.getTags((currentElem,), start=True) if currentElem.isConflictual and e.res.endswith(startTag): # We will not dump it, it would constitute a silly empty tag. e.res = e.res[:-len(startTag)]