From d480e58d01ba32fc4ddf95ff41c8d04c69186a72 Mon Sep 17 00:00:00 2001 From: Gaetan Delannay Date: Thu, 11 Apr 2013 16:01:52 +0200 Subject: [PATCH] [gen] UI improvements. --- gen/__init__.py | 2 +- gen/mixins/__init__.py | 11 +++--- gen/ui/appy.css | 33 ++++++++-------- gen/ui/appy.js | 2 +- gen/ui/appyConfig.gif | Bin 899 -> 904 bytes gen/ui/ckeditor/config.js | 2 +- gen/ui/home.gif | Bin 589 -> 569 bytes gen/ui/logout.gif | Bin 636 -> 615 bytes gen/ui/page.pt | 1 - gen/ui/result.pt | 18 +++++---- gen/ui/template.pt | 77 +++++++++++++++++++------------------- gen/ui/widgets/ref.pt | 18 +++++---- 12 files changed, 87 insertions(+), 77 deletions(-) diff --git a/gen/__init__.py b/gen/__init__.py index 6c3663e..8e9365c 100644 --- a/gen/__init__.py +++ b/gen/__init__.py @@ -1215,7 +1215,7 @@ class String(Type): if width == None: if format == String.TEXT: self.width = 60 # This width corresponds to the standard width of an Appy page. - if format == String.XHTML: self.width = 870 + if format == String.XHTML: self.width = None else: self.width = 30 if height == None: if format == String.TEXT: self.height = 5 diff --git a/gen/mixins/__init__.py b/gen/mixins/__init__.py index 801fa63..3f1ad6a 100644 --- a/gen/mixins/__init__.py +++ b/gen/mixins/__init__.py @@ -928,10 +928,11 @@ class BaseMixin: return None return res - def getIcons(self, navInfo=''): - '''Gets the icons that can be shown besides the title of an object.''' + def getSupTitle(self, navInfo=''): + '''Gets the html code (icons,...) that can be shown besides the title + of an object.''' appyObj = self.appy() - if hasattr(appyObj, 'getIcons'): return appyObj.getIcons(navInfo) + if hasattr(appyObj, 'getSupTitle'): return appyObj.getSupTitle(navInfo) return '' def getSubTitle(self): @@ -1836,8 +1837,8 @@ class BaseMixin: # this field. field = self.getAppyType(name) ckAttrs = {'toolbar': 'Appy', - 'format_tags': '%s' % ';'.join(field.styles), - 'width': field.width} + 'format_tags': '%s' % ';'.join(field.styles)} + if field.width: ckAttrs['width'] = field.width if field.allowImageUpload: ckAttrs['filebrowserUploadUrl'] = '%s/upload' % self.absolute_url() ck = [] diff --git a/gen/ui/appy.css b/gen/ui/appy.css index 9d16fa7..e11d614 100644 --- a/gen/ui/appy.css +++ b/gen/ui/appy.css @@ -1,6 +1,7 @@ -body { font: 75% Helvetica,Arial,sans-serif; background-color: #EAEAEA; - margin-top: 18px } -pre { font: 100% Helvetica,Arial,sans-serif; margin: 0 } +body { font: 75% "Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,Verdana,sans-serif; + background-color: #EAEAEA; margin-top: 18px } +pre { font: 100% "Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,Verdana,sans-serif; + margin: 0 } h1 { font-size: 14pt; margin:6px 0 6px 0 } h2 { font-size: 13pt; margin:6px 0 6px 0; font-style: italic; font-weight: normal } @@ -13,9 +14,9 @@ a { text-decoration: none; color: #436976 } a:visited { color: #436976 } table { font-size: 100%; border-spacing: 0px; border-collapse:collapse;} form { margin: 0; padding: 0 } -p { margin: 0 } +p { margin: 0 0 5px 0 } acronym { cursor: help } -input { font: 92% Helvetica,Arial,sans-serif } +input { font: 92% "Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,Verdana,sans-serif } input[type=image] { border: 0; background: none; cursor: pointer } input[type=checkbox] { border: 0; background: none; cursor: pointer } input[type=radio] { border: 0; background: none; cursor: pointer } @@ -26,13 +27,13 @@ input[type=button] { border: 1px solid #d0d0d0; margin: 0 3px; input[type=submit] { border: 1px solid #d0d0d0; background-color: #f8f8f8; cursor: pointer } input[type=password] { border: 1px solid #d0d0d0; background-color: #f8f8f8; - font-family: Helvetica,Arial,sans-serif } + font-family: "Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,Verdana,sans-serif } input[type=text] { border: 1px solid #d0d0d0; background-color: #f8f8f8; - font-family: Helvetica,Arial,sans-serif; + font-family: "Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,Verdana,sans-serif; margin-bottom: 1px } select { border: 1px solid #d0d0d0; background-color: #f8f8f8 } -textarea { width: 99%; font: 100% Helvetica,Arial,sans-serif; +textarea { width: 99%; font: 100% "Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,Verdana,sans-serif; border: 1px solid #d0d0d0; background-color: #f8f8f8 } label { font-weight: 600; font-style: italic; line-height: 1.4em } legend { padding-bottom: 2px; padding-right: 3px; color: black } @@ -64,7 +65,8 @@ img { border: 0; vertical-align: middle } .login { margin-top: 2px; margin-bottom: 2px; color: black } .buttons { margin-left: 4px } .fakeButton { border: 1px solid #D7DEE4; background-color: #fde8e0; - padding: 0px 8px 2px; font: italic 92% Helvetica,Arial,sans-serif} + padding: 0px 8px 2px; + font: italic 92% "Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,Verdana,sans-serif } .message { position: absolute; top: -40px; left: 150px; font-size: 90%; width: 600px; border: 1px #F0C36D solid; padding: 6px; background-color: #F9EDBE; text-align: center; @@ -74,6 +76,7 @@ img { border: 0; vertical-align: middle } box-shadow: 0 2px 4px #A9A9A9 } .focus td { padding: 4px 0px 4px 4px } .discreet { font-size: 90%; color: grey } +.objectLink {} .lostPassword a { font-size: 90%; color: white; padding-left: 1em } .portlet { width: 150px; border-right: 1px solid #5F7983; background-color: #ededed } @@ -86,13 +89,13 @@ img { border: 0; vertical-align: middle } margin: 0.1em 0 0.3em ; border-bottom: 1px dashed grey } .portletSearch { font-size: 90%; font-style: italic } .content { padding: 14px 14px 9px 15px; background-color: #f1f1f1 } -.grey { display: none; position: absolute; left: 0px; top: 0px; +.grey { display: none; position: absolute; left: 0px; top: 0px; z-index:2; background:grey; opacity:0.5; -moz-opacity:0.5; -khtml-opacity:0.5; filter:alpha(Opacity=50) } .popup { display: none; position: absolute; top: 30%; left: 35%; width: 350px; z-index : 100; background: white; padding: 8px; border: 1px solid grey } -.list { border: 1px solid grey; margin-bottom: 3px } +.list { margin-bottom: 3px } .list td, .list th { border: 1px solid grey; padding-left: 5px; padding-right: 5px; padding-top: 3px } .list th { background-color: #d7dee4; font-style: italic; font-weight: normal } @@ -109,12 +112,12 @@ img { border: 0; vertical-align: middle } padding: 0.3em 0em 0.2em 0.1em; background-color: #eef3f5; border-top: 1px solid #8CACBB;border-bottom: 1px solid #8CACBB } .section2 { font-size: 110%; font-style: italic; margin: 0.45em 0em 0.2em 0; - border-bottom: 2px solid grey } + border-bottom: 1px solid #DADADA } .section3 { font-size: 100%; font-style: italic; font-weight: bold; - margin: 0.45em 0em 0.1em 0; background-color: #95a1b3; + margin: 0.45em 0em 0.1em 0; background-color: #a1aeb5; text-align: center; color: white } -.odd { background-color: #f9f9f9 } -.even { background-color: #f4f4f4 } +.even { background-color: #f9f9f9 } +.odd { background-color: #f4f4f4 } .summary { margin-bottom: 5px; background-color: #e9e9e9; border: 1px dashed grey } .objectTitle { font-size: 11pt; border-bottom: 3px solid grey; diff --git a/gen/ui/appy.js b/gen/ui/appy.js index 65b8f30..a8fe372 100644 --- a/gen/ui/appy.js +++ b/gen/ui/appy.js @@ -235,7 +235,7 @@ function setSubTitles(value) { var subTitles = getElementsHavingName('div', 'subTitle'); if (subTitles.length == 0) return; for (var i=0; i < subTitles.length; i++) { - if (value == 'true') subTitles[i].style.display = 'block'; + if (value == 'true') subTitles[i].style.display = 'inline'; else subTitles[i].style.display = 'none'; } } diff --git a/gen/ui/appyConfig.gif b/gen/ui/appyConfig.gif index 3ebbe3aec9bf5e2ee1b844fe86362005ac760d10..c0187ee2054b791c7a6e8e5f8ad1eb1c72e2a59c 100644 GIT binary patch delta 127 zcmV-_0D%942Z#p=M@dFFIbje05U~jp18fig00?CO{|OvOu%N&|Rt{Q0$dF*5Yu6A$ zoCp!XKr7c+L1e|TqehGW0&!gEk<~(s7Eb~IurLt9l>h>PTq$rRE1ES8*1W0HAOM~{ h3H}5bRNw#s1Bx1DHKG8~o&uT*c&fCj)vEyk06ULKEW7{! delta 122 zcmV-=0EPdE2ZIL*M@dFFIbje04Y3Im17{5Y00>|J{{^!0PoR~72n!YrbnV)}h7cP9 zP-x{EtA?yHYP>j6V8(+RSsko6aU=i$2LlZ}2_R6%lLb$*f*Dhx&3^!9-rN~eC(oNX cJN{HSK)`^ZL|Kg}AoQnzr2?8F{TUDdJ9c;~-~a#s diff --git a/gen/ui/ckeditor/config.js b/gen/ui/ckeditor/config.js index 264560e..1513b78 100644 --- a/gen/ui/ckeditor/config.js +++ b/gen/ui/ckeditor/config.js @@ -6,7 +6,7 @@ CKEDITOR.editorConfig = function(config) { config.toolbar = 'Appy'; config.toolbar_Appy = [ { name: 'basicstyles', - items: ["Bold", "Italic", "Underline"]}, + items: ["Format", "Bold", "Italic", "Underline"]}, { name: 'paragraph', items: ["NumberedList","BulletedList","Outdent","Indent"]}, { name: 'clipboard', diff --git a/gen/ui/home.gif b/gen/ui/home.gif index b0caa86a0fe32166ba78b9427b41f5d16f564ec0..c203753bd45d91db9b616c4f0898b46117eee837 100644 GIT binary patch delta 82 zcmX@hvXf;)AEVAs7Dg_HdIlW^AP@jT2KH$U^-aw!t!+&@I_+(`wl=!m&6;)&_I8>R jCtqYtll1kOr(+P(c!-5lP|hS_0)yj{b^&fyCI)K&zkU|l delta 102 zcmdnVa+YO7AEWa>LFb~>#FEq$h4Rdj31pDc`A4D}2;3_u_NgbeIc8|s^y zTUy)NJ36~`bh?^#ZEbY>H0>Ph?KC?l?_x|7n`KbB=|BK0m#~UU#f1h(CYEL_vbF=4e z;&ib}NVQsInVRC|$l1i<5WL9b)S}6(OsXM^oHf;L7Fnw?H8Cn^L@e6HptISvt(~EX z!Dqz2YBK06_y7NT6ULgoqL(HeiszV8EaP4>EA*Fk-|94H+I3 QD5T(k&6_qA3 - Creator and last modification date Plus/minus icon for accessing history diff --git a/gen/ui/result.pt b/gen/ui/result.pt index 0541db5..5b75c8b 100644 --- a/gen/ui/result.pt +++ b/gen/ui/result.pt @@ -3,10 +3,12 @@ Title - - -
+ + Actions: edit, delete
Show query results as a list. - +
Headers, with filters and sort arrows - +
+ showNewSearch showNewSearch|python:True; + enableLinks enableLinks|python: True"> Display here POD templates if required. diff --git a/gen/ui/template.pt b/gen/ui/template.pt index 9f49b27..b4e6abc 100644 --- a/gen/ui/template.pt +++ b/gen/ui/template.pt @@ -32,6 +32,45 @@ + Grey background shown when popups are shown +
+ + Popup for confirming an action + + Popup for reinitializing the password + + Top banner @@ -77,44 +116,6 @@
- Grey background shown when popups are shown -
- - Popup for confirming an action - - Popup for reinitializing the password - The user strip diff --git a/gen/ui/widgets/ref.pt b/gen/ui/widgets/ref.pt index 1a476ca..59fef9c 100644 --- a/gen/ui/widgets/ref.pt +++ b/gen/ui/widgets/ref.pt @@ -2,19 +2,23 @@ We begin with some sub-macros used within macro "show" defined below. - + Displays the title of a referenced object, with a link on it to reach the consult view for this object. If we are on a back reference, the link allows to reach the correct page where the forward reference is defined. If we are on a forward reference, the "nav" parameter is added to the URL for allowing to navigate from one object to the next/previous on ui/view. - - + + tal:attributes="href fullUrl" + tal:content="python: (not includeShownInfo) and obj.Title() or contextObj.getReferenceLabel(fieldName, obj.appy())"> @@ -202,8 +206,6 @@ -