#!/usr/bin/env python # coding: utf8 from gluon.html import * from gluon.http import * from gluon.validators import * from gluon.sqlhtml import * from ajaxform import * from lxml import etree from lxml import objectify # request, response, session, cache, T, db(s) # must be passed and cannot be imported! class PoolRenameForm(AjaxForm): def __init__(self, pool, translator, **attributes): AjaxForm.__init__( self, translator, **attributes) poolName = objectify.fromstring( pool.XMLDesc(0) ).name self.form.append( INPUT( _name='pool_uuid', _type='hidden', _value=pool.UUIDString()) ) self.layout.addRow( LABEL(self.T('Name:')), INPUT( _value = poolName, _type='text', _name='pool_name', requires = IS_NOT_EMPTY( error_message=self.T("Requires a pool name") ) ) ) self.layout.addRow( HR( )) self.layout.addRow( DIV( INPUT( _value=self.T('Rename'), _type='button', _id='pool_ok_button', _class='submit_button' ), INPUT( _value=self.T('Reset'), _type='button', _id='pool_reset_button', _class='reset_button' ), _class = 'button-group') )