diff --git a/gen/mixins/__init__.py b/gen/mixins/__init__.py index 6049ae8..a199253 100644 --- a/gen/mixins/__init__.py +++ b/gen/mixins/__init__.py @@ -923,6 +923,15 @@ class BaseMixin: if hasattr(appyObj, 'mayNavigate'): return appyObj.mayNavigate() return True + def mayAct(self): + '''May the currently logged user see column "actions" for this + object? This can be used for hiding the "edit" icon, for example: + when a user may edit only a restricted set of fields on an object, + we may avoid showing him the global "edit" icon.''' + appyObj = self.appy() + if hasattr(appyObj, 'mayAct'): return appyObj.mayAct() + return True + def mayDelete(self): '''May the currently logged user delete this object? This condition comes as an addition/refinement to the corresponding workflow @@ -1291,6 +1300,13 @@ class BaseMixin: '''Returns a reference to the config module.''' return self.__class__.config + def getParent(self): + '''If this object is stored within another one, this method returns it. + Else (if the object is stored directly within the tool or the root + data folder) it returns None.''' + parent = self.getParentNode() + if parent.meta_type != 'Folder': return parent + def index_html(self): '''Redirects to /ui.''' return self.REQUEST.RESPONSE.redirect(self.getUrl()) diff --git a/gen/ui/appy.css b/gen/ui/appy.css index fdd5176..f7321bb 100644 --- a/gen/ui/appy.css +++ b/gen/ui/appy.css @@ -1,5 +1,5 @@ -body { font: 75% Lucida,Helvetica,Arial,sans-serif; background-color: #EAEAEA; } -pre { font: 100% Lucida,Helvetica,Arial,sans-serif; margin: 0} +body { font: 75% Helvetica,Arial,sans-serif; background-color: #EAEAEA; } +pre { font: 100% Helvetica,Arial,sans-serif; margin: 0} h1 { font-size: 11pt; margin:0;} h2 { font-size: 10pt; margin:0; font-style: italic; font-weight: normal;} h3 { font-size: 9pt; margin:0; font-weight: bold;} @@ -19,13 +19,13 @@ input[type=button] { border: 1px solid #cccccc; input[type=submit] { border: 1px solid #cccccc; background-color: #f8f8f8; cursor: pointer; } input[type=password] { border: 1px solid #cccccc; background-color: #f8f8f8; - font-family: Lucida,Helvetica,Arial,sans-serif;} + font-family: Helvetica,Arial,sans-serif;} input[type=text] { border: 1px solid #cccccc; background-color: #f8f8f8; - font-family: Lucida,Helvetica,Arial,sans-serif; + font-family: Helvetica,Arial,sans-serif; margin-bottom: 1px} select { border: 1px solid #cccccc; background-color: #f8f8f8;} -textarea { width: 99%; font: 100% Lucida,Helvetica,Arial,sans-serif; +textarea { width: 99%; font: 100% Helvetica,Arial,sans-serif; border: 1px solid #a79e9e; background-color: #f8f8f8;} label { font-weight: 600; font-style: italic; line-height: 1.4em;} legend { padding-bottom: 2px; padding-right: 3px; color: black;} @@ -40,19 +40,19 @@ img {border: 0} border-style: solid; border-width: 1px; border-color: grey; } .top { height: 75px; margin-left: 3em; vertical-align: top;} .lang { margin-right: 3px; } -.userStrip { background-color: #89A6B1; height: 40px; - border-top: 3px solid #405A64; border-bottom: 2px solid #5F7983; } +.userStrip { background-color: #d7dee4; height: 40px; + border-top: 1px solid #5F7983; border-bottom: 1px solid #5F7983; } .login { margin-top: 2px; margin-bottom: 2px; color: white;} .buttons { margin-left: 4px;} .message { color: #fd9c03; position: absolute; top: -55px; left: 100px; width: 700px; border: 1px black dashed; padding: 2px 6px; background-color: #f4f5f6} .discreet { font-size: 90%; } -.portlet { width: 150px; padding: 12px 9px 9px 9px; - border-right: 2px solid #5F7983;} +.portlet { width: 150px; border-right: 1px solid #5F7983;} +.portletContent { margin: 9px; } .portletTitle { font-weight: bold; font-size: 110%; margin-bottom: 4px;} .portletCurrent { font-weight: bold; } -.portletSep { border-top: 1px solid grey; margin-top: 9px; padding-top: 9px;} +.portletSep { border-top: 1px solid #5F7983; margin-top: 2px;} .portletPage { font-style: italic; } .portletGroup { font-variant: small-caps; font-weight: bold; font-style: normal; margin: 0.4em 0 0.2em 0; } @@ -68,7 +68,7 @@ img {border: 0} .list { border: 1px solid grey; margin-bottom: 3px;} .list td, .list th { border: 1px solid grey; padding-left: 5px; padding-right: 5px; padding-top: 3px;} -.list th { background-color: #c8d7e1; font-style: italic; font-weight: normal;} +.list th { background-color: #d7dee4; font-style: italic; font-weight: normal;} .grid th { font-style: italic; font-weight: normal; border-bottom: 2px solid grey; padding: 2px 2px;} .grid td { padding-right: 5px; } diff --git a/gen/ui/navigate.pt b/gen/ui/navigate.pt index f8d24c8..762482a 100644 --- a/gen/ui/navigate.pt +++ b/gen/ui/navigate.pt @@ -63,15 +63,15 @@ backText navInfo/backText"> Go to the source URL (search or referred object) - Go to the first page - Go to the previous page - Explain which element is currently shown @@ -80,11 +80,11 @@    Go to the next page - Go to the last page - diff --git a/gen/ui/portlet.pt b/gen/ui/portlet.pt index 26db2e1..a714e97 100644 --- a/gen/ui/portlet.pt +++ b/gen/ui/portlet.pt @@ -9,49 +9,56 @@ contextObj tool/getPublishedObject; rootClasses tool/getRootClasses"> - -
+
+
+ +
+ + + +
+
- +
- One section for every searchable root class. - - Section title, with action icons - - - - - -
- - - Create a new object from a web form - - - - Create (a) new object(s) by importing data - - - - Search objects of this type - - - -
- Searches for this content type. + One section for every searchable root class. + + + A separator if required +
+ +
+ Section title, with action icons + + +
+ Create a new object from a web form + + + + Create (a) new object(s) by importing data + + + + Search objects of this type + + + +
+ Searches for this content type. - + diff --git a/gen/ui/result.pt b/gen/ui/result.pt index 318a3b7..6bd2abd 100644 --- a/gen/ui/result.pt +++ b/gen/ui/result.pt @@ -118,7 +118,7 @@ Column "Actions" - +
Edit the element
diff --git a/gen/ui/template.pt b/gen/ui/template.pt index 5b55272..dd6e117 100644 --- a/gen/ui/template.pt +++ b/gen/ui/template.pt @@ -145,7 +145,7 @@
- +
PortletActions diff --git a/pod/doc_importers.py b/pod/doc_importers.py index 290421d..9a337e8 100644 --- a/pod/doc_importers.py +++ b/pod/doc_importers.py @@ -146,7 +146,7 @@ class PdfImporter(DocImporter): if os.path.exists(nextImage): # Use internally an Image importer for doing this job. imgImporter =ImageImporter(None, nextImage, 'jpg',self.renderer) - imgImporter.setAnchor('paragraph') + imgImporter.setImageInfo('paragraph', True, None, None, None) self.res += imgImporter.run() os.remove(nextImage) else: diff --git a/pod/renderer.py b/pod/renderer.py index c9cca5b..40e7858 100644 --- a/pod/renderer.py +++ b/pod/renderer.py @@ -297,6 +297,9 @@ class Renderer: # Guess document format if isinstance(content, FileWrapper): format = content.mimeType + elif hasattr(content, 'filename') and content.filename: + format = os.path.splitext(content.filename)[1][1:] + content = content.data if not format: # It should be deduced from p_at if not at:
diff --git a/gen/ui/widgets/ref.pt b/gen/ui/widgets/ref.pt index 1d20dcd..0d4a7c2 100644 --- a/gen/ui/widgets/ref.pt +++ b/gen/ui/widgets/ref.pt @@ -210,7 +210,9 @@ - + + +