From mboxrd@z Thu Jan 1 00:00:00 1970 From: kupcevic@sourceware.org Date: 9 Oct 2006 19:11:59 -0000 Subject: [Cluster-devel] conga/luci site/luci/Extensions/StorageReport. ... Message-ID: <20061009191159.20970.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: conga Changes by: kupcevic at sourceware.org 2006-10-09 19:11:59 Modified files: luci/site/luci/Extensions: StorageReport.py luci/storage : form-macros Log message: luci storage: hide submit/reset buttons if nothing to modify Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/StorageReport.py.diff?cvsroot=cluster&r1=1.12&r2=1.13 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/form-macros.diff?cvsroot=cluster&r1=1.10&r2=1.11 --- conga/luci/site/luci/Extensions/StorageReport.py 2006/10/09 17:03:17 1.12 +++ conga/luci/site/luci/Extensions/StorageReport.py 2006/10/09 19:11:59 1.13 @@ -481,6 +481,8 @@ if type == MAPPER_VG_TYPE: link_snapshots(mapper_ret) + mapper_ret['need_apply_button'] = mutable_props(mapper_ret['props']) + return mapper_ret @@ -643,6 +645,8 @@ mapper_ret['actions'] = [] + mapper_ret['need_apply_button'] = True + return mapper_ret @@ -1523,6 +1527,16 @@ actions.append(action) data['actions'] = actions + need_apply_butt = mutable_props(data['props']) + if need_apply_butt == False: + if len(data['contents']) > 1: + need_apply_butt = True + elif len(data['contents']) == 1: + need_apply_butt = mutable_props(data['contents'][0]['props']) + else: + need_apply_butt = False + data['need_apply_button'] = need_apply_butt + return data @@ -1621,6 +1635,14 @@ +def mutable_props(props): + for name in props: + type = props[name]['type'] + if type == 'int' or type == 'text' or type == 'select': + return True + return False + + def get_content_data_internal(session, bd_xml): c_xml = None --- conga/luci/storage/form-macros 2006/10/09 17:03:17 1.10 +++ conga/luci/storage/form-macros 2006/10/09 19:11:59 1.11 @@ -1580,27 +1580,34 @@ - - - + +   + + + + + + @@ -1712,19 +1719,26 @@ - - + +   + + + + +