conga/luci homebase/form-macros homebase/homeb ...
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2008-01-22 15:02:33
Modified files:
luci/homebase : form-macros homebase_common.js index_html
validate_cluster_add_initial.js validate_sys_remove.js
luci/plone-custom: conga.js conga_ajax.js
luci/cluster : form-chooser form-macros index_html
Added files:
luci/plone-custom: update_hostinfo.js validate_auth.js
Log message:
sync up with my local tree
- fixes for 252348 and 230462
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/form-macros.diff?cvsroot=cluster&r1=1.64&r2=1.65
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/homebase_common.js.diff?cvsroot=cluster&r1=1.23&r2=1.24
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/index_html.diff?cvsroot=cluster&r1=1.25&r2=1.26
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/validate_cluster_add_initial.js.diff?cvsroot=cluster&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/validate_sys_remove.js.diff?cvsroot=cluster&r1=1.6&r2=1.7
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/update_hostinfo.js.diff?cvsroot=cluster&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/validate_auth.js.diff?cvsroot=cluster&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/conga.js.diff?cvsroot=cluster&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/conga_ajax.js.diff?cvsroot=cluster&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-chooser.diff?cvsroot=cluster&r1=1.23&r2=1.24
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.218&r2=1.219
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/index_html.diff?cvsroot=cluster&r1=1.40&r2=1.41
luci/homebase/form-macros +120 -112
@@ -289,6 +289,9 @@ -> if yes, confirm again, showing list </tal:comment> + <script type="text/javascript" src="conga_ajax.js"></script> + <script type="text/javascript" src="update_hostinfo.js"></script> + <script type="text/javascript" src="validate_auth.js"></script> <script type="text/javascript" src="/luci/homebase/validate_sys_remove.js"> </script>
@@ -313,6 +316,7 @@ <tr class="systemsTable"> <th class="systemsTable">System Hostname</th> <th class="systemsTable">Root Password</th> + <th class="systemsTable">Key ID</th> <th class="systemsTable"></th> </tr> </thead>
@@ -321,6 +325,7 @@ <tr class="systemsTable" id="__SYSTEM_ROW_0"> <td class="systemsTable"> <input class="hbInputSys" type="text" + onchange="reset_system_info(this)" id="__SYSTEM0:Addr" name="__SYSTEM0:Addr" /> </td> <td class="systemsTable">
@@ -332,6 +337,10 @@ onchange="pwd0Change(this.form)" /> </td> <td class="systemsTable"> + <img id="__SYSTEM0Fingerprint" src="lock-open.png" + title="no key fingerprint available" /> + </td> + <td class="systemsTable"> <img src="delete-row.png" class="deleteRow" title="delete this row" onclick="delete_element_id('__SYSTEM_ROW_0')" />
@@ -363,6 +372,7 @@ <input type="hidden" name="trust_shown" value="1" /> <input class="hbInputSys" type="text" + onchange="reset_system_info(this)" tal:attributes=" id python: '__SYSTEM%d:Addr' % cur_sysnum; name python: '__SYSTEM%d:Addr' % cur_sysnum;
@@ -379,10 +389,10 @@ value nothing" /> </td> <td class="systemsTable"> - <img - tal:attributes=" - src python: 'trusted' in sys and 'lock-ok.png' or ('fp' in sys and 'lock-closed.png' or 'lock-open.png'); - title sys/fp | string:no key fingerprint available" + <img tal:attributes=" + id python: '__SYSTEM%dFingerprint' % cur_sysnum; + src python: 'trusted' in sys and 'lock-ok.png' or ('fp' in sys and 'lock-closed.png' or 'lock-open.png'); + title sys/fp | string:no key fingerprint available" /> <input type="hidden" tal:condition="exists: sys/fp"
@@ -416,10 +426,6 @@ <tfoot class="systemsTable"> <tr class="systemsTable"><td colspan="2" class="systemsTable"> <ul class="vanilla"> - <li class="vanilla"> - <input name="check_certs" id="view_certs" - onchange="view_certs_only(this.form, this.checked)" - type="checkbox">View system certificates before sending any passwords.</li> <li class="vanilla" tal:attributes="id python: cur_sysnum < 2 and 'allSameDiv' or ''"> <input type="checkbox" name="allSameCheckBox"
@@ -441,38 +447,55 @@ <input name="numStorage" id="numStorage" type="hidden" tal:attributes="value cur_sysnum | string:1" /> - <input type="hidden" name="pagetype" value="8" /> + <input type="hidden" name="pagetype" value="1003" /> + + <div class="hbSubmit"> + <div class="hbSubmit"> + <input type="button" name="View SSL cert fingerprints" + value="View SSL cert fingerprints" + onclick="get_system_info('auth_retmsgsdiv', 'auth_errmsgsdiv')" /> + </div> <div class="hbSubmit" id="hbSubmit"> <input type="button" name="Submit" value="Submit" onclick="validateAuth(this.form)" /> </div> - <tal:block tal:condition="exists: request/SESSION/auth_status"> - <div class="retmsgs" id="auth_retmsgsdiv" - tal:condition="exists: request/SESSION/auth_status/messages"> - <div class="hbclosebox"> - <a href="javascript:hide_element('auth_retmsgsdiv');"><img src="x.png" class="closeBox" title="dismiss"></a> - </div> - <p class="retmsgs">Status messages:</p> - <ul class="statusmsg"> - <tal:block tal:repeat="e request/SESSION/auth_status/messages"> - <li class="statusmsg" tal:content="e" /> - </tal:block> - </ul> + <tal:block tal:define="global have_retmsgs exists:request/SESSION/auth_status/messages" /> + <tal:block tal:define="global have_errmsgs exists:request/SESSION/auth_status/errors" /> + + <div id="auth_retmsgsdiv" + tal:attributes="class python:'retmsgs' + (have_retmsgs and ' ' or ' invisible')"> + <div class="hbclosebox"> + <a href="javascript:hide_msgs('auth_retmsgsdiv')"><img src="x.png" class="closeBox" title="dismiss"></a> </div> - <div class="errmsgs" id="auth_errmsgsdiv" - tal:condition="exists: request/SESSION/auth_status/errors"> - <div class="hbclosebox"> - <a href="javascript:hide_element('auth_errmsgsdiv');"><img src="x.png" class="closeBox" title="dismiss"></a> - </div> - <p class="errmsgs">The following errors occurred:</p> - <ul class="statusmsg"> - <tal:block tal:repeat="e request/SESSION/auth_status/errors"> - <li class="statusmsg" tal:content="e" /> - </tal:block> - </ul> + + <p class="retmsgs">Status messages:</p> + <ul class="statusmsg"> + <tal:block + tal:condition="exists:request/SESSION/auth_status/messages" + tal:repeat="e request/SESSION/auth_status/messages"> + <li class="statusmsg" tal:content="e" /> + </tal:block> + </ul> + </div> + + <div id="auth_errmsgsdiv" + tal:attributes="class python:'errmsgs' + (have_errmsgs and ' ' or ' invisible')"> + <div class="hbclosebox"> + <a href="javascript:hide_msgs('auth_errmsgsdiv')"><img src="x.png" class="closeBox" title="dismiss"></a> </div> + <p class="errmsgs">The following errors occurred:</p> + <ul class="statusmsg"> + <tal:block + tal:condition="exists:request/SESSION/auth_status/errors" + tal:repeat="e request/SESSION/auth_status/errors"> + <li class="statusmsg" tal:content="e" /> + </tal:block> + </ul> + </div> + + <tal:block tal:condition="exists:request/SESSION/auth_status"> <tal:block tal:define="x python: request.SESSION.delete('auth_status')" /> <div class="padding"> </div>
@@ -589,6 +612,8 @@ <script type="text/javascript" src="/luci/homebase/validate_sys_add.js"> </script> + <script type="text/javascript" src="conga_ajax.js"></script> + <script type="text/javascript" src="update_hostinfo.js"></script> <script type="text/javascript"> set_page_title('Luci ??? homebase ??? Add a storage system to be managed by Luci');
@@ -610,6 +635,7 @@ <tr class="systemsTable"> <th class="systemsTable">System Hostname</th> <th class="systemsTable">Root Password</th> + <th class="systemsTable">Key ID</th> <th class="systemsTable"></th> </tr> </thead>
@@ -618,6 +644,7 @@ <tr class="systemsTable" id="__SYSTEM_ROW_0"> <td class="systemsTable"> <input class="hbInputSys" type="text" + onchange="reset_system_info(this)" id="__SYSTEM0:Addr" name="__SYSTEM0:Addr" /> </td> <td class="systemsTable">
@@ -629,6 +656,10 @@ onchange="pwd0Change(this.form)" /> </td> <td class="systemsTable"> + <img src="lock-open.png" id="__SYSTEM0Fingerprint" + title="no key fingerprint available" /> + </td> + <td class="systemsTable"> <img src="delete-row.png" class="deleteRow" title="delete this row" onclick="delete_element_id('__SYSTEM_ROW_0')" />
@@ -643,7 +674,6 @@ <th class="systemsTable">System Hostname</th> <th class="systemsTable">Root Password</th> <th class="systemsTable">Key ID</th> - <th class="systemsTable">Trust</th> <th class="systemsTable"></th> </tr> </thead>
@@ -660,6 +690,7 @@ <input type="hidden" name="trust_shown" value="1" /> <input class="hbInputSys" type="text" + onchange="reset_system_info(this)" tal:attributes=" id python: '__SYSTEM%d:Addr' % cur_sysnum; name python: '__SYSTEM%d:Addr' % cur_sysnum;
@@ -677,17 +708,10 @@ </td> <td class="systemsTable"> - <img - tal:attributes=" - src python: 'trusted' in sys and 'lock-ok.png' or ('fp' in sys and 'lock-closed.png' or 'lock-open.png'); - title sys/fp | string:no key fingerprint available" - /> - <input type="hidden" - tal:condition="exists: sys/fp" - tal:attributes=" - id python: '__SYSTEM%dFingerprint' % cur_sysnum; - name python: '__SYSTEM%dFingerprint' % cur_sysnum; - value sys/fp | nothing" /> + <img tal:attributes=" + id python: '__SYSTEM%dFingerprint' % cur_sysnum; + src python: 'trusted' in sys and 'lock-ok.png' or ('fp' in sys and 'lock-closed.png' or 'lock-open.png'); + title sys/fp | string:no key fingerprint available" /> </td> <td class="systemsTable"> <input type="checkbox" checked tal:attributes="
@@ -714,12 +738,8 @@ <tfoot class="systemsTable"> <tr class="systemsTable"><td colspan="2" class="systemsTable"> <ul class="vanilla"> - <li class="vanilla"> - <input name="check_certs" id="view_certs" - onchange="view_certs_only(this.form, this.checked)" - type="checkbox">View system certificates before sending any passwords.</li> <li class="vanilla" - tal:attributes="id python: cur_sysnum < 2 and 'allSameDiv' or ''"><input type="checkbox" name="allSameCheckBox" id="allSameCheckBox" onclick="allPasswdsSame(this.form);"/>Check if storage system passwords are identical.</li> + tal:attributes="id python: cur_sysnum < 2 and 'allSameDiv' or ''"><input type="checkbox" name="allSameCheckBox" id="allSameCheckBox" onclick="allPasswdsSame(this.form);"/>Check if system passwords are identical.</li> </ul> </td></tr>
@@ -729,6 +749,15 @@ onclick="addSystem(this.form)" /> </div> </td></tr> + + <tr class="systemsTable"><td class="systemsTable" colspan="2"> + <div class="systemsTableEnd"> + <input type="button" + name="View SSL cert fingerprints" + value="View SSL cert fingerprints" + onclick="get_system_info('retmsgsdiv', 'errmsgsdiv')" /> + </div> + </td></tr> </tfoot> </table>
@@ -801,8 +830,7 @@ <tr class="systemsTable"> <th class="systemsTable">Node Hostname</th> <th class="systemsTable">Root Password</th> - <th tal:condition="asked_for_certs" class="systemsTable">Key ID</th> - <th tal:condition="asked_for_certs" class="systemsTable">Trust</th> + <th class="systemsTable">Key ID</th> </tr> </thead>
@@ -811,12 +839,6 @@ <tr class="systemsTable"><td colspan="2" class="systemsTable"> <input type="hidden" name="trust_shown" value="1" /> <ul class="vanilla"> - <li class="vanilla"> - <input name="check_certs" type="checkbox" - id="view_certs" - onchange="view_certs_only(this.form, this.checked)" /> - View system certificates before sending any passwords. - </li> <li class="vanilla" id="allSameDiv"> <li class="vanilla" tal:condition="not: exists: add_cluster/complete"> <input type="checkbox" name="allSameCheckBox"
@@ -845,6 +867,7 @@ tal:define="sys python: add_cluster['nodes'][cur_sys]"> <td class="systemsTable"> <input type="text" + onchange="reset_system_info(this)" tal:attributes=" value sys/host | nothing; id python: '__SYSTEM%d:Addr' % cur_sysnum;
@@ -874,39 +897,12 @@ name python: '__SYSTEM%d:Passwd' % cur_sysnum" /> </tal:block> </td> - <td tal:condition="asked_for_certs" class="systemsTable"> - <img - tal:attributes=" - src python: 'trusted' in sys and 'lock-ok.png' or ('fp' in sys and 'lock-closed.png' or 'lock-open.png'); - title sys/fp | string:no key fingerprint available" /> - <input type="hidden" - tal:condition="exists: sys/fp" - tal:attributes=" - id python: '__SYSTEM%dFingerprint' % cur_sysnum; - name python: '__SYSTEM%dFingerprint' % cur_sysnum; - value sys/fp | nothing" /> - </td> - <td tal:condition="asked_for_certs" class="systemsTable"> - <input type="checkbox" - tal:attributes=" - checked python: sys.has_key('fp') or sys.has_key('trusted'); - id python: '__SYSTEM%dTrusted' % cur_sysnum; - name python: '__SYSTEM%dTrusted' % cur_sysnum; - disabled python: sys.has_key('trusted')" /> + <td class="systemsTable"> + <img tal:attributes=" + id python: '__SYSTEM%dFingerprint' % cur_sysnum; + src python: 'trusted' in sys and 'lock-ok.png' or ('fp' in sys and 'lock-closed.png' or 'lock-open.png'); + title sys/fp | string:no key fingerprint available" /> </td> - <tal:block tal:condition="python:not asked_for_certs"> - <input type="hidden" value="1" - tal:attributes=" - id python: '__SYSTEM%dTrusted' % cur_sysnum; - name python: '__SYSTEM%dTrusted' % cur_sysnum" - /> - <input type="hidden" - tal:condition="exists: sys/fp" - tal:attributes=" - id python: '__SYSTEM%dFingerprint' % cur_sysnum; - name python: '__SYSTEM%dFingerprint' % cur_sysnum; - value sys/fp | nothing" /> - </tal:block> </tr> <tal:block tal:define="global cur_sysnum python: cur_sysnum + 1" /> </tal:block>
@@ -944,14 +940,17 @@ - At least one node name/password are given and are valid </tal:comment> + <script type="text/javascript" src="conga_ajax.js"></script> + <script type="text/javascript" src="update_hostinfo.js"></script> <script type="text/javascript" src="/luci/homebase/validate_cluster_add_initial.js"> </script> + <script type="text/javascript"> set_page_title('Luci ??? homebase ??? Add a running cluster to be managed by Luci'); </script> <form name="adminform" action="" method="post"> - <input name="pagetype" type="hidden" + <input name="pagetype" type="hidden" id="pagetype" tal:attributes="value request/form/pagetype | request/pagetype | nothing" /> <h2 class="homebase">Add an Existing Cluster</h2>
@@ -962,26 +961,32 @@ tal:define="cur_sys request/SESSION/add_cluster_initial | nothing"> <thead class="systemsTable"> + <tr class="systemsTable"><td class="systemsTable" colspan="2"> + <div class="systemsTableTop"> + <strong class="cluster_name invisible" id="cluname_elem">Cluster Name: + </strong> + <input type="hidden" id="clustername" name="clustername" value="" /> + <input type="hidden" id="cluster_os" name="cluster_os" value="rhel5" /> + </div> + </td></tr> + <tr class="systemsTable"> <th class="systemsTable">System Hostname</th> <th class="systemsTable">Root Password</th> - <tal:block tal:condition="cur_sys"> - <th>Key Id</th> - <th>Trust</th> - </tal:block> + <th>Key ID</th> </tr> </thead> <tfoot class="systemsTable"> <tr class="systemsTable"><td colspan="2" class="systemsTable"> - <input type="hidden" name="trust_shown" value="1" - tal:condition="cur_sys" /> - + <input type="hidden" name="trust_shown" value="1" /> + </td></tr> + <tr class="systemsTable"><td colspan="2" class="systemsTable"> <ul class="vanilla"> - <li class="vanilla"> - <input name="check_certs" id="view_certs" - onchange="view_certs_only(this.form, this.checked)" - type="checkbox">View system certificates before sending any passwords. + <li class="vanilla" id="allSameDiv"> + <input type="checkbox" name="allSameCheckBox" + id="allSameCheckBox" onclick="allPasswdsSame(this.form)" /> + Check if system passwords are identical. </li> </ul> </td></tr>
@@ -991,6 +996,7 @@ <tr class="systemsTable"> <td class="systemsTable"> <input class="hbInputSys" type="text" + onchange="reset_system_info(this)" id="__SYSTEM0:Addr" name="__SYSTEM0:Addr" tal:attributes=" value cur_sys/host | nothing" />
@@ -1003,26 +1009,28 @@ tal:attributes=" value nothing" /> </td> - <tal:block tal:condition="cur_sys"> - <td class="systemsTable"> - <img tal:attributes=" + <td class="systemsTable"> + <img id="__SYSTEM0Fingerprint" + tal:attributes=" title sys/fp | string:no key fingerprint available; - src python: 'trusted' in cur_sys and 'lock-ok.png' or ('fp' in cur_sys and 'lock-closed.png' or 'lock-open.png')" - /> - </td> - <td class="systemsTable"> - <input type="checkbox" name="host_is_trusted" checked="checked" /> - </td> - </tal:block> + src python: (cur_sys and cur_sys.has_key('trusted')) and 'lock-ok.png' or ((cur_sys and cur_sys.has_key('fp')) and 'lock-closed.png' or 'lock-open.png')" + /> + </td> </tr> </tbody> + <tal:block tal:condition="cur_sys"> <tal:block tal:define="x python: request.SESSION.delete('add_cluster_initial')" /> </tal:block> </table> - <input type="hidden" name="numStorage" value="1" /> + <input type="hidden" id="numStorage" name="numStorage" value="1" /> + + <div class="hbSubmit"> + <input type="button" name="View SSL cert fingerprints" + value="View SSL cert fingerprints" onclick="get_system_info('retmsgsdiv', 'errmsgsdiv')" /> + </div> <div class="hbSubmit" id="hbSubmit"> <input type="button" name="Submit" value="Submit"
luci/homebase/homebase_common.js +98 -10
137 lines not on this page · raw message
luci/homebase/index_html +17 -14
@@ -114,35 +114,38 @@ Homebase </metal:main_form> - <tal:block tal:condition="python: request.SESSION.has_key('checkRet')" - tal:define="ret python: request.SESSION.get('checkRet')"> - - <div class="retmsgs" id="retmsgsdiv" tal:condition="python:(ret and 'messages' in ret and len(ret['messages']))"> + <tal:block tal:define="ret python: request.SESSION.get('checkRet')"> + <div id="retmsgsdiv" + tal:attributes="class python:'retmsgs' + ((ret and ret.get('messages') and len(ret.get('messages')) > 0) and ' ' or ' invisible')"> <div class="hbclosebox"> - <img onclick="hide_element('retmsgsdiv')" src="x.png" class="closeBox" title="dismiss" /> + <img onclick="hide_msgs('retmsgsdiv')" + src="x.png" class="closeBox" title="dismiss" /> </div> <p class="retmsgs">Status messages:</p> - <ul class="statusmsg"> - <tal:block tal:repeat="e python:ret['messages']"> - <li class="statusmsg" tal:content="python:e" /> + <ul class="statusmsg" id="statusmsglist"> + <tal:block tal:condition="exists:ret/messages" + tal:repeat="e ret/messages"> + <li class="statusmsg" tal:content="e" /> </tal:block> </ul> </div> - <div id="errmsgsdiv" class="errmsgs" tal:condition="python:(ret and 'errors' in ret and len(ret['errors']))"> + <div id="errmsgsdiv" + tal:attributes="class python:'errmsgs' + ((ret and ret.get('errors') and len(ret.get('errors')) > 0) and ' ' or ' invisible')"> <div class="hbclosebox"> - <img onclick="hide_element('errmsgsdiv')" src="x.png" class="closeBox" title="dismiss"> + <img onclick="hide_msgs('errmsgsdiv')" + src="x.png" class="closeBox" title="dismiss" /> </div> <p class="errmsgs">The following errors occurred:</p> - <ul class="statusmsg"> - <tal:block tal:repeat="e python:ret['errors']"> - <li class="statusmsg" tal:content="python:e" /> + <ul class="statusmsg" id="errmsglist"> + <tal:block tal:condition="exists:ret/errors" + tal:repeat="e ret/errors"> + <li class="statusmsg" tal:content="e" /> </tal:block> </ul> </div> </tal:block> - </div> </div>
luci/homebase/validate_cluster_add_initial.js +154 -3
173 lines not on this page · raw message
luci/homebase/validate_sys_remove.js +1 -2
@@ -82,6 +82,5 @@ return (-1); } - form.submit(); - return (0); + validate_auth_form(form, 'auth_retmsgsdiv', 'auth_errmsgsdiv'); }
/cvs/cluster/conga/luci/plone-custom/update_hostinfo.js,v --> standard output revision 1.1
- renamed from luci/plone-custom/update_hostinfo.js +144 -0
144 lines not on this page · raw message
/cvs/cluster/conga/luci/plone-custom/validate_auth.js,v --> standard output revision 1.1
- renamed from luci/plone-custom/validate_auth.js +143 -0
143 lines not on this page · raw message
luci/plone-custom/conga.js +50 -0
56 lines not on this page · raw message
luci/plone-custom/conga_ajax.js +1 -1
@@ -68,7 +68,7 @@ xmlHttp_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttp_object.setRequestHeader("Content-length", form_data_str.length); xmlHttp_object.setRequestHeader("Connection", "close"); - xmlHttp_object.send(form_data_str); + xmlHttp_object.send(form_data_str.substr(0, form_data_str.length - 1)); } function get_ajax_msgs(obj, tag_name) {
luci/cluster/form-chooser +4 -0
@@ -225,6 +225,10 @@ <tal:block tal:condition="python: ptype == '1000'"> <div metal:use-macro="here/form-macros/macros/get-cluster-members-form" /> </tal:block> + + <tal:block tal:condition="python: ptype == '1002'"> + <div metal:use-macro="here/form-macros/macros/get-system-info-form" /> + </tal:block> </tal:block> </metal:choose-form>
luci/cluster/form-macros +51 -52
228 lines not on this page · raw message
luci/cluster/index_html +16 -13
@@ -214,35 +214,38 @@ </div> </div> - <tal:block tal:condition="python: request.SESSION.has_key('checkRet')"> - <tal:block tal:define="ret python: request.SESSION.get('checkRet')"> - <div class="retmsgs" id="retmsgsdiv" tal:condition="python:(ret and 'messages' in ret and len(ret['messages']))"> + <tal:block tal:define="ret python: request.SESSION.get('checkRet')"> + <div id="retmsgsdiv" + tal:attributes="class python:'retmsgs' + ((ret and ret.get('messages') and len(ret.get('messages')) > 0) and ' ' or ' invisible')"> <div class="hbclosebox"> - <img onclick="hide_element('retmsgsdiv')" + <img onclick="hide_msgs('retmsgsdiv')" src="x.png" class="closeBox" title="dismiss" /> </div> <p class="retmsgs">Status messages:</p> - <ul class="statusmsg"> - <tal:block tal:repeat="e python:ret['messages']"> - <li class="statusmsg" tal:content="python:e" /> + <ul class="statusmsg" id="statusmsglist"> + <tal:block tal:condition="exists:ret/messages" + tal:repeat="e ret/messages"> + <li class="statusmsg" tal:content="e" /> </tal:block> </ul> </div> - <div id="errmsgsdiv" class="errmsgs" tal:condition="python:(ret and 'errors' in ret and len(ret['errors']))"> + <div id="errmsgsdiv" + tal:attributes="class python:'errmsgs' + ((ret and ret.get('errors') and len(ret.get('errors')) > 0) and ' ' or ' invisible')"> <div class="hbclosebox"> - <img onclick="hide_element('errmsgsdiv')" + <img onclick="hide_msgs('errmsgsdiv')" src="x.png" class="closeBox" title="dismiss" /> </div> <p class="errmsgs">The following errors occurred:</p> - <ul class="statusmsg"> - <tal:block tal:repeat="e python:ret['errors']"> - <li class="statusmsg" tal:content="python:e" /> + <ul class="statusmsg" id="errmsglist"> + <tal:block tal:condition="exists:ret/errors" + tal:repeat="e ret/errors"> + <li class="statusmsg" tal:content="e" /> </tal:block> </ul> </div> - </tal:block> </tal:block> + </div> </div>