Skip to content

Commit

Permalink
Merge branch 'main' into standard-operator-itemgetter
Browse files Browse the repository at this point in the history
  • Loading branch information
drfho authored Sep 29, 2024
2 parents 65e0839 + 7257a12 commit 05a7d59
Show file tree
Hide file tree
Showing 12 changed files with 116 additions and 84 deletions.
7 changes: 5 additions & 2 deletions Products/zms/_objattrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,14 +723,17 @@ def isActive(self, REQUEST):
def formatObjAttrValue(self, obj_attr, v, lang=None):

#-- DATATYPE
datatype = obj_attr.get('datatype_key', _globals.DT_UNKNOWN)
try:
datatype = obj_attr.get('datatype_key', _globals.DT_UNKNOWN)
except:
datatype = _globals.DT_UNKNOWN

#-- VALUE
if isinstance(v, str):
chars = ''.join([ x for x in string.whitespace if x != '\t'])
v = v.strip(chars)
# Retrieve v from options.
if 'options' in obj_attr:
if obj_attr is not None and 'options' in obj_attr:
options = obj_attr['options']
try:
i = options.index(int(v))
Expand Down
16 changes: 8 additions & 8 deletions Products/zms/import/exampledb.metaobj.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<item key="id"><![CDATA[com.zms.db.example]]></item>
<item key="name"><![CDATA[com.zms.db.example]]></item>
<item key="package"></item>
<item key="revision"><![CDATA[3.0.a]]></item>
<item key="revision"><![CDATA[5.0.0]]></item>
<item key="type"><![CDATA[ZMSPackage]]></item>
</dictionary>
</item>
Expand Down Expand Up @@ -96,7 +96,7 @@
records python:zmscontext.attr(metaObjAttrIds[0]);
metaObjAttrs python:[x for x in metaObj['attrs'][1:] if
x['id'] not in ['sort_id']
and x['custom']
and x.get('custom')
and x['type'] in zmscontext.metaobj_manager.valid_types
and not x['type'] in ['password']
]">
Expand All @@ -108,7 +108,7 @@
<div class="form-group row" style="margin:.5em">
<div class="input-group">
<input type="hidden" tal:attributes="name python:'filterattr%i'%filterIndex" value="%">
<input class="form-control form-control-sm" type="text" tal:attributes="name python:'filtervalue%i'%filterIndex; value python:request.SESSION.get('filtervalue%i_%s'%(filterIndex,zmscontext.id),'')" />
<input class="form-control" type="text" tal:attributes="name python:'filtervalue%i'%filterIndex; value python:request.SESSION.get('filtervalue%i_%s'%(filterIndex,zmscontext.id),'')" />
<div class="input-group-append">
<button type="submit" name="btn" class="btn btn-secondary" value="BTN_SEARCH" tal:attributes="title python:here.getZMILangStr('BTN_SEARCH')"><i class="fas fa-search"></i></button>
<button type="submit" name="btn" class="btn btn-secondary" value="BTN_RESET" tal:attributes="title python:here.getZMILangStr('BTN_RESET')"><i class="fas fa-times"></i></button>
Expand Down Expand Up @@ -159,7 +159,7 @@
<item key="id"><![CDATA[dept]]></item>
<item key="name"><![CDATA[Departments]]></item>
<item key="package"><![CDATA[com.zms.db.example]]></item>
<item key="revision"><![CDATA[3.0.0]]></item>
<item key="revision"><![CDATA[5.0.0]]></item>
<item key="type"><![CDATA[ZMSRecordSet]]></item>
</dictionary>
</item>
Expand Down Expand Up @@ -301,7 +301,7 @@
records python:zmscontext.attr(metaObjAttrIds[0]);
metaObjAttrs python:[x for x in metaObj['attrs'][1:] if
x['id'] not in ['sort_id']
and x['custom']
and x.get('custom')
and x['type'] in zmscontext.metaobj_manager.valid_types
and not x['type'] in ['password']
]">
Expand All @@ -313,7 +313,7 @@
<div class="form-group row" style="margin:.5em">
<div class="input-group">
<input type="hidden" tal:attributes="name python:'filterattr%i'%filterIndex" value="%">
<input class="form-control form-control-sm" type="text" tal:attributes="name python:'filtervalue%i'%filterIndex; value python:request.SESSION.get('filtervalue%i_%s'%(filterIndex,zmscontext.id),'')" />
<input class="form-control" type="text" tal:attributes="name python:'filtervalue%i'%filterIndex; value python:request.SESSION.get('filtervalue%i_%s'%(filterIndex,zmscontext.id),'')" />
<div class="input-group-append">
<button type="submit" name="btn" class="btn btn-secondary" value="BTN_SEARCH" tal:attributes="title python:here.getZMILangStr('BTN_SEARCH')"><i class="fas fa-search"></i></button>
<button type="submit" name="btn" class="btn btn-secondary" value="BTN_RESET" tal:attributes="title python:here.getZMILangStr('BTN_RESET')"><i class="fas fa-times"></i></button>
Expand Down Expand Up @@ -364,7 +364,7 @@
<item key="id"><![CDATA[emp]]></item>
<item key="name"><![CDATA[Employees]]></item>
<item key="package"><![CDATA[com.zms.db.example]]></item>
<item key="revision"><![CDATA[3.0.a]]></item>
<item key="revision"><![CDATA[5.0.0]]></item>
<item key="type"><![CDATA[ZMSRecordSet]]></item>
</dictionary>
</item>
Expand Down Expand Up @@ -480,7 +480,7 @@
<item key="id"><![CDATA[exampleDatabase]]></item>
<item key="name"><![CDATA[Example-Database]]></item>
<item key="package"><![CDATA[com.zms.db.example]]></item>
<item key="revision"><![CDATA[3.0.a]]></item>
<item key="revision"><![CDATA[5.0.0]]></item>
<item key="type"><![CDATA[ZMSDocument]]></item>
</dictionary>
</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ $ZMI.registerReady(function(){
$ZMI.setCursorAuto("EO bootstrap.plugin.zmi");

// Set Save-Button Behaviour: Menu Lock
$('#menulock').prop('checked', JSON.parse($ZMILocalStorageAPI.get('ZMS.menulock',false)));
$('#menulock').val(JSON.parse($ZMILocalStorageAPI.get('ZMS.menulock',0)));

// ZMSLightbox
$('a.zmslightbox, a.fancybox')
Expand Down Expand Up @@ -1755,7 +1755,7 @@ function zmiActionButtonsRefresh(sender,evt) {
* @param v Boolean value for new (un-)checked state.
*/
function zmiToggleSelectionButtonClick(sender,v) {
var $fm = $(sender).parents('form,.zmi-form-container');
var $fm = $(sender).closest('form,.zmi-form-container');
var $inputs = $('input:checkbox:not([id~="active"]):not([id~="attr_dc_coverage"])',$fm);
if (typeof v == "undefined") {
v = !$inputs.prop('checked');
Expand Down
11 changes: 11 additions & 0 deletions Products/zms/plugins/www/zmi.core.css
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,17 @@ input.btn.btn-file {
text-align:right;
width:100%;
}
.zmi .controls.save .btn:not(:last-child) {
margin-right:0.25rem;
}
.zmi .controls.save dialog#menulock_btn {
/* Hint: is dialog element for react on focus/click event */
display:inline-block;
position: relative;
}
.zmi .controls.save dialog#menulock_btn #menulock[value='0'] + #menulock_icon {
color:#bfc8cf;
}
.zmi .single-line {
width:100%;
flex-wrap:nowrap;
Expand Down
2 changes: 1 addition & 1 deletion Products/zms/zpt/ZMSIndex/manage_main.zpt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function openWindow(url) {
<legend>ZMSIndex</legend>
<div id="zmsindex" class="collapse show">
<div class="card-body">
<div class="form-group zms4-row mb-0">
<div class="form-group zmi-form-container zms4-row mb-0">
<div class="col-sm-12" data-label="ZMS-Clients">
<div class="zmi-sitemap-controls-container">
<div class="btn-group zmi-sitemap-controls">
Expand Down
26 changes: 13 additions & 13 deletions Products/zms/zpt/ZMSMetacmdProvider/manage_main.zpt
Original file line number Diff line number Diff line change
Expand Up @@ -186,21 +186,21 @@
<input type="hidden" name="lang" tal:attributes="value request/lang">
<div class="form-group col-12">
<div class="custom-file">
<input type="file" name="file" id="file" class="custom-file-input" value=""
<input type="file" name="file" id="file" class="custom-file-input" value=""
onchange="$('.custom-file label span').html($(this).val().replace(/^.*(\\|\/|\:)/, ''));" />
<label class="custom-file-label" for="file"><span tal:content="python:here.getZMILangStr('ATTR_FILE')">Choose file</span></label>
</div>
</div><!-- .form-group -->
<label class="col-12 control-label text-left"><span tal:content="python:here.getZMILangStr('OR').lower()">Or</span></label>
<div class="form-group col-12 mt-2">
<select id="init" name="init" multiple="multiple" class="form-control"
onfocus="zmiExpandConfFiles(this,'.metacmd.');$(this).addClass('expand');"
<select id="init" name="init" multiple="multiple" class="form-control"
onfocus="zmiExpandConfFiles(this,'.metacmd.');$(this).addClass('expand');"
onmouseover="zmiExpandConfFiles(this,'.metacmd.')">
<option value="">--- <tal:block tal:content="python:here.getZMILangStr('BTN_INIT')">Init</tal:block>... ---</option>
</select>
<style>
/*<!--*/
#init {
#init {
height:2rem;
overflow:unset !important;
overflow-x: hidden;
Expand All @@ -220,7 +220,7 @@
<div class="form-group row mt-5 mr-0">
<div class="controls save">
<button name="btn" type="submit" class="btn btn-primary" value="BTN_IMPORT" tal:content="python:here.getZMILangStr('BTN_IMPORT')">Import</button>
<button class="btn btn-secondary ml-1"
<button class="btn btn-secondary ml-1"
title="Check-Up: Compare working content model with the current ZMS source files."
onclick="$ZMI.iframe('./manage_customize_diff',{lang:getZMILang(),provider_id:'metacmd_manager',action:'manage_changeMetacmds'},{iframe:true,height:'600',title:$(this).attr('title')});return false">
<i class="fas fa-code-branch"></i>
Expand All @@ -233,8 +233,8 @@

<form class="form-horizontal card" tal:attributes="action action" method="post" enctype="multipart/form-data">
<input type="hidden" name="lang" tal:attributes="value request/lang">
<legend class="has_tooltip"
tal:attributes="title python:here.getZMILangStr('TIP_METACMD')"
<legend class="has_tooltip"
tal:attributes="title python:here.getZMILangStr('TIP_METACMD')"
tal:content="python:here.getZMILangStr('TAB_METACMD')">
Metacmd
</legend>
Expand Down Expand Up @@ -284,9 +284,9 @@
<tal:block tal:define="
ob python:getattr(here,metaCmd['id'],None);
revision python:metaCmd.get('revision','0.0.0');">
<tr class="zmi-selectable"
<tr class="zmi-selectable"
tal:attributes="
data-package package;
data-package package;
class python:(ob is None) and 'text-danger table-danger' or '';
title python:(ob is None) and '%s not found'%metaCmd['id'] or ''">
<td class="meta-ids text-center">
Expand All @@ -298,8 +298,8 @@
<tal:block tal:condition="python:metaCmd.get('acquired',False)">
<a target="_blank" data-turbolinks="false"
tal:attributes="
href python:'%s/metacmd_manager/manage_main?lang=%s&id=%s'%(context.getRootElement().absolute_url(),request['lang'],metaCmd['id']);
title python:'acquired from: %s (%s)'%(context.getRootElement().getHome().id, context.getRootElement().attr('titlealt'))"
href python:'%s/metacmd_manager/manage_main?lang=%s&id=%s'%(context.getHome().aq_parent.content.absolute_url(),request['lang'],metaCmd['id']);
title python:'acquired from: %s (%s)'%(context.getHome().aq_parent.content.id, context.getHome().aq_parent.content.attr('titlealt'))"
><i class="fas fa-share"></i></a>
<i tal:condition="python:metaCmd.get('icon_clazz',False)" tal:attributes="class python:metaCmd.get('icon_clazz')"></i>&nbsp;&nbsp;
<strong tal:content="python:metaCmd['id']">the id</strong> ( <tal:block tal:content="python:here.getZMILangStr(metaCmd['name'])">Name</tal:block> )
Expand All @@ -312,7 +312,7 @@
(<tal:block tal:content="python:here.getZMILangStr(metaCmd['name'])">the name</tal:block>)
</a>
</tal:block>
<tal:block tal:content="revision">the version</tal:block>
<tal:block tal:content="revision">the version</tal:block>
(<tal:block tal:content="python:metaCmd['meta_type']">the type</tal:block>)
</tal:block>
<tal:block tal:condition="python:ob is None"
Expand Down Expand Up @@ -424,4 +424,4 @@ $(function(){

<footer tal:replace="structure python:here.zmi_body_footer(here,request)">zmi_body_footer</footer>
</body>
</html>
</html>
Loading

0 comments on commit 05a7d59

Please sign in to comment.