hide status widget if there is no states for object
This commit is contained in:
parent
8a4f612c77
commit
037df7cb61
2 changed files with 9 additions and 6 deletions
5
browser/common.py
Normal file → Executable file
5
browser/common.py
Normal file → Executable file
|
@ -712,8 +712,11 @@ class BaseView(GenericView, I18NView):
|
|||
if IResource.providedBy(self.target):
|
||||
statesDefs = self.globalOptions('organize.stateful.resource', ())
|
||||
else:
|
||||
typeOptions = self.typeOptions('organize.stateful')
|
||||
if typeOptions is None:
|
||||
typeOptions = []
|
||||
statesDefs = (self.globalOptions('organize.stateful.concept', []) +
|
||||
self.typeOptions('organize.stateful', []))
|
||||
typeOptions)
|
||||
for std in statesDefs:
|
||||
stf = component.getAdapter(self.target, IStateful, name=std)
|
||||
result.append(stf)
|
||||
|
|
8
browser/form_macros.pt
Normal file → Executable file
8
browser/form_macros.pt
Normal file → Executable file
|
@ -265,7 +265,7 @@
|
|||
<label style="display: inline"
|
||||
for="version.create"><span i18n:translate="">
|
||||
New version</span></label>
|
||||
<tal:level condition="python: len(view.versionLevels) > 1">:
|
||||
<tal:level condition="python: len(list(view.versionLevels)) > 1">:
|
||||
<select name="version.level">
|
||||
<option tal:repeat="level view/versionLevels"
|
||||
i18n:translate=""
|
||||
|
@ -278,11 +278,11 @@
|
|||
</metal:versioning>
|
||||
|
||||
|
||||
<metal:states define-macro="states">
|
||||
<tr><td colspan="5" i18n:translate="" class="headline">States</td></tr>
|
||||
<metal:states define-macro="states_info"
|
||||
<metal:states define-macro="states"
|
||||
tal:define="states view/states"
|
||||
tal:condition="states">
|
||||
<tr><td colspan="5" i18n:translate="" class="headline">States</td></tr>
|
||||
<metal:states define-macro="states_info">
|
||||
<tr tal:repeat="st states">
|
||||
<tal:state define="stObj st/getStateObject;
|
||||
stDef st/statesDefinition;
|
||||
|
|
Loading…
Add table
Reference in a new issue