diff --git a/gen/__init__.py b/gen/__init__.py index ef0071d..a887d93 100644 --- a/gen/__init__.py +++ b/gen/__init__.py @@ -1157,6 +1157,7 @@ class String(Type): # field of format CAPTCHA by page, because the captcha challenge is # stored in the session at some global key. self.format = format + self.isUrl = validator == String.URL # When format is XHTML, the list of styles that the user will be able to # select in the styles dropdown is defined hereafter. self.styles = styles @@ -1225,6 +1226,8 @@ class String(Type): return {'view': 'l-f', 'edit': 'lrv-f'} def getValue(self, obj): + # Cheat if this field represents p_obj's state + if self.name == 'state': return obj.State() value = Type.getValue(self, obj) if not value: if self.isMultiValued(): return emptyTuple diff --git a/gen/generator.py b/gen/generator.py index 0fd6baf..86e2346 100644 --- a/gen/generator.py +++ b/gen/generator.py @@ -404,7 +404,6 @@ class ZopeGenerator(Generator): msg('modified_field', '', msg.MODIFIED_FIELD), msg('previous_value', '', msg.PREVIOUS_VALUE), msg('phase', '', msg.PHASE), - msg('root_type', '', msg.ROOT_TYPE), msg('workflow_comment', '', msg.WORKFLOW_COMMENT), msg('choose_a_value', '', msg.CHOOSE_A_VALUE), msg('choose_a_doc', '', msg.CHOOSE_A_DOC), @@ -412,7 +411,6 @@ class ZopeGenerator(Generator): msg('max_ref_violated', '', msg.MAX_REF_VIOLATED), msg('no_ref', '', msg.REF_NO), msg('add_ref', '', msg.REF_ADD), - msg('ref_actions', '', msg.REF_ACTIONS), msg('action_ok', '', msg.ACTION_OK), msg('action_ko', '', msg.ACTION_KO), msg('move_up', '', msg.REF_MOVE_UP), diff --git a/gen/mixins/ToolMixin.py b/gen/mixins/ToolMixin.py index 0cc4efb..a028336 100644 --- a/gen/mixins/ToolMixin.py +++ b/gen/mixins/ToolMixin.py @@ -545,6 +545,11 @@ class ToolMixin(BaseMixin): appyType = self.getAppyType(name, className=className) if appyType: return appyType.isSortable(usage=usage) + def subTitleIsUsed(self, className): + '''Does class named p_className define a method "getSubTitle"?''' + klass = self.getAppyClass(className) + return hasattr(klass, 'getSubTitle') + def _searchValueIsEmpty(self, key): '''Returns True if request value in key p_key can be considered as empty.''' diff --git a/gen/mixins/__init__.py b/gen/mixins/__init__.py index 11eb33f..79c36b1 100644 --- a/gen/mixins/__init__.py +++ b/gen/mixins/__init__.py @@ -687,17 +687,11 @@ class BaseMixin: '''Gets the Appy types named p_fieldNames.''' res = [] for name in fieldNames: - if name == 'state': - # We do not return a appyType if the attribute is not a *real* - # attribute, but the workfow state. - res.append({'name': name, 'labelId': 'workflow_state', - 'filterable': False}) + appyType = self.getAppyType(name, asDict) + if appyType: res.append(appyType) else: - appyType = self.getAppyType(name, asDict) - if appyType: res.append(appyType) - else: - self.log('Field "%s", used as shownInfo in a Ref, ' \ - 'was not found.' % name, type='warning') + self.log('Field "%s", used as shownInfo in a Ref, ' \ + 'was not found.' % name, type='warning') return res def getAppyStates(self, phase, currentOnly=False): @@ -820,6 +814,18 @@ class BaseMixin: else: return res + def getIcons(self): + '''Gets the icons that can be shown besides the title of an object.''' + appyObj = self.appy() + if hasattr(appyObj, 'getIcons'): return appyObj.getIcons() + return '' + + def getSubTitle(self): + '''Gets the content that must appear below the title of an object.''' + appyObj = self.appy() + if hasattr(appyObj, 'getSubTitle'): return appyObj.getSubTitle() + return '' + def getPreviousPage(self, phase, page): '''Returns the page that precedes p_page which is in p_phase.''' try: diff --git a/gen/po.py b/gen/po.py index a108de2..4073fbe 100644 --- a/gen/po.py +++ b/gen/po.py @@ -40,7 +40,6 @@ class PoMessage: POD_ASKACTION = 'Trigger related action' REF_NO = 'No object.' REF_ADD = 'Add a new one' - REF_ACTIONS = 'Actions' REF_MOVE_UP = 'Move up' REF_MOVE_DOWN = 'Move down' REF_INVALID_INDEX = 'No move occurred: please specify a valid number.' @@ -69,7 +68,6 @@ class PoMessage: MODIFIED_FIELD = 'Modified field' PREVIOUS_VALUE = 'Previous value' PHASE = 'phase' - ROOT_TYPE = 'type' CHOOSE_A_VALUE = ' - ' CHOOSE_A_DOC = '[ Documents ]' MIN_REF_VIOLATED = 'You must choose more elements here.' diff --git a/gen/ui/appy.css b/gen/ui/appy.css index 1bcce9b..df31790 100644 --- a/gen/ui/appy.css +++ b/gen/ui/appy.css @@ -92,11 +92,12 @@ img { border: 0; vertical-align: middle} .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: #d7dee4; font-style: italic; font-weight: normal;} +.list th { background-color: #d7dee4; font-style: italic; font-weight: normal; + text-align: left } .grid th { font-style: italic; font-weight: normal; - border-bottom: 2px solid grey; padding: 2px 2px;} -.grid td { padding-right: 5px; } -.cellGap { padding-right: 0.4em; } + border-bottom: 2px solid grey; padding: 2px 2px } +.grid td { padding-right: 5px } +.cellGap { padding-right: 0.4em } .cellDashed { border: 1px dashed grey !important } .noStyle { border: 0 !important; padding: 0 !important; margin: 0 !important; } .noStyle td { border:0 !important; padding:0 !important; margin:0 !important; } diff --git a/gen/ui/appy.js b/gen/ui/appy.js index 0dc007d..a579491 100644 --- a/gen/ui/appy.js +++ b/gen/ui/appy.js @@ -200,6 +200,26 @@ function toggleCheckbox(visibleCheckbox, hiddenBoolean) { else hidden.value = 'False'; } +// Function that sets a value for showing/hiding sub-titles. +function setSubTitles(value) { + createCookie('showSubTitles', value); + // Get the sub-titles + var subTitles = document.getElementsByName('subTitle'); + if (subTitles.length == 0) return; + for (var i=0; i < subTitles.length; i++) { + if (value == 'true') subTitles[i].style.display = 'block'; + else subTitles[i].style.display = 'none'; + } +} + +// Function that toggles the value for showing/hiding sub-titles. +function toggleSubTitles() { + var value = readCookie('showSubTitles'); + var newValue = 'true'; + if (value == 'true') newValue = 'false'; + setSubTitles(newValue); +} + // Functions used for master/slave relationships between widgets function getSlaveInfo(slave, infoType) { // Returns the appropriate info about slavery, depending on p_infoType. diff --git a/gen/ui/arrowDown.png b/gen/ui/arrowDown.png index dbfc3c5..262e0a1 100644 Binary files a/gen/ui/arrowDown.png and b/gen/ui/arrowDown.png differ diff --git a/gen/ui/arrowUp.png b/gen/ui/arrowUp.png index 5277081..16bd4ec 100644 Binary files a/gen/ui/arrowUp.png and b/gen/ui/arrowUp.png differ diff --git a/gen/ui/delete.png b/gen/ui/delete.png index f577d4c..a0bed4e 100644 Binary files a/gen/ui/delete.png and b/gen/ui/delete.png differ diff --git a/gen/ui/edit.gif b/gen/ui/edit.gif index 2c8d2ca..5fd9cfa 100644 Binary files a/gen/ui/edit.gif and b/gen/ui/edit.gif differ diff --git a/gen/ui/import.pt b/gen/ui/import.pt index 911eeda..867ba77 100644 --- a/gen/ui/import.pt +++ b/gen/ui/import.pt @@ -70,11 +70,11 @@ style="cursor:pointer" onClick="toggleViewableElements()" align="left" /> -
+ |
+ |
||
diff --git a/gen/ui/query.pt b/gen/ui/query.pt
index 5517435..032e3ac 100644
--- a/gen/ui/query.pt
+++ b/gen/ui/query.pt
@@ -3,15 +3,8 @@
|